| 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 | 8 |
| 9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 const wchar_t kGcpUrl[] = L"http://www.google.com/cloudprint"; | 41 const wchar_t kGcpUrl[] = L"http://www.google.com/cloudprint"; |
| 42 | 42 |
| 43 void SetOmahaKeys() { | 43 void SetOmahaKeys() { |
| 44 base::win::RegKey key; | 44 base::win::RegKey key; |
| 45 if (key.Create(HKEY_LOCAL_MACHINE, cloud_print::kKeyLocation, | 45 if (key.Create(HKEY_LOCAL_MACHINE, cloud_print::kKeyLocation, |
| 46 KEY_SET_VALUE) != ERROR_SUCCESS) { | 46 KEY_SET_VALUE) != ERROR_SUCCESS) { |
| 47 LOG(ERROR) << "Unable to open key"; | 47 LOG(ERROR) << "Unable to open key"; |
| 48 } | 48 } |
| 49 | 49 |
| 50 // Get the version from the resource file. | 50 // Get the version from the resource file. |
| 51 std::wstring version_string; | 51 string16 version_string; |
| 52 scoped_ptr<FileVersionInfo> version_info( | 52 scoped_ptr<FileVersionInfo> version_info( |
| 53 FileVersionInfo::CreateFileVersionInfoForCurrentModule()); | 53 FileVersionInfo::CreateFileVersionInfoForCurrentModule()); |
| 54 | 54 |
| 55 if (version_info.get()) { | 55 if (version_info.get()) { |
| 56 FileVersionInfoWin* version_info_win = | 56 FileVersionInfoWin* version_info_win = |
| 57 static_cast<FileVersionInfoWin*>(version_info.get()); | 57 static_cast<FileVersionInfoWin*>(version_info.get()); |
| 58 version_string = version_info_win->product_version(); | 58 version_string = version_info_win->product_version(); |
| 59 } else { | 59 } else { |
| 60 LOG(ERROR) << "Unable to get version string"; | 60 LOG(ERROR) << "Unable to get version string"; |
| 61 // Use a random version string so that Omaha has something to go by. | 61 // Use a random version string so that Omaha has something to go by. |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 } | 580 } |
| 581 } | 581 } |
| 582 } | 582 } |
| 583 // Installer is silent by default as required by Omaha. | 583 // Installer is silent by default as required by Omaha. |
| 584 if (CommandLine::ForCurrentProcess()->HasSwitch("verbose")) { | 584 if (CommandLine::ForCurrentProcess()->HasSwitch("verbose")) { |
| 585 cloud_print::DisplayWindowsMessage(NULL, retval, | 585 cloud_print::DisplayWindowsMessage(NULL, retval, |
| 586 cloud_print::LoadLocalString(IDS_DRIVER_NAME)); | 586 cloud_print::LoadLocalString(IDS_DRIVER_NAME)); |
| 587 } | 587 } |
| 588 return retval; | 588 return retval; |
| 589 } | 589 } |
| OLD | NEW |