| 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" |
| 25 #include "chrome/installer/util/app_registration_data.h" | 26 #include "chrome/installer/util/app_registration_data.h" |
| 26 #include "chrome/installer/util/channel_info.h" | 27 #include "chrome/installer/util/channel_info.h" |
| 27 #include "chrome/installer/util/google_update_constants.h" | 28 #include "chrome/installer/util/google_update_constants.h" |
| 28 #include "chrome/installer/util/google_update_settings.h" | 29 #include "chrome/installer/util/google_update_settings.h" |
| 29 #include "chrome/installer/util/helper.h" | 30 #include "chrome/installer/util/helper.h" |
| 30 #include "chrome/installer/util/install_util.h" | 31 #include "chrome/installer/util/install_util.h" |
| 31 #include "chrome/installer/util/installer_util_strings.h" | 32 #include "chrome/installer/util/installer_util_strings.h" |
| 32 #include "chrome/installer/util/l10n_string_util.h" | 33 #include "chrome/installer/util/l10n_string_util.h" |
| 33 #include "chrome/installer/util/uninstall_metrics.h" | 34 #include "chrome/installer/util/uninstall_metrics.h" |
| 34 #include "chrome/installer/util/updating_app_registration_data.h" | 35 #include "chrome/installer/util/updating_app_registration_data.h" |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 result.append(google_update::kRegApField); | 235 result.append(google_update::kRegApField); |
| 235 result.append(L"="); | 236 result.append(L"="); |
| 236 result.append(ap_value); | 237 result.append(ap_value); |
| 237 | 238 |
| 238 // Crash client id. | 239 // Crash client id. |
| 239 // While it would be convenient to use the path service to get | 240 // While it would be convenient to use the path service to get |
| 240 // chrome::DIR_CRASH_DUMPS, that points to the dump location for the installer | 241 // chrome::DIR_CRASH_DUMPS, that points to the dump location for the installer |
| 241 // rather than for the browser. For per-user installs they are the same, yet | 242 // 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 // for system-level installs the installer uses the system temp directory (see |
| 243 // setup/installer_crash_reporting.cc's ConfigureCrashReporting). | 244 // setup/installer_crash_reporting.cc's ConfigureCrashReporting). |
| 244 // TODO(grt): use install_static::GetDefaultCrashDumpLocation (with an option | 245 base::string16 crash_dump_location; |
| 245 // to suppress creating the directory) once setup.exe uses | 246 if (install_static::GetCrashDumpLocation(&crash_dump_location)) { |
| 246 // install_static::InstallDetails. | 247 base::FilePath crash_dir = base::FilePath(crash_dump_location); |
| 247 base::FilePath crash_dir; | |
| 248 if (chrome::GetDefaultUserDataDirectory(&crash_dir)) { | |
| 249 crash_dir = crash_dir.Append(FILE_PATH_LITERAL("Crashpad")); | |
| 250 crashpad::UUID client_id; | 248 crashpad::UUID client_id; |
| 251 std::unique_ptr<crashpad::CrashReportDatabase> database( | 249 std::unique_ptr<crashpad::CrashReportDatabase> database( |
| 252 crashpad::CrashReportDatabase::InitializeWithoutCreating(crash_dir)); | 250 crashpad::CrashReportDatabase::InitializeWithoutCreating(crash_dir)); |
| 253 if (database && database->GetSettings()->GetClientID(&client_id)) | 251 if (database && database->GetSettings()->GetClientID(&client_id)) |
| 254 result.append(L"&crash_client_id=").append(client_id.ToString16()); | 252 result.append(L"&crash_client_id=").append(client_id.ToString16()); |
| 255 } | 253 } |
| 256 | 254 |
| 257 return result; | 255 return result; |
| 258 } | 256 } |
| 259 | 257 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 286 GetAppGuid()); | 284 GetAppGuid()); |
| 287 } | 285 } |
| 288 | 286 |
| 289 bool GoogleChromeDistribution::ShouldSetExperimentLabels() { | 287 bool GoogleChromeDistribution::ShouldSetExperimentLabels() { |
| 290 return true; | 288 return true; |
| 291 } | 289 } |
| 292 | 290 |
| 293 bool GoogleChromeDistribution::HasUserExperiments() { | 291 bool GoogleChromeDistribution::HasUserExperiments() { |
| 294 return true; | 292 return true; |
| 295 } | 293 } |
| OLD | NEW |