diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-18 06:14:59 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-18 06:14:59 +0000 |
commit | 631a54712d79c39bb7fbd322e3e4dc6b2429686d (patch) | |
tree | ecefa4d7d12d7dd79e489065c2555781bab9b5f5 /cloud_print | |
parent | e541ac7357c2178ee785764ab0415f94f5ec9bd7 (diff) | |
download | chromium_src-631a54712d79c39bb7fbd322e3e4dc6b2429686d.zip chromium_src-631a54712d79c39bb7fbd322e3e4dc6b2429686d.tar.gz chromium_src-631a54712d79c39bb7fbd322e3e4dc6b2429686d.tar.bz2 |
Fix more remaining FilePath -> base::FilePath.
This removes the "using" in file_path.h for Mac since Mac now passes trybots with no using. It still leaves the using for Windows.
Review URL: https://codereview.chromium.org/12294008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@183066 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cloud_print')
9 files changed, 90 insertions, 90 deletions
diff --git a/cloud_print/service/win/chrome_launcher.cc b/cloud_print/service/win/chrome_launcher.cc index 5df9bae..2fafe6f 100644 --- a/cloud_print/service/win/chrome_launcher.cc +++ b/cloud_print/service/win/chrome_launcher.cc @@ -51,7 +51,7 @@ bool LaunchProcess(const CommandLine& cmdline, } // namespace -ChromeLauncher::ChromeLauncher(const FilePath& user_data) +ChromeLauncher::ChromeLauncher(const base::FilePath& user_data) : stop_event_(true, true), user_data_(user_data) { } @@ -78,7 +78,7 @@ void ChromeLauncher::Run() { for (base::TimeDelta time_out = default_time_out;; time_out = std::min(time_out * 2, max_time_out)) { - FilePath chrome_path = chrome_launcher_support::GetAnyChromePath(); + base::FilePath chrome_path = chrome_launcher_support::GetAnyChromePath(); if (!chrome_path.empty()) { CommandLine cmd(chrome_path); diff --git a/cloud_print/service/win/chrome_launcher.h b/cloud_print/service/win/chrome_launcher.h index bc257ff..322e21f 100644 --- a/cloud_print/service/win/chrome_launcher.h +++ b/cloud_print/service/win/chrome_launcher.h @@ -14,7 +14,7 @@ class ChromeLauncher : public base::DelegateSimpleThread::Delegate { public: - explicit ChromeLauncher(const FilePath& user_data); + explicit ChromeLauncher(const base::FilePath& user_data); virtual ~ChromeLauncher(); @@ -24,7 +24,7 @@ class ChromeLauncher : public base::DelegateSimpleThread::Delegate { virtual void Run() OVERRIDE; private: - FilePath user_data_; + base::FilePath user_data_; base::WaitableEvent stop_event_; scoped_ptr<base::DelegateSimpleThread> thread_; diff --git a/cloud_print/service/win/cloud_print_service.cc b/cloud_print/service/win/cloud_print_service.cc index 3d1e7f0..b4a2ae6 100644 --- a/cloud_print/service/win/cloud_print_service.cc +++ b/cloud_print/service/win/cloud_print_service.cc @@ -68,7 +68,7 @@ HRESULT HResultFromLastError() { } void InvalidUsage() { - FilePath service_path; + base::FilePath service_path; CHECK(PathService::Get(base::FILE_EXE, &service_path)); std::cout << "Usage: "; @@ -193,7 +193,7 @@ class CloudPrintServiceModule if (FAILED(hr)) return hr; - FilePath service_path; + base::FilePath service_path; CHECK(PathService::Get(base::FILE_EXE, &service_path)); CommandLine command_line(service_path); command_line.AppendSwitch(run_switch); @@ -346,7 +346,7 @@ class CloudPrintServiceModule WideToASCII(*run_as_user), false)); *run_as_password = ASCIIToWide(GetOption("Password", "", true)); - FilePath requirements_filename(user_data_dir_); + base::FilePath requirements_filename(user_data_dir_); requirements_filename = requirements_filename.Append(kRequirementsFileName); @@ -389,7 +389,7 @@ class CloudPrintServiceModule } HRESULT SetupServiceState() { - FilePath file = user_data_dir_.Append(kServiceStateFileName); + base::FilePath file = user_data_dir_.Append(kServiceStateFileName); for (;;) { std::string contents; @@ -492,7 +492,7 @@ class CloudPrintServiceModule } HRESULT CheckRequirements() { - FilePath requirements_filename(user_data_dir_); + base::FilePath requirements_filename(user_data_dir_); requirements_filename = requirements_filename.Append(kRequirementsFileName); std::string output; output.append("Printers available for " + @@ -506,7 +506,7 @@ class CloudPrintServiceModule output += printer_list[i].printer_name; output += "\n"; } - FilePath chrome = chrome_launcher_support::GetAnyChromePath(); + base::FilePath chrome = chrome_launcher_support::GetAnyChromePath(); output.append(chrome.empty() ? kChromeIsNotAvalible : kChromeIsAvalible); file_util::WriteFile(requirements_filename, output.c_str(), output.size()); return S_OK; @@ -527,7 +527,7 @@ class CloudPrintServiceModule static BOOL WINAPI ConsoleCtrlHandler(DWORD type); bool check_requirements_; - FilePath user_data_dir_; + base::FilePath user_data_dir_; scoped_ptr<ChromeLauncher> chrome_; }; diff --git a/cloud_print/virtual_driver/win/install/setup.cc b/cloud_print/virtual_driver/win/install/setup.cc index 3583132..1448671 100644 --- a/cloud_print/virtual_driver/win/install/setup.cc +++ b/cloud_print/virtual_driver/win/install/setup.cc @@ -87,8 +87,8 @@ void DeleteGoogleUpdateKeys() { } } -FilePath GetSystemPath(const string16& binary) { - FilePath path; +base::FilePath GetSystemPath(const string16& binary) { + base::FilePath path; if (!PathService::Get(base::DIR_SYSTEM, &path)) { LOG(ERROR) << "Unable to get system path."; return path; @@ -96,10 +96,10 @@ FilePath GetSystemPath(const string16& binary) { return path.Append(binary); } -FilePath GetNativeSystemPath(const string16& binary) { +base::FilePath GetNativeSystemPath(const string16& binary) { if (!cloud_print::IsSystem64Bit()) return GetSystemPath(binary); - FilePath path; + base::FilePath path; // Sysnative will bypass filesystem redirection and give us // the location of the 64bit system32 from a 32 bit process. if (!PathService::Get(base::DIR_WINDOWS, &path)) { @@ -110,7 +110,7 @@ FilePath GetNativeSystemPath(const string16& binary) { } void SpoolerServiceCommand(const char* command) { - FilePath net_path = GetNativeSystemPath(L"net"); + base::FilePath net_path = GetNativeSystemPath(L"net"); if (net_path.empty()) return; CommandLine command_line(net_path); @@ -125,16 +125,16 @@ void SpoolerServiceCommand(const char* command) { base::LaunchProcess(command_line, options, NULL); } -HRESULT RegisterPortMonitor(bool install, const FilePath& install_path) { +HRESULT RegisterPortMonitor(bool install, const base::FilePath& install_path) { DCHECK(install || install_path.empty()); - FilePath target_path = + base::FilePath target_path = GetNativeSystemPath(cloud_print::GetPortMonitorDllName()); if (target_path.empty()) { LOG(ERROR) << "Unable to get port monitor target path."; return HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND); } if (install) { - FilePath source_path = + base::FilePath source_path = install_path.Append(cloud_print::GetPortMonitorDllName()); if (!file_util::CopyFile(source_path, target_path)) { LOG(ERROR) << "Unable copy port monitor dll from " << @@ -146,7 +146,7 @@ HRESULT RegisterPortMonitor(bool install, const FilePath& install_path) { return S_OK; } - FilePath regsvr32_path = GetNativeSystemPath(L"regsvr32.exe"); + base::FilePath regsvr32_path = GetNativeSystemPath(L"regsvr32.exe"); if (regsvr32_path.empty()) { LOG(ERROR) << "Can't find regsvr32.exe."; return HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND); @@ -215,15 +215,15 @@ UINT CALLBACK CabinetCallback(PVOID data, UINT notification, UINT_PTR param1, UINT_PTR param2 ) { - FilePath* temp_path = reinterpret_cast<FilePath*>(data); + base::FilePath* temp_path = reinterpret_cast<base::FilePath*>(data); if (notification == SPFILENOTIFY_FILEINCABINET) { FILE_IN_CABINET_INFO* info = reinterpret_cast<FILE_IN_CABINET_INFO*>(param1); for (int i = 0; i < arraysize(kDependencyList); i++) { - FilePath base_name(info->NameInCabinet); + base::FilePath base_name(info->NameInCabinet); base_name = base_name.BaseName(); - if (FilePath::CompareEqualIgnoreCase(base_name.value().c_str(), - kDependencyList[i])) { + if (base::FilePath::CompareEqualIgnoreCase(base_name.value().c_str(), + kDependencyList[i])) { StringCchCopy(info->FullTargetName, MAX_PATH, temp_path->Append(kDependencyList[i]).value().c_str()); return FILEOP_DOIT; @@ -235,7 +235,7 @@ UINT CALLBACK CabinetCallback(PVOID data, return NO_ERROR; } -void ReadyPpdDependencies(const FilePath& install_path) { +void ReadyPpdDependencies(const base::FilePath& install_path) { base::win::Version version = base::win::GetVersion(); if (version >= base::win::VERSION_VISTA) { // GetCorePrinterDrivers and GetPrinterDriverPackagePath only exist on @@ -259,19 +259,19 @@ void ReadyPpdDependencies(const FilePath& install_path) { SetupIterateCabinet(package_path, 0, CabinetCallback, - const_cast<FilePath*>(&install_path)); + const_cast<base::FilePath*>(&install_path)); } else { // PS driver files are in the sp3 cab. - FilePath package_path; + base::FilePath package_path; PathService::Get(base::DIR_WINDOWS, &package_path); package_path = package_path.Append(L"Driver Cache\\i386\\sp3.cab"); SetupIterateCabinet(package_path.value().c_str(), 0, CabinetCallback, - const_cast<FilePath*>(&install_path)); + const_cast<base::FilePath*>(&install_path)); // The XPS driver files are just sitting uncompressed in the driver cache. - FilePath xps_path; + base::FilePath xps_path; PathService::Get(base::DIR_WINDOWS, &xps_path); xps_path = xps_path.Append(L"Driver Cache\\i386"); xps_path = xps_path.Append(kDriverName); @@ -279,15 +279,15 @@ void ReadyPpdDependencies(const FilePath& install_path) { } } -HRESULT InstallPpd(const FilePath& install_path) { +HRESULT InstallPpd(const base::FilePath& install_path) { DRIVER_INFO_6 driver_info = {0}; HRESULT result = S_OK; // Set up paths for the files we depend on. - FilePath ppd_path = install_path.Append(kPpdName); - FilePath xps_path = install_path.Append(kDriverName); - FilePath ui_path = install_path.Append(kUiDriverName); - FilePath ui_help_path = install_path.Append(kHelpName); + base::FilePath ppd_path = install_path.Append(kPpdName); + base::FilePath xps_path = install_path.Append(kDriverName); + base::FilePath ui_path = install_path.Append(kUiDriverName); + base::FilePath ui_help_path = install_path.Append(kHelpName); ReadyPpdDependencies(install_path); // None of the print API structures likes constant strings even though they // don't modify the string. const_casting is the cleanest option. @@ -390,7 +390,7 @@ HRESULT UninstallPrinter(void) { return S_OK; } -void SetupUninstall(const FilePath& install_path) { +void SetupUninstall(const base::FilePath& install_path) { // Now write the Windows Uninstall entries // Minimal error checking here since the install can contiunue // if this fails. @@ -438,7 +438,7 @@ bool IsOSSupported() { (base::win::OSInfo::GetInstance()->service_pack().major >= 3)); } -HRESULT RegisterVirtualDriver(const FilePath& install_path) { +HRESULT RegisterVirtualDriver(const base::FilePath& install_path) { HRESULT result = S_OK; DCHECK(file_util::DirectoryExists(install_path)); @@ -468,17 +468,17 @@ HRESULT RegisterVirtualDriver(const FilePath& install_path) { return S_OK; } -void GetCurrentInstallPath(FilePath* install_path) { +void GetCurrentInstallPath(base::FilePath* install_path) { base::win::RegKey key; if (key.Open(HKEY_LOCAL_MACHINE, kUninstallRegistry, KEY_QUERY_VALUE) != ERROR_SUCCESS) { // Not installed. - *install_path = FilePath(); + *install_path = base::FilePath(); return; } string16 install_path_value; key.ReadValue(L"InstallLocation", &install_path_value); - *install_path = FilePath(install_path_value); + *install_path = base::FilePath(install_path_value); } HRESULT TryUnregisterVirtualDriver() { @@ -494,7 +494,7 @@ HRESULT TryUnregisterVirtualDriver() { return result; } // The second argument is ignored if the first is false. - result = RegisterPortMonitor(false, FilePath()); + result = RegisterPortMonitor(false, base::FilePath()); if (FAILED(result)) { LOG(ERROR) << "Unable to remove port monitor."; return result; @@ -516,8 +516,8 @@ HRESULT UnregisterVirtualDriver() { return hr; } -HRESULT DeleteProgramDir(const FilePath& installer_source, bool wait) { - FilePath temp_path; +HRESULT DeleteProgramDir(const base::FilePath& installer_source, bool wait) { + base::FilePath temp_path; if (file_util::CreateTemporaryFile(&temp_path)) { file_util::CopyFile(installer_source, temp_path); file_util::DeleteAfterReboot(temp_path); @@ -551,7 +551,7 @@ HRESULT DoUninstall() { if (FAILED(result)) return result; CleanupUninstall(); - FilePath installer_source; + base::FilePath installer_source; if (PathService::Get(base::FILE_EXE, &installer_source)) return DeleteProgramDir(installer_source, false); return S_OK; @@ -561,14 +561,14 @@ HRESULT DoUnregister() { return UnregisterVirtualDriver(); } -HRESULT DoRegister(const FilePath& install_path) { +HRESULT DoRegister(const base::FilePath& install_path) { HRESULT result = UnregisterVirtualDriver(); if (FAILED(result)) return result; return RegisterVirtualDriver(install_path); } -HRESULT DoDelete(const FilePath& install_path) { +HRESULT DoDelete(const base::FilePath& install_path) { if (install_path.value().empty()) return E_INVALIDARG; if (!file_util::DirectoryExists(install_path)) @@ -577,13 +577,13 @@ HRESULT DoDelete(const FilePath& install_path) { return file_util::Delete(install_path, true) ? S_OK : E_FAIL; } -HRESULT DoInstall(const FilePath& install_path) { +HRESULT DoInstall(const base::FilePath& install_path) { HRESULT result = UnregisterVirtualDriver(); if (FAILED(result)) { LOG(ERROR) << "Unable to unregister."; return result; } - FilePath old_install_path; + base::FilePath old_install_path; GetCurrentInstallPath(&old_install_path); if (!old_install_path.value().empty() && install_path != old_install_path) { @@ -601,7 +601,7 @@ HRESULT DoInstall(const FilePath& install_path) { HRESULT ExecuteCommands() { const CommandLine& command_line = *CommandLine::ForCurrentProcess(); - FilePath exe_path; + base::FilePath exe_path; if (FAILED(PathService::Get(base::DIR_EXE, &exe_path)) || !file_util::DirectoryExists(exe_path)) { return HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND); diff --git a/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc b/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc index 34884e4..e833145 100644 --- a/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc +++ b/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc @@ -67,7 +67,7 @@ struct PortData { DWORD job_id; HANDLE printer_handle; FILE* file; - FilePath file_path; + base::FilePath file_path; }; typedef struct { @@ -104,21 +104,21 @@ MONITOR2 g_monitor_2 = { Monitor2Shutdown }; -FilePath GetAppDataDir() { - FilePath file_path; +base::FilePath GetAppDataDir() { + base::FilePath file_path; if (!PathService::Get(base::DIR_LOCAL_APP_DATA_LOW, &file_path)) { LOG(ERROR) << "Can't get DIR_LOCAL_APP_DATA_LOW"; - return FilePath(); + return base::FilePath(); } return file_path.Append(kAppDataDir); } // Delete files which where not deleted by chrome. -void DeleteLeakedFiles(const FilePath& dir) { +void DeleteLeakedFiles(const base::FilePath& dir) { using file_util::FileEnumerator; base::Time delete_before = base::Time::Now() - base::TimeDelta::FromDays(1); FileEnumerator enumerator(dir, false, FileEnumerator::FILES); - for (FilePath file_path = enumerator.Next(); !file_path.empty(); + for (base::FilePath file_path = enumerator.Next(); !file_path.empty(); file_path = enumerator.Next()) { FileEnumerator::FindInfo info; enumerator.GetFindInfo(&info); @@ -193,7 +193,7 @@ bool GetUserToken(HANDLE* primary_token) { // Launches the Cloud Print dialog in Chrome. // xps_path references a file to print. // job_title is the title to be used for the resulting print job. -bool LaunchPrintDialog(const FilePath& xps_path, +bool LaunchPrintDialog(const base::FilePath& xps_path, const string16& job_title) { HANDLE token = NULL; if (!GetUserToken(&token)) { @@ -202,7 +202,7 @@ bool LaunchPrintDialog(const FilePath& xps_path, } base::win::ScopedHandle primary_token_scoped(token); - FilePath chrome_path = GetChromeExePath(); + base::FilePath chrome_path = GetChromeExePath(); if (chrome_path.empty()) { LOG(ERROR) << "Unable to get chrome exe path."; return false; @@ -210,7 +210,7 @@ bool LaunchPrintDialog(const FilePath& xps_path, CommandLine command_line(chrome_path); - FilePath chrome_profile = GetChromeProfilePath(); + base::FilePath chrome_profile = GetChromeProfilePath(); if (!chrome_profile.empty()) { command_line.AppendSwitchPath(switches::kCloudPrintUserDataDir, chrome_profile); @@ -243,7 +243,7 @@ void LaunchChromeDownloadPage() { } base::win::ScopedHandle token_scoped(token); - FilePath ie_path; + base::FilePath ie_path; PathService::Get(base::DIR_PROGRAM_FILESX86, &ie_path); ie_path = ie_path.Append(kIePath); CommandLine command_line(ie_path); @@ -283,35 +283,35 @@ bool ValidateCurrentUser() { } } // namespace -FilePath ReadPathFromRegistry(HKEY root, const wchar_t* path_name) { +base::FilePath ReadPathFromRegistry(HKEY root, const wchar_t* path_name) { base::win::RegKey gcp_key(HKEY_CURRENT_USER, kCloudPrintRegKey, KEY_READ); string16 data; if (SUCCEEDED(gcp_key.ReadValue(path_name, &data)) && - file_util::PathExists(FilePath(data))) { - return FilePath(data); + file_util::PathExists(base::FilePath(data))) { + return base::FilePath(data); } - return FilePath(); + return base::FilePath(); } -FilePath ReadPathFromAnyRegistry(const wchar_t* path_name) { - FilePath result = ReadPathFromRegistry(HKEY_CURRENT_USER, path_name); +base::FilePath ReadPathFromAnyRegistry(const wchar_t* path_name) { + base::FilePath result = ReadPathFromRegistry(HKEY_CURRENT_USER, path_name); if (!result.empty()) return result; return ReadPathFromRegistry(HKEY_LOCAL_MACHINE, path_name); } -FilePath GetChromeExePath() { - FilePath path = ReadPathFromAnyRegistry(kChromeExePathRegValue); +base::FilePath GetChromeExePath() { + base::FilePath path = ReadPathFromAnyRegistry(kChromeExePathRegValue); if (!path.empty()) return path; return chrome_launcher_support::GetAnyChromePath(); } -FilePath GetChromeProfilePath() { - FilePath path = ReadPathFromAnyRegistry(kChromeProfilePathRegValue); +base::FilePath GetChromeProfilePath() { + base::FilePath path = ReadPathFromAnyRegistry(kChromeProfilePathRegValue); if (!path.empty() && file_util::DirectoryExists(path)) return path; - return FilePath(); + return base::FilePath(); } BOOL WINAPI Monitor2EnumPorts(HANDLE, @@ -437,8 +437,8 @@ BOOL WINAPI Monitor2StartDocPort(HANDLE port_handle, // This is the normal flow during a unit test. port_data->printer_handle = NULL; } - FilePath& file_path = port_data->file_path; - FilePath app_data_dir = GetAppDataDir(); + base::FilePath& file_path = port_data->file_path; + base::FilePath app_data_dir = GetAppDataDir(); if (app_data_dir.empty()) return FALSE; DeleteLeakedFiles(app_data_dir); @@ -586,7 +586,7 @@ DWORD WINAPI Monitor2XcvDataPort(HANDLE xcv_handle, // dynamic creation of ports. if (lstrcmp(L"MonitorUI", data_name) == 0) { DWORD dll_path_len = 0; - FilePath dll_path(GetPortMonitorDllName()); + base::FilePath dll_path(GetPortMonitorDllName()); dll_path_len = static_cast<DWORD>(dll_path.value().length()); if (output_data_bytes_needed != NULL) { *output_data_bytes_needed = dll_path_len; diff --git a/cloud_print/virtual_driver/win/port_monitor/port_monitor.h b/cloud_print/virtual_driver/win/port_monitor/port_monitor.h index b26999f..3e21f88 100644 --- a/cloud_print/virtual_driver/win/port_monitor/port_monitor.h +++ b/cloud_print/virtual_driver/win/port_monitor/port_monitor.h @@ -14,10 +14,10 @@ namespace cloud_print { // Returns path to be used for launching Chrome. -FilePath GetChromeExePath(); +base::FilePath GetChromeExePath(); // Returns path to user profile to be used for launching Chrome. -FilePath GetChromeProfilePath(); +base::FilePath GetChromeProfilePath(); // Implementations for the function pointers in the MONITOR2 structure // returned by InitializePrintMonitor2. The prototypes and behaviors diff --git a/cloud_print/virtual_driver/win/port_monitor/port_monitor_dll.cc b/cloud_print/virtual_driver/win/port_monitor/port_monitor_dll.cc index c6acfda..e9cf3b5 100644 --- a/cloud_print/virtual_driver/win/port_monitor/port_monitor_dll.cc +++ b/cloud_print/virtual_driver/win/port_monitor/port_monitor_dll.cc @@ -39,7 +39,7 @@ namespace { // Returns true if Xps support is installed. bool XpsIsInstalled() { - FilePath xps_path; + base::FilePath xps_path; if (!SUCCEEDED(GetPrinterDriverDir(&xps_path))) { return false; } @@ -80,7 +80,7 @@ HRESULT WINAPI DllRegisterServer(void) { MONITOR_INFO_2 monitor_info = {0}; // YUCK!!! I can either copy the constant, const_cast, or define my own // MONITOR_INFO_2 that will take const strings. - FilePath dll_path(cloud_print::GetPortMonitorDllName()); + base::FilePath dll_path(cloud_print::GetPortMonitorDllName()); monitor_info.pDLLName = const_cast<LPWSTR>(dll_path.value().c_str()); monitor_info.pName = const_cast<LPWSTR>(dll_path.value().c_str()); if (AddMonitor(NULL, 2, reinterpret_cast<BYTE*>(&monitor_info))) { @@ -94,7 +94,7 @@ HRESULT WINAPI DllUnregisterServer(void) { if (!cloud_print::CanRegister()) { return E_ACCESSDENIED; } - FilePath dll_path(cloud_print::GetPortMonitorDllName()); + base::FilePath dll_path(cloud_print::GetPortMonitorDllName()); if (DeleteMonitor(NULL, NULL, const_cast<LPWSTR>(dll_path.value().c_str()))) { diff --git a/cloud_print/virtual_driver/win/port_monitor/port_monitor_unittest.cc b/cloud_print/virtual_driver/win/port_monitor/port_monitor_unittest.cc index 15bac4b..cc935bf 100644 --- a/cloud_print/virtual_driver/win/port_monitor/port_monitor_unittest.cc +++ b/cloud_print/virtual_driver/win/port_monitor/port_monitor_unittest.cc @@ -39,13 +39,13 @@ class PortMonitorTest : public testing::Test { cloud_print::kCloudPrintRegKey, KEY_ALL_ACCESS); - FilePath path; + base::FilePath path; PathService::Get(base::DIR_LOCAL_APP_DATA, &path); path = path.Append(kAlternateChromeExePath); ASSERT_EQ(ERROR_SUCCESS, key.WriteValue(cloud_print::kChromeExePathRegValue, path.value().c_str())); - FilePath temp; + base::FilePath temp; PathService::Get(base::DIR_TEMP, &temp); // Write any dir here. ASSERT_EQ(ERROR_SUCCESS, @@ -62,21 +62,21 @@ class PortMonitorTest : public testing::Test { } virtual void CreateTempChromeExeFiles() { - FilePath path; + base::FilePath path; PathService::Get(base::DIR_LOCAL_APP_DATA, &path); - FilePath main_path = path.Append(kChromeExePath); + base::FilePath main_path = path.Append(kChromeExePath); ASSERT_TRUE(file_util::CreateDirectory(main_path)); - FilePath alternate_path = path.Append(kAlternateChromeExePath); + base::FilePath alternate_path = path.Append(kAlternateChromeExePath); ASSERT_TRUE(file_util::CreateDirectory(alternate_path)); } virtual void DeleteTempChromeExeFiles() { - FilePath path; + base::FilePath path; PathService::Get(base::DIR_LOCAL_APP_DATA, &path); - FilePath main_path = path.Append(kChromeExePath); + base::FilePath main_path = path.Append(kChromeExePath); ASSERT_TRUE(file_util::Delete(main_path, true)); PathService::Get(base::DIR_LOCAL_APP_DATA, &path); - FilePath alternate_path = path.Append(kAlternateChromeExePath); + base::FilePath alternate_path = path.Append(kAlternateChromeExePath); ASSERT_TRUE(file_util::Delete(alternate_path, true)); } @@ -95,7 +95,7 @@ class PortMonitorTest : public testing::Test { TEST_F(PortMonitorTest, GetChromeExePathTest) { CreateTempChromeExeFiles(); - FilePath chrome_path = cloud_print::GetChromeExePath(); + base::FilePath chrome_path = cloud_print::GetChromeExePath(); EXPECT_FALSE(chrome_path.empty()); EXPECT_TRUE( chrome_path.value().rfind(kAlternateChromeExePath) != std::string::npos); @@ -108,9 +108,9 @@ TEST_F(PortMonitorTest, GetChromeExePathTest) { } TEST_F(PortMonitorTest, GetChromeProfilePathTest) { - FilePath data_path = cloud_print::GetChromeProfilePath(); + base::FilePath data_path = cloud_print::GetChromeProfilePath(); EXPECT_FALSE(data_path.empty()); - FilePath temp; + base::FilePath temp; PathService::Get(base::DIR_TEMP, &temp); EXPECT_EQ(data_path, temp); EXPECT_TRUE(file_util::DirectoryExists(data_path)); diff --git a/cloud_print/virtual_driver/win/virtual_driver_helpers.cc b/cloud_print/virtual_driver/win/virtual_driver_helpers.cc index 27c30bf..c331ff8 100644 --- a/cloud_print/virtual_driver/win/virtual_driver_helpers.cc +++ b/cloud_print/virtual_driver/win/virtual_driver_helpers.cc @@ -42,7 +42,7 @@ string16 GetPortMonitorDllName() { } } -HRESULT GetPrinterDriverDir(FilePath* path) { +HRESULT GetPrinterDriverDir(base::FilePath* path) { BYTE driver_dir_buffer[MAX_PATH * sizeof(wchar_t)]; DWORD needed = 0; if (!GetPrinterDriverDirectory(NULL, @@ -55,7 +55,7 @@ HRESULT GetPrinterDriverDir(FilePath* path) { // but that really shouldn't happen. return cloud_print::GetLastHResult(); } - *path = FilePath(reinterpret_cast<wchar_t*>(driver_dir_buffer)); + *path = base::FilePath(reinterpret_cast<wchar_t*>(driver_dir_buffer)); // The XPS driver is a "Level 3" driver *path = path->Append(L"3"); |