| 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 // This file defines specific implementation of BrowserDistribution class for | 5 // This file defines specific implementation of BrowserDistribution class for |
| 6 // Google Chrome. | 6 // Google Chrome. |
| 7 | 7 |
| 8 #include "chrome/installer/util/google_chrome_distribution.h" | 8 #include "chrome/installer/util/google_chrome_distribution.h" |
| 9 | 9 |
| 10 #include <windows.h> | 10 #include <windows.h> |
| 11 #include <msi.h> | 11 #include <msi.h> |
| 12 #include <commctrl.h> // For HOTKEYF constants |
| 12 | 13 |
| 13 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
| 14 #include "base/path_service.h" | 15 #include "base/path_service.h" |
| 15 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
| 16 #include "base/strings/stringprintf.h" | 17 #include "base/strings/stringprintf.h" |
| 17 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
| 18 #include "base/win/registry.h" | 19 #include "base/win/registry.h" |
| 19 #include "base/win/windows_version.h" | 20 #include "base/win/windows_version.h" |
| 20 #include "chrome/common/net/test_server_locations.h" | 21 #include "chrome/common/net/test_server_locations.h" |
| 21 #include "chrome/installer/util/channel_info.h" | 22 #include "chrome/installer/util/channel_info.h" |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 string16* handler_class_uuid) { | 274 string16* handler_class_uuid) { |
| 274 if (handler_class_uuid) | 275 if (handler_class_uuid) |
| 275 *handler_class_uuid = kCommandExecuteImplUuid; | 276 *handler_class_uuid = kCommandExecuteImplUuid; |
| 276 return true; | 277 return true; |
| 277 } | 278 } |
| 278 | 279 |
| 279 bool GoogleChromeDistribution::AppHostIsSupported() { | 280 bool GoogleChromeDistribution::AppHostIsSupported() { |
| 280 return true; | 281 return true; |
| 281 } | 282 } |
| 282 | 283 |
| 284 uint32 GoogleChromeDistribution::GetSafeModeHotkey() { |
| 285 // Safe mode shortcut is Ctrl+Shift+F10. |
| 286 return MAKEWORD(VK_F10, HOTKEYF_CONTROL | HOTKEYF_SHIFT); |
| 287 } |
| 288 |
| 283 // This method checks if we need to change "ap" key in Google Update to try | 289 // This method checks if we need to change "ap" key in Google Update to try |
| 284 // full installer as fall back method in case incremental installer fails. | 290 // full installer as fall back method in case incremental installer fails. |
| 285 // - If incremental installer fails we append a magic string ("-full"), if | 291 // - If incremental installer fails we append a magic string ("-full"), if |
| 286 // it is not present already, so that Google Update server next time will send | 292 // it is not present already, so that Google Update server next time will send |
| 287 // full installer to update Chrome on the local machine | 293 // full installer to update Chrome on the local machine |
| 288 // - If we are currently running full installer, we remove this magic | 294 // - If we are currently running full installer, we remove this magic |
| 289 // string (if it is present) regardless of whether installer failed or not. | 295 // string (if it is present) regardless of whether installer failed or not. |
| 290 // There is no fall-back for full installer :) | 296 // There is no fall-back for full installer :) |
| 291 void GoogleChromeDistribution::UpdateInstallStatus(bool system_install, | 297 void GoogleChromeDistribution::UpdateInstallStatus(bool system_install, |
| 292 installer::ArchiveType archive_type, | 298 installer::ArchiveType archive_type, |
| 293 installer::InstallStatus install_status) { | 299 installer::InstallStatus install_status) { |
| 294 GoogleUpdateSettings::UpdateInstallStatus(system_install, | 300 GoogleUpdateSettings::UpdateInstallStatus(system_install, |
| 295 archive_type, InstallUtil::GetInstallReturnCode(install_status), | 301 archive_type, InstallUtil::GetInstallReturnCode(install_status), |
| 296 product_guid()); | 302 product_guid()); |
| 297 } | 303 } |
| 298 | 304 |
| 299 bool GoogleChromeDistribution::ShouldSetExperimentLabels() { | 305 bool GoogleChromeDistribution::ShouldSetExperimentLabels() { |
| 300 return true; | 306 return true; |
| 301 } | 307 } |
| 302 | 308 |
| 303 bool GoogleChromeDistribution::HasUserExperiments() { | 309 bool GoogleChromeDistribution::HasUserExperiments() { |
| 304 return true; | 310 return true; |
| 305 } | 311 } |
| OLD | NEW |