diff options
Diffstat (limited to 'chrome/installer/util')
-rw-r--r-- | chrome/installer/util/browser_distribution.cc | 4 | ||||
-rw-r--r-- | chrome/installer/util/browser_distribution.h | 2 | ||||
-rw-r--r-- | chrome/installer/util/google_chrome_sxs_distribution.cc | 5 | ||||
-rw-r--r-- | chrome/installer/util/google_chrome_sxs_distribution.h | 2 | ||||
-rw-r--r-- | chrome/installer/util/shell_util.cc | 9 |
5 files changed, 9 insertions, 13 deletions
diff --git a/chrome/installer/util/browser_distribution.cc b/chrome/installer/util/browser_distribution.cc index 9f53be3..da35d7a 100644 --- a/chrome/installer/util/browser_distribution.cc +++ b/chrome/installer/util/browser_distribution.cc @@ -142,8 +142,8 @@ bool BrowserDistribution::CanSetAsDefault() { return true; } -bool BrowserDistribution::ShouldUseAlternateIcon() { - return false; +int BrowserDistribution::GetIconIndex() { + return 0; } bool BrowserDistribution::GetChromeChannel(std::wstring* channel) { diff --git a/chrome/installer/util/browser_distribution.h b/chrome/installer/util/browser_distribution.h index dd271d8..c9be526 100644 --- a/chrome/installer/util/browser_distribution.h +++ b/chrome/installer/util/browser_distribution.h @@ -62,7 +62,7 @@ class BrowserDistribution { virtual bool CanSetAsDefault(); - virtual bool ShouldUseAlternateIcon(); + virtual int GetIconIndex(); virtual bool GetChromeChannel(std::wstring* channel); diff --git a/chrome/installer/util/google_chrome_sxs_distribution.cc b/chrome/installer/util/google_chrome_sxs_distribution.cc index 6807e93..6493ff9 100644 --- a/chrome/installer/util/google_chrome_sxs_distribution.cc +++ b/chrome/installer/util/google_chrome_sxs_distribution.cc @@ -12,6 +12,7 @@ namespace { const wchar_t kChromeSxSGuid[] = L"{4ea16ac7-fd5a-47c3-875b-dbf4a2008c20}"; const wchar_t kChannelName[] = L"SxS"; +const int kSxSIconIndex = 4; } // namespace @@ -43,8 +44,8 @@ bool GoogleChromeSxSDistribution::CanSetAsDefault() { return false; } -bool GoogleChromeSxSDistribution::ShouldUseAlternateIcon() { - return true; +int GoogleChromeSxSDistribution::GetIconIndex() { + return kSxSIconIndex; } bool GoogleChromeSxSDistribution::GetChromeChannel(std::wstring* channel) { diff --git a/chrome/installer/util/google_chrome_sxs_distribution.h b/chrome/installer/util/google_chrome_sxs_distribution.h index 3062f43..0e8ce49 100644 --- a/chrome/installer/util/google_chrome_sxs_distribution.h +++ b/chrome/installer/util/google_chrome_sxs_distribution.h @@ -24,7 +24,7 @@ class GoogleChromeSxSDistribution : public GoogleChromeDistribution { virtual std::wstring GetUninstallRegPath(); virtual std::wstring GetEnvVersionKey(); virtual bool CanSetAsDefault(); - virtual bool ShouldUseAlternateIcon(); + virtual int GetIconIndex(); virtual bool GetChromeChannel(std::wstring* channel); // returns the channel name for GoogleChromeSxSDistribution static std::wstring ChannelName(); diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc index e3c86f0..561f2e9 100644 --- a/chrome/installer/util/shell_util.cc +++ b/chrome/installer/util/shell_util.cc @@ -31,9 +31,6 @@ namespace { -const int kDefaultIconIndex = 0; -const int kSxSIconIndex = 4; - // This class represents a single registry entry. The objective is to // encapsulate all the registry entries required for registering Chrome at one // place. This class can not be instantiated outside the class and the objects @@ -505,8 +502,7 @@ std::wstring ShellUtil::GetChromeIcon(const std::wstring& chrome_exe) { BrowserDistribution* dist = BrowserDistribution::GetDistribution(); std::wstring chrome_icon(chrome_exe); chrome_icon.append(L","); - chrome_icon.append(IntToWString(dist->ShouldUseAlternateIcon() ? - kSxSIconIndex : kDefaultIconIndex)); + chrome_icon.append(IntToWString(dist->GetIconIndex())); return chrome_icon; } @@ -777,8 +773,7 @@ bool ShellUtil::UpdateChromeShortcut(const std::wstring& chrome_exe, prefs_path = prefs_path.AppendASCII(installer_util::kDefaultMasterPrefs); scoped_ptr<DictionaryValue> prefs( installer_util::ParseDistributionPreferences(prefs_path)); - int icon_index = dist->ShouldUseAlternateIcon() ? - kSxSIconIndex : kDefaultIconIndex; + int icon_index = dist->GetIconIndex(); installer_util::GetDistroIntegerPreference(prefs.get(), installer_util::master_preferences::kChromeShortcutIconIndex, &icon_index); |