| 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 <shlobj.h> | 12 #include <shlobj.h> |
| 13 | 13 |
| 14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
| 15 #include "base/path_service.h" | 15 #include "base/path_service.h" |
| 16 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
| 17 #include "base/strings/stringprintf.h" | 17 #include "base/strings/stringprintf.h" |
| 18 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
| 19 #include "base/win/registry.h" | 19 #include "base/win/registry.h" |
| 20 #include "base/win/scoped_comptr.h" | 20 #include "base/win/scoped_comptr.h" |
| 21 #include "base/win/windows_version.h" | 21 #include "base/win/windows_version.h" |
| 22 #include "chrome/common/chrome_icon_resources_win.h" | 22 #include "chrome/common/chrome_icon_resources_win.h" |
| 23 #include "chrome/common/chrome_paths_internal.h" |
| 23 #include "chrome/installer/util/app_registration_data.h" | 24 #include "chrome/installer/util/app_registration_data.h" |
| 24 #include "chrome/installer/util/channel_info.h" | 25 #include "chrome/installer/util/channel_info.h" |
| 25 #include "chrome/installer/util/google_update_constants.h" | 26 #include "chrome/installer/util/google_update_constants.h" |
| 26 #include "chrome/installer/util/google_update_settings.h" | 27 #include "chrome/installer/util/google_update_settings.h" |
| 27 #include "chrome/installer/util/helper.h" | 28 #include "chrome/installer/util/helper.h" |
| 28 #include "chrome/installer/util/install_util.h" | 29 #include "chrome/installer/util/install_util.h" |
| 29 #include "chrome/installer/util/installer_util_strings.h" | 30 #include "chrome/installer/util/installer_util_strings.h" |
| 30 #include "chrome/installer/util/l10n_string_util.h" | 31 #include "chrome/installer/util/l10n_string_util.h" |
| 31 #include "chrome/installer/util/uninstall_metrics.h" | 32 #include "chrome/installer/util/uninstall_metrics.h" |
| 32 #include "chrome/installer/util/updating_app_registration_data.h" | 33 #include "chrome/installer/util/updating_app_registration_data.h" |
| 33 #include "chrome/installer/util/util_constants.h" | 34 #include "chrome/installer/util/util_constants.h" |
| 34 #include "chrome/installer/util/wmi.h" | 35 #include "chrome/installer/util/wmi.h" |
| 36 #include "third_party/crashpad/crashpad/client/crash_report_database.h" |
| 37 #include "third_party/crashpad/crashpad/client/settings.h" |
| 35 | 38 |
| 36 namespace { | 39 namespace { |
| 37 | 40 |
| 38 const wchar_t kChromeGuid[] = L"{8A69D345-D564-463c-AFF1-A69D9E530F96}"; | 41 const wchar_t kChromeGuid[] = L"{8A69D345-D564-463c-AFF1-A69D9E530F96}"; |
| 39 const wchar_t kBrowserAppId[] = L"Chrome"; | 42 const wchar_t kBrowserAppId[] = L"Chrome"; |
| 40 const wchar_t kBrowserProgIdPrefix[] = L"ChromeHTML"; | 43 const wchar_t kBrowserProgIdPrefix[] = L"ChromeHTML"; |
| 41 const wchar_t kBrowserProgIdDesc[] = L"Chrome HTML Document"; | 44 const wchar_t kBrowserProgIdDesc[] = L"Chrome HTML Document"; |
| 42 const wchar_t kCommandExecuteImplUuid[] = | 45 const wchar_t kCommandExecuteImplUuid[] = |
| 43 L"{5C65F4B0-3651-4514-B207-D10CB699B14B}"; | 46 L"{5C65F4B0-3651-4514-B207-D10CB699B14B}"; |
| 44 const wchar_t kEdgeAppId[] = | 47 const wchar_t kEdgeAppId[] = |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 } | 240 } |
| 238 | 241 |
| 239 base::string16 ap_value; | 242 base::string16 ap_value; |
| 240 // If we fail to read the ap key, send up "&ap=" anyway to indicate | 243 // If we fail to read the ap key, send up "&ap=" anyway to indicate |
| 241 // that this was probably a stable channel release. | 244 // that this was probably a stable channel release. |
| 242 client_state_key.ReadValue(google_update::kRegApField, &ap_value); | 245 client_state_key.ReadValue(google_update::kRegApField, &ap_value); |
| 243 result.append(google_update::kRegApField); | 246 result.append(google_update::kRegApField); |
| 244 result.append(L"="); | 247 result.append(L"="); |
| 245 result.append(ap_value); | 248 result.append(ap_value); |
| 246 | 249 |
| 250 // Crash client id. |
| 251 base::FilePath crash_dir; |
| 252 if (chrome::GetDefaultCrashDumpLocation(&crash_dir)) { |
| 253 crashpad::UUID client_id; |
| 254 scoped_ptr<crashpad::CrashReportDatabase> database( |
| 255 crashpad::CrashReportDatabase::InitializeWithoutCreating(crash_dir)); |
| 256 if (database && database->GetSettings()->GetClientID(&client_id)) |
| 257 result.append(L"&crash_client_id=").append(client_id.ToString16()); |
| 258 } |
| 259 |
| 247 return result; | 260 return result; |
| 248 } | 261 } |
| 249 | 262 |
| 250 base::string16 GoogleChromeDistribution::GetUninstallRegPath() { | 263 base::string16 GoogleChromeDistribution::GetUninstallRegPath() { |
| 251 return L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" | 264 return L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" |
| 252 L"Google Chrome"; | 265 L"Google Chrome"; |
| 253 } | 266 } |
| 254 | 267 |
| 255 base::string16 GoogleChromeDistribution::GetIconFilename() { | 268 base::string16 GoogleChromeDistribution::GetIconFilename() { |
| 256 return installer::kChromeExe; | 269 return installer::kChromeExe; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 276 GetAppGuid()); | 289 GetAppGuid()); |
| 277 } | 290 } |
| 278 | 291 |
| 279 bool GoogleChromeDistribution::ShouldSetExperimentLabels() { | 292 bool GoogleChromeDistribution::ShouldSetExperimentLabels() { |
| 280 return true; | 293 return true; |
| 281 } | 294 } |
| 282 | 295 |
| 283 bool GoogleChromeDistribution::HasUserExperiments() { | 296 bool GoogleChromeDistribution::HasUserExperiments() { |
| 284 return true; | 297 return true; |
| 285 } | 298 } |
| OLD | NEW |