Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(386)

Side by Side Diff: chrome/installer/util/google_chrome_distribution.cc

Issue 2622883002: Remove BrowserDistribution::Type. (Closed)
Patch Set: fdoray comments Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/memory/ptr_util.h"
17 #include "base/path_service.h" 18 #include "base/path_service.h"
18 #include "base/strings/string_util.h" 19 #include "base/strings/string_util.h"
19 #include "base/strings/stringprintf.h" 20 #include "base/strings/stringprintf.h"
20 #include "base/strings/utf_string_conversions.h" 21 #include "base/strings/utf_string_conversions.h"
21 #include "base/win/registry.h" 22 #include "base/win/registry.h"
22 #include "base/win/windows_version.h" 23 #include "base/win/windows_version.h"
23 #include "chrome/common/chrome_icon_resources_win.h" 24 #include "chrome/common/chrome_icon_resources_win.h"
24 #include "chrome/common/chrome_paths_internal.h" 25 #include "chrome/common/chrome_paths_internal.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/install_util.h" 30 #include "chrome/installer/util/install_util.h"
31 #include "chrome/installer/util/installer_util_strings.h" 31 #include "chrome/installer/util/installer_util_strings.h"
32 #include "chrome/installer/util/l10n_string_util.h" 32 #include "chrome/installer/util/l10n_string_util.h"
33 #include "chrome/installer/util/uninstall_metrics.h" 33 #include "chrome/installer/util/uninstall_metrics.h"
34 #include "chrome/installer/util/updating_app_registration_data.h" 34 #include "chrome/installer/util/updating_app_registration_data.h"
35 #include "chrome/installer/util/util_constants.h" 35 #include "chrome/installer/util/util_constants.h"
36 #include "chrome/installer/util/wmi.h" 36 #include "chrome/installer/util/wmi.h"
37 #include "third_party/crashpad/crashpad/client/crash_report_database.h" 37 #include "third_party/crashpad/crashpad/client/crash_report_database.h"
38 #include "third_party/crashpad/crashpad/client/settings.h" 38 #include "third_party/crashpad/crashpad/client/settings.h"
39 39
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 // The reason we use WMI to launch the process is because the uninstall 89 // The reason we use WMI to launch the process is because the uninstall
90 // process runs inside a Job object controlled by the shell. As long as there 90 // process runs inside a Job object controlled by the shell. As long as there
91 // are processes running, the shell will not close the uninstall applet. WMI 91 // are processes running, the shell will not close the uninstall applet. WMI
92 // allows us to escape from the Job object so the applet will close. 92 // allows us to escape from the Job object so the applet will close.
93 installer::WMIProcess::Launch(command, &pid); 93 installer::WMIProcess::Launch(command, &pid);
94 } 94 }
95 95
96 } // namespace 96 } // namespace
97 97
98 GoogleChromeDistribution::GoogleChromeDistribution() 98 GoogleChromeDistribution::GoogleChromeDistribution()
99 : BrowserDistribution(CHROME_BROWSER, 99 : BrowserDistribution(
100 std::unique_ptr<AppRegistrationData>( 100 base::MakeUnique<UpdatingAppRegistrationData>(kChromeGuid)) {}
101 new UpdatingAppRegistrationData(kChromeGuid))) {}
102 101
103 GoogleChromeDistribution::GoogleChromeDistribution( 102 GoogleChromeDistribution::GoogleChromeDistribution(
104 std::unique_ptr<AppRegistrationData> app_reg_data) 103 std::unique_ptr<AppRegistrationData> app_reg_data)
105 : BrowserDistribution(CHROME_BROWSER, std::move(app_reg_data)) {} 104 : BrowserDistribution(std::move(app_reg_data)) {}
106 105
107 void GoogleChromeDistribution::DoPostUninstallOperations( 106 void GoogleChromeDistribution::DoPostUninstallOperations(
108 const base::Version& version, 107 const base::Version& version,
109 const base::FilePath& local_data_path, 108 const base::FilePath& local_data_path,
110 const base::string16& distribution_data) { 109 const base::string16& distribution_data) {
111 // Send the Chrome version and OS version as params to the form. 110 // Send the Chrome version and OS version as params to the form.
112 // It would be nice to send the locale, too, but I don't see an 111 // It would be nice to send the locale, too, but I don't see an
113 // easy way to get that in the existing code. It's something we 112 // easy way to get that in the existing code. It's something we
114 // can add later, if needed. 113 // can add later, if needed.
115 // We depend on installed_version.GetString() not having spaces or other 114 // We depend on installed_version.GetString() not having spaces or other
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 GetAppGuid()); 285 GetAppGuid());
287 } 286 }
288 287
289 bool GoogleChromeDistribution::ShouldSetExperimentLabels() { 288 bool GoogleChromeDistribution::ShouldSetExperimentLabels() {
290 return true; 289 return true;
291 } 290 }
292 291
293 bool GoogleChromeDistribution::HasUserExperiments() { 292 bool GoogleChromeDistribution::HasUserExperiments() {
294 return true; 293 return true;
295 } 294 }
OLDNEW
« no previous file with comments | « chrome/installer/util/google_chrome_distribution.h ('k') | chrome/installer/util/google_update_settings_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698