diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-06 20:43:31 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-06 20:43:31 +0000 |
commit | ca77581c3138913ae4816043d591d1dc4e01eaad (patch) | |
tree | 5793efde9b235b339fdd99189270f1143cf1c7b7 /cloud_print/virtual_driver | |
parent | 464cddaa575a10f5733bfebec77fb6b569dcdd17 (diff) | |
download | chromium_src-ca77581c3138913ae4816043d591d1dc4e01eaad.zip chromium_src-ca77581c3138913ae4816043d591d1dc4e01eaad.tar.gz chromium_src-ca77581c3138913ae4816043d591d1dc4e01eaad.tar.bz2 |
Use base namespace for string16 in components and cloud_print.
R=scottbyer@chromium.org
TBR=scottbyer
Review URL: https://codereview.chromium.org/107383002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239255 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cloud_print/virtual_driver')
4 files changed, 23 insertions, 21 deletions
diff --git a/cloud_print/virtual_driver/win/install/setup.cc b/cloud_print/virtual_driver/win/install/setup.cc index 1c87ca2..2ac07ed 100644 --- a/cloud_print/virtual_driver/win/install/setup.cc +++ b/cloud_print/virtual_driver/win/install/setup.cc @@ -63,7 +63,7 @@ const char kRegisterSwitch[] = "register"; const char kUninstallSwitch[] = "uninstall"; const char kUnregisterSwitch[] = "unregister"; -base::FilePath GetSystemPath(const string16& binary) { +base::FilePath GetSystemPath(const base::string16& binary) { base::FilePath path; if (!PathService::Get(base::DIR_SYSTEM, &path)) { LOG(ERROR) << "Unable to get system path."; @@ -72,7 +72,7 @@ base::FilePath GetSystemPath(const string16& binary) { return path.Append(binary); } -base::FilePath GetNativeSystemPath(const string16& binary) { +base::FilePath GetNativeSystemPath(const base::string16& binary) { if (!IsSystem64Bit()) return GetSystemPath(binary); base::FilePath path; @@ -254,7 +254,7 @@ HRESULT InstallDriver(const base::FilePath& install_path) { return HRESULT_FROM_WIN32(ERROR_CANNOT_MAKE); ReadyDriverDependencies(temp_path.path()); - std::vector<string16> dependent_array; + std::vector<base::string16> dependent_array; // Add all files. AddPrinterDriverEx will removes unnecessary. for (size_t i = 0; i < arraysize(kDependencyList); ++i) { base::FilePath file_path = temp_path.path().Append(kDependencyList[i]); @@ -287,18 +287,18 @@ HRESULT InstallDriver(const base::FilePath& install_path) { driver_info.pDriverPath = const_cast<LPWSTR>(xps_path.value().c_str()); driver_info.pConfigFile = const_cast<LPWSTR>(ui_path.value().c_str()); - string16 dependent_files(JoinString(dependent_array, L'\n')); + base::string16 dependent_files(JoinString(dependent_array, L'\n')); dependent_files.push_back(L'\n'); std::replace(dependent_files.begin(), dependent_files.end(), L'\n', L'\0'); driver_info.pDependentFiles = &dependent_files[0]; // Set up user visible strings. - string16 manufacturer = LoadLocalString(IDS_GOOGLE); + base::string16 manufacturer = LoadLocalString(IDS_GOOGLE); driver_info.pszMfgName = const_cast<LPWSTR>(manufacturer.c_str()); driver_info.pszProvider = const_cast<LPWSTR>(manufacturer.c_str()); driver_info.pszOEMUrl = const_cast<LPWSTR>(kGcpUrl); driver_info.dwlDriverVersion = GetVersionNumber(); - string16 driver_name = LoadLocalString(IDS_DRIVER_NAME); + base::string16 driver_name = LoadLocalString(IDS_DRIVER_NAME); driver_info.pName = const_cast<LPWSTR>(driver_name.c_str()); if (!::AddPrinterDriverEx(NULL, 6, reinterpret_cast<BYTE*>(&driver_info), @@ -311,7 +311,7 @@ HRESULT InstallDriver(const base::FilePath& install_path) { HRESULT UninstallDriver() { int tries = 3; - string16 driver_name = LoadLocalString(IDS_DRIVER_NAME); + base::string16 driver_name = LoadLocalString(IDS_DRIVER_NAME); while (!DeletePrinterDriverEx(NULL, NULL, const_cast<LPWSTR>(driver_name.c_str()), @@ -340,12 +340,12 @@ HRESULT InstallPrinter(void) { // None of the print API structures likes constant strings even though they // don't modify the string. const_casting is the cleanest option. - string16 driver_name = LoadLocalString(IDS_DRIVER_NAME); + base::string16 driver_name = LoadLocalString(IDS_DRIVER_NAME); printer_info.pDriverName = const_cast<LPWSTR>(driver_name.c_str()); printer_info.pPrinterName = const_cast<LPWSTR>(driver_name.c_str()); printer_info.pComment = const_cast<LPWSTR>(driver_name.c_str()); printer_info.pLocation = const_cast<LPWSTR>(kGcpUrl); - string16 port_name; + base::string16 port_name; printer_info.pPortName = const_cast<LPWSTR>(kPortName); printer_info.Attributes = PRINTER_ATTRIBUTE_DIRECT|PRINTER_ATTRIBUTE_LOCAL; printer_info.pPrintProcessor = L"winprint"; @@ -363,7 +363,7 @@ HRESULT UninstallPrinter(void) { HANDLE handle = NULL; PRINTER_DEFAULTS printer_defaults = {0}; printer_defaults.DesiredAccess = PRINTER_ALL_ACCESS; - string16 driver_name = LoadLocalString(IDS_DRIVER_NAME); + base::string16 driver_name = LoadLocalString(IDS_DRIVER_NAME); if (!OpenPrinter(const_cast<LPWSTR>(driver_name.c_str()), &handle, &printer_defaults)) { 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 a68c29e..6171296 100644 --- a/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc +++ b/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc @@ -135,7 +135,7 @@ void DeleteLeakedFiles(const base::FilePath& dir) { // On failure returns FALSE and title is unmodified. bool GetJobTitle(HANDLE printer_handle, DWORD job_id, - string16 *title) { + base::string16 *title) { DCHECK(printer_handle != NULL); DCHECK(title != NULL); DWORD bytes_needed = 0; @@ -163,7 +163,7 @@ bool GetJobTitle(HANDLE printer_handle, // Verifies that a valid parent Window exists and then just displays an // error message to let the user know that there is no interactive // configuration. -void HandlePortUi(HWND hwnd, const string16& caption) { +void HandlePortUi(HWND hwnd, const base::string16& caption) { if (hwnd != NULL && IsWindow(hwnd)) { DisplayWindowsMessage(hwnd, CO_E_NOT_SUPPORTED, cloud_print::kPortName); } @@ -196,7 +196,7 @@ bool GetUserToken(HANDLE* primary_token) { // xps_path references a file to print. // job_title is the title to be used for the resulting print job. bool LaunchPrintDialog(const base::FilePath& xps_path, - const string16& job_title) { + const base::string16& job_title) { HANDLE token = NULL; if (!GetUserToken(&token)) { LOG(ERROR) << "Unable to get user token."; @@ -286,7 +286,7 @@ bool ValidateCurrentUser() { base::FilePath ReadPathFromRegistry(HKEY root, const wchar_t* path_name) { base::win::RegKey gcp_key(HKEY_CURRENT_USER, kCloudPrintRegKey, KEY_READ); - string16 data; + base::string16 data; if (SUCCEEDED(gcp_key.ReadValue(path_name, &data)) && base::PathExists(base::FilePath(data))) { return base::FilePath(data); @@ -484,7 +484,7 @@ BOOL WINAPI Monitor2EndDocPort(HANDLE port_handle) { int64 file_size = 0; base::GetFileSize(port_data->file_path, &file_size); if (file_size > 0) { - string16 job_title; + base::string16 job_title; if (port_data->printer_handle != NULL) { GetJobTitle(port_data->printer_handle, port_data->job_id, diff --git a/cloud_print/virtual_driver/win/virtual_driver_helpers.cc b/cloud_print/virtual_driver/win/virtual_driver_helpers.cc index e214529..26a2bdf 100644 --- a/cloud_print/virtual_driver/win/virtual_driver_helpers.cc +++ b/cloud_print/virtual_driver/win/virtual_driver_helpers.cc @@ -17,15 +17,16 @@ namespace cloud_print { const size_t kMaxMessageLen = 100; -void DisplayWindowsMessage(HWND hwnd, HRESULT hr, const string16 &caption) { +void DisplayWindowsMessage(HWND hwnd, HRESULT hr, + const base::string16 &caption) { ::MessageBox(hwnd, GetErrorMessage(hr).c_str(), caption.c_str(), MB_OK); } -string16 GetPortMonitorDllName() { +base::string16 GetPortMonitorDllName() { if (IsSystem64Bit()) { - return string16(L"gcp_portmon64.dll"); + return base::string16(L"gcp_portmon64.dll"); } else { - return string16(L"gcp_portmon.dll"); + return base::string16(L"gcp_portmon.dll"); } } diff --git a/cloud_print/virtual_driver/win/virtual_driver_helpers.h b/cloud_print/virtual_driver/win/virtual_driver_helpers.h index 7a275ac..426265f 100644 --- a/cloud_print/virtual_driver/win/virtual_driver_helpers.h +++ b/cloud_print/virtual_driver/win/virtual_driver_helpers.h @@ -19,10 +19,11 @@ namespace cloud_print { bool IsSystem64Bit(); // Convert an HRESULT to a localized string and display it in a message box. -void DisplayWindowsMessage(HWND hwnd, HRESULT hr, const string16 &caption); +void DisplayWindowsMessage(HWND hwnd, HRESULT hr, + const base::string16 &caption); // Returns the correct port monitor DLL file name for the current machine. -string16 GetPortMonitorDllName(); +base::string16 GetPortMonitorDllName(); // Gets the standard install path for "version 3" print drivers. HRESULT GetPrinterDriverDir(base::FilePath* path); |