| 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 <shellapi.h> | 12 #include <shellapi.h> |
| 13 | 13 |
| 14 #include <utility> | 14 #include <utility> |
| 15 | 15 |
| 16 #include "base/files/file_path.h" | 16 #include "base/files/file_path.h" |
| 17 #include "base/path_service.h" | 17 #include "base/path_service.h" |
| 18 #include "base/strings/string_util.h" | 18 #include "base/strings/string_util.h" |
| 19 #include "base/strings/stringprintf.h" | 19 #include "base/strings/stringprintf.h" |
| 20 #include "base/strings/utf_string_conversions.h" | 20 #include "base/strings/utf_string_conversions.h" |
| 21 #include "base/win/registry.h" | 21 #include "base/win/registry.h" |
| 22 #include "base/win/windows_version.h" | 22 #include "base/win/windows_version.h" |
| 23 #include "chrome/common/chrome_icon_resources_win.h" | 23 #include "chrome/common/chrome_icon_resources_win.h" |
| 24 #include "chrome/common/chrome_paths_internal.h" | 24 #include "chrome/common/chrome_paths_internal.h" |
| 25 #include "chrome/install_static/install_util.h" | |
| 26 #include "chrome/installer/util/app_registration_data.h" | 25 #include "chrome/installer/util/app_registration_data.h" |
| 27 #include "chrome/installer/util/channel_info.h" | 26 #include "chrome/installer/util/channel_info.h" |
| 28 #include "chrome/installer/util/google_update_constants.h" | 27 #include "chrome/installer/util/google_update_constants.h" |
| 29 #include "chrome/installer/util/google_update_settings.h" | 28 #include "chrome/installer/util/google_update_settings.h" |
| 30 #include "chrome/installer/util/helper.h" | 29 #include "chrome/installer/util/helper.h" |
| 31 #include "chrome/installer/util/install_util.h" | 30 #include "chrome/installer/util/install_util.h" |
| 32 #include "chrome/installer/util/installer_util_strings.h" | 31 #include "chrome/installer/util/installer_util_strings.h" |
| 33 #include "chrome/installer/util/l10n_string_util.h" | 32 #include "chrome/installer/util/l10n_string_util.h" |
| 34 #include "chrome/installer/util/uninstall_metrics.h" | 33 #include "chrome/installer/util/uninstall_metrics.h" |
| 35 #include "chrome/installer/util/updating_app_registration_data.h" | 34 #include "chrome/installer/util/updating_app_registration_data.h" |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 | 229 |
| 231 base::string16 ap_value; | 230 base::string16 ap_value; |
| 232 // If we fail to read the ap key, send up "&ap=" anyway to indicate | 231 // If we fail to read the ap key, send up "&ap=" anyway to indicate |
| 233 // that this was probably a stable channel release. | 232 // that this was probably a stable channel release. |
| 234 client_state_key.ReadValue(google_update::kRegApField, &ap_value); | 233 client_state_key.ReadValue(google_update::kRegApField, &ap_value); |
| 235 result.append(google_update::kRegApField); | 234 result.append(google_update::kRegApField); |
| 236 result.append(L"="); | 235 result.append(L"="); |
| 237 result.append(ap_value); | 236 result.append(ap_value); |
| 238 | 237 |
| 239 // Crash client id. | 238 // Crash client id. |
| 240 base::string16 crash_dump_location; | 239 // While it would be convenient to use the path service to get |
| 241 if (install_static::GetDefaultCrashDumpLocation(&crash_dump_location)) { | 240 // chrome::DIR_CRASH_DUMPS, that points to the dump location for the installer |
| 242 base::FilePath crash_dir = base::FilePath(crash_dump_location); | 241 // rather than for the browser. For per-user installs they are the same, yet |
| 242 // for system-level installs the installer uses the system temp directory (see |
| 243 // setup/installer_crash_reporting.cc's ConfigureCrashReporting). |
| 244 // TODO(grt): use install_static::GetDefaultCrashDumpLocation (with an option |
| 245 // to suppress creating the directory) once setup.exe uses |
| 246 // install_static::InstallDetails. |
| 247 base::FilePath crash_dir; |
| 248 if (chrome::GetDefaultUserDataDirectory(&crash_dir)) { |
| 249 crash_dir = crash_dir.Append(FILE_PATH_LITERAL("Crashpad")); |
| 243 crashpad::UUID client_id; | 250 crashpad::UUID client_id; |
| 244 std::unique_ptr<crashpad::CrashReportDatabase> database( | 251 std::unique_ptr<crashpad::CrashReportDatabase> database( |
| 245 crashpad::CrashReportDatabase::InitializeWithoutCreating(crash_dir)); | 252 crashpad::CrashReportDatabase::InitializeWithoutCreating(crash_dir)); |
| 246 if (database && database->GetSettings()->GetClientID(&client_id)) | 253 if (database && database->GetSettings()->GetClientID(&client_id)) |
| 247 result.append(L"&crash_client_id=").append(client_id.ToString16()); | 254 result.append(L"&crash_client_id=").append(client_id.ToString16()); |
| 248 } | 255 } |
| 249 | 256 |
| 250 return result; | 257 return result; |
| 251 } | 258 } |
| 252 | 259 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 279 GetAppGuid()); | 286 GetAppGuid()); |
| 280 } | 287 } |
| 281 | 288 |
| 282 bool GoogleChromeDistribution::ShouldSetExperimentLabels() { | 289 bool GoogleChromeDistribution::ShouldSetExperimentLabels() { |
| 283 return true; | 290 return true; |
| 284 } | 291 } |
| 285 | 292 |
| 286 bool GoogleChromeDistribution::HasUserExperiments() { | 293 bool GoogleChromeDistribution::HasUserExperiments() { |
| 287 return true; | 294 return true; |
| 288 } | 295 } |
| OLD | NEW |