| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <windows.h> | 5 #include <windows.h> |
| 6 #include <setupapi.h> // Must be included after windows.h | 6 #include <setupapi.h> // Must be included after windows.h |
| 7 #include <winspool.h> | 7 #include <winspool.h> |
| 8 #include <iomanip> | 8 #include <iomanip> |
| 9 | 9 |
| 10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 // Set up supported print system version. Must be 3. | 276 // Set up supported print system version. Must be 3. |
| 277 driver_info.cVersion = 3; | 277 driver_info.cVersion = 3; |
| 278 | 278 |
| 279 // None of the print API structures likes constant strings even though they | 279 // None of the print API structures likes constant strings even though they |
| 280 // don't modify the string. const_casting is the cleanest option. | 280 // don't modify the string. const_casting is the cleanest option. |
| 281 driver_info.pDataFile = const_cast<LPWSTR>(data_file.value().c_str()); | 281 driver_info.pDataFile = const_cast<LPWSTR>(data_file.value().c_str()); |
| 282 driver_info.pHelpFile = const_cast<LPWSTR>(ui_help_path.value().c_str()); | 282 driver_info.pHelpFile = const_cast<LPWSTR>(ui_help_path.value().c_str()); |
| 283 driver_info.pDriverPath = const_cast<LPWSTR>(xps_path.value().c_str()); | 283 driver_info.pDriverPath = const_cast<LPWSTR>(xps_path.value().c_str()); |
| 284 driver_info.pConfigFile = const_cast<LPWSTR>(ui_path.value().c_str()); | 284 driver_info.pConfigFile = const_cast<LPWSTR>(ui_path.value().c_str()); |
| 285 | 285 |
| 286 base::string16 dependent_files(base::JoinString(dependent_array, L"\n")); | 286 base::string16 dependent_files(JoinString(dependent_array, L'\n')); |
| 287 dependent_files.push_back(L'\n'); | 287 dependent_files.push_back(L'\n'); |
| 288 std::replace(dependent_files.begin(), dependent_files.end(), L'\n', L'\0'); | 288 std::replace(dependent_files.begin(), dependent_files.end(), L'\n', L'\0'); |
| 289 driver_info.pDependentFiles = &dependent_files[0]; | 289 driver_info.pDependentFiles = &dependent_files[0]; |
| 290 | 290 |
| 291 // Set up user visible strings. | 291 // Set up user visible strings. |
| 292 base::string16 manufacturer = LoadLocalString(IDS_GOOGLE); | 292 base::string16 manufacturer = LoadLocalString(IDS_GOOGLE); |
| 293 driver_info.pszMfgName = const_cast<LPWSTR>(manufacturer.c_str()); | 293 driver_info.pszMfgName = const_cast<LPWSTR>(manufacturer.c_str()); |
| 294 driver_info.pszProvider = const_cast<LPWSTR>(manufacturer.c_str()); | 294 driver_info.pszProvider = const_cast<LPWSTR>(manufacturer.c_str()); |
| 295 driver_info.pszOEMUrl = const_cast<LPWSTR>(kGcpUrl); | 295 driver_info.pszOEMUrl = const_cast<LPWSTR>(kGcpUrl); |
| 296 driver_info.dwlDriverVersion = GetVersionNumber(); | 296 driver_info.dwlDriverVersion = GetVersionNumber(); |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 | 550 |
| 551 VLOG(0) << GetErrorMessage(retval) | 551 VLOG(0) << GetErrorMessage(retval) |
| 552 << " HRESULT=0x" << std::setbase(16) << retval; | 552 << " HRESULT=0x" << std::setbase(16) << retval; |
| 553 | 553 |
| 554 // Installer is silent by default as required by Google Update. | 554 // Installer is silent by default as required by Google Update. |
| 555 if (base::CommandLine::ForCurrentProcess()->HasSwitch("verbose")) { | 555 if (base::CommandLine::ForCurrentProcess()->HasSwitch("verbose")) { |
| 556 DisplayWindowsMessage(NULL, retval, LoadLocalString(IDS_DRIVER_NAME)); | 556 DisplayWindowsMessage(NULL, retval, LoadLocalString(IDS_DRIVER_NAME)); |
| 557 } | 557 } |
| 558 return retval; | 558 return retval; |
| 559 } | 559 } |
| OLD | NEW |