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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 base::string16 ap_value; | 243 base::string16 ap_value; |
245 // If we fail to read the ap key, send up "&ap=" anyway to indicate | 244 // If we fail to read the ap key, send up "&ap=" anyway to indicate |
246 // that this was probably a stable channel release. | 245 // that this was probably a stable channel release. |
247 client_state_key.ReadValue(google_update::kRegApField, &ap_value); | 246 client_state_key.ReadValue(google_update::kRegApField, &ap_value); |
248 result.append(google_update::kRegApField); | 247 result.append(google_update::kRegApField); |
249 result.append(L"="); | 248 result.append(L"="); |
250 result.append(ap_value); | 249 result.append(ap_value); |
251 | 250 |
252 // Crash client id. | 251 // Crash client id. |
253 base::FilePath crash_dir; | 252 base::FilePath crash_dir; |
254 base::string16 crash_dump_location; | 253 if (chrome::GetDefaultCrashDumpLocation(&crash_dir)) { |
255 if (install_static::GetDefaultCrashDumpLocation(&crash_dump_location)) { | |
256 crash_dir = base::FilePath(crash_dump_location); | |
257 crashpad::UUID client_id; | 254 crashpad::UUID client_id; |
258 std::unique_ptr<crashpad::CrashReportDatabase> database( | 255 std::unique_ptr<crashpad::CrashReportDatabase> database( |
259 crashpad::CrashReportDatabase::InitializeWithoutCreating(crash_dir)); | 256 crashpad::CrashReportDatabase::InitializeWithoutCreating(crash_dir)); |
260 if (database && database->GetSettings()->GetClientID(&client_id)) | 257 if (database && database->GetSettings()->GetClientID(&client_id)) |
261 result.append(L"&crash_client_id=").append(client_id.ToString16()); | 258 result.append(L"&crash_client_id=").append(client_id.ToString16()); |
262 } | 259 } |
263 | 260 |
264 return result; | 261 return result; |
265 } | 262 } |
266 | 263 |
(...skipping 26 matching lines...) Expand all Loading... |
293 GetAppGuid()); | 290 GetAppGuid()); |
294 } | 291 } |
295 | 292 |
296 bool GoogleChromeDistribution::ShouldSetExperimentLabels() { | 293 bool GoogleChromeDistribution::ShouldSetExperimentLabels() { |
297 return true; | 294 return true; |
298 } | 295 } |
299 | 296 |
300 bool GoogleChromeDistribution::HasUserExperiments() { | 297 bool GoogleChromeDistribution::HasUserExperiments() { |
301 return true; | 298 return true; |
302 } | 299 } |
OLD | NEW |