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

Unified Diff: chrome/installer/util/google_update_settings.cc

Issue 2476573004: Use InstallDetails in installer_util. (Closed)
Patch Set: sync to position 451835 Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/installer/util/google_update_settings.cc
diff --git a/chrome/installer/util/google_update_settings.cc b/chrome/installer/util/google_update_settings.cc
index 19a6b78e3ec884f09030b550b39e73d4cae34c6f..190d1de9640046e79dd3b63697ccd4e38dae4457 100644
--- a/chrome/installer/util/google_update_settings.cc
+++ b/chrome/installer/util/google_update_settings.cc
@@ -22,6 +22,7 @@
#include "base/win/registry.h"
#include "base/win/win_util.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/install_static/install_util.h"
#include "chrome/installer/util/app_registration_data.h"
#include "chrome/installer/util/browser_distribution.h"
#include "chrome/installer/util/channel_info.h"
@@ -165,24 +166,6 @@ bool InitChannelInfo(bool system_install,
return channel_info->Initialize(key);
}
-bool GetChromeChannelInternal(bool system_install,
- base::string16* channel) {
- // Shortcut in case this distribution knows what channel it is (canary).
- if (BrowserDistribution::GetDistribution()->GetChromeChannel(channel))
- return true;
-
- installer::ChannelInfo channel_info;
- if (!InitChannelInfo(system_install, &channel_info)) {
- channel->assign(installer::kChromeChannelUnknown);
- return false;
- }
-
- if (!channel_info.GetChannelName(channel))
- channel->assign(installer::kChromeChannelUnknown);
-
- return true;
-}
-
#if defined(GOOGLE_CHROME_BUILD)
// Populates |update_policy| with the UpdatePolicy enum value corresponding to a
// DWORD read from the registry and returns true if |value| is within range.
@@ -207,15 +190,9 @@ bool GetUpdatePolicyFromDword(
} // namespace
bool GoogleUpdateSettings::IsSystemInstall() {
- bool system_install = false;
- base::FilePath module_dir;
- if (!PathService::Get(base::DIR_MODULE, &module_dir)) {
- LOG(WARNING)
- << "Failed to get directory of module; assuming per-user install.";
- } else {
- system_install = !InstallUtil::IsPerUserInstall(module_dir);
- }
- return system_install;
+ // TODO(grt): Remove this unused argument.
+ base::FilePath unused;
+ return !InstallUtil::IsPerUserInstall(unused);
}
bool GoogleUpdateSettings::GetCollectStatsConsent() {
@@ -430,9 +407,7 @@ bool GoogleUpdateSettings::UpdateDidRunState(bool did_run) {
}
base::string16 GoogleUpdateSettings::GetChromeChannel(bool system_install) {
- base::string16 channel;
- GetChromeChannelInternal(system_install, &channel);
- return channel;
+ return install_static::GetChromeChannelName();
}
void GoogleUpdateSettings::UpdateInstallStatus(bool system_install,
« no previous file with comments | « chrome/installer/util/channel_info_unittest.cc ('k') | chrome/installer/util/google_update_settings_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698