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

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

Issue 15255004: Refactor of BrowserDistribution. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rework Created 7 years, 5 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 implementation of GoogleChromeSxSDistribution. 5 // This file defines implementation of GoogleChromeSxSDistribution.
6 6
7 #include "chrome/installer/util/google_chrome_sxs_distribution.h" 7 #include "chrome/installer/util/google_chrome_sxs_distribution.h"
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 11
12 #include "installer_util_strings.h" // NOLINT 12 #include "installer_util_strings.h" // NOLINT
13 13
14 namespace { 14 namespace {
15 15
16 const wchar_t kChromeSxSGuid[] = L"{4ea16ac7-fd5a-47c3-875b-dbf4a2008c20}"; 16 const wchar_t kChromeSxSGuid[] = L"{4ea16ac7-fd5a-47c3-875b-dbf4a2008c20}";
17 const wchar_t kChannelName[] = L"canary"; 17 const wchar_t kChannelName[] = L"canary";
18 const wchar_t kBrowserAppId[] = L"ChromeCanary"; 18 const wchar_t kBrowserAppId[] = L"ChromeCanary";
19 const int kSxSIconIndex = 4; 19 const int kSxSIconIndex = 4;
20 20
21 } // namespace 21 } // namespace
22 22
23 GoogleChromeSxSDistribution::GoogleChromeSxSDistribution() 23 GoogleChromeSxSDistribution::GoogleChromeSxSDistribution()
24 : GoogleChromeDistribution() { 24 : GoogleChromeDistribution() {
25 GoogleChromeDistribution::set_product_guid(kChromeSxSGuid); 25 GoogleChromeDistribution::set_product_guid(kChromeSxSGuid);
26 } 26 }
27 27
28 string16 GoogleChromeSxSDistribution::GetBaseAppName() { 28 string16 GoogleChromeSxSDistribution::GetBaseAppName() {
29 return L"Google Chrome Canary"; 29 return installer::GetLocalizedString(IDS_SXS_SHORTCUT_NAME_BASE);
gab 2013/06/27 11:49:43 GetBaseAppName() is sometimes used as a registry v
calamity 2013/07/05 09:00:29 Done.
30 } 30 }
31 31
32 string16 GoogleChromeSxSDistribution::GetAppShortCutName() { 32 string16 GoogleChromeSxSDistribution::GetShortcutName(
33 const string16& shortcut_name = 33 ShortcutEnum shortcut_enum) {
34 installer::GetLocalizedString(IDS_SXS_SHORTCUT_NAME_BASE); 34 switch (shortcut_enum) {
35 return shortcut_name; 35 case SHORTCUT_CHROME:
36 return GetBaseAppName();
37 case SHORTCUT_ALTERNATE_CHROME:
38 return L"The Internet";
39 case SHORTCUT_APP_LAUNCHER:
40 // TODO(calamity): Replace with a localized string.
41 return L"Chrome App Launcher Canary";
42 default:
43 NOTREACHED();
44 return string16();
45 }
36 } 46 }
37 47
38 string16 GoogleChromeSxSDistribution::GetBaseAppId() { 48 string16 GoogleChromeSxSDistribution::GetBaseAppId() {
39 return kBrowserAppId; 49 return kBrowserAppId;
40 } 50 }
41 51
42 string16 GoogleChromeSxSDistribution::GetInstallSubDir() { 52 string16 GoogleChromeSxSDistribution::GetInstallSubDir() {
43 return GoogleChromeDistribution::GetInstallSubDir().append( 53 return GoogleChromeDistribution::GetInstallSubDir().append(
44 installer::kSxSSuffix); 54 installer::kSxSSuffix);
45 } 55 }
46 56
47 string16 GoogleChromeSxSDistribution::GetUninstallRegPath() { 57 string16 GoogleChromeSxSDistribution::GetUninstallRegPath() {
48 return GoogleChromeDistribution::GetUninstallRegPath().append( 58 return GoogleChromeDistribution::GetUninstallRegPath().append(
49 installer::kSxSSuffix); 59 installer::kSxSSuffix);
50 } 60 }
51 61
52 bool GoogleChromeSxSDistribution::CanSetAsDefault() { 62 bool GoogleChromeSxSDistribution::CanSetAsDefault() {
53 return false; 63 return false;
54 } 64 }
55 65
56 int GoogleChromeSxSDistribution::GetIconIndex() { 66 int GoogleChromeSxSDistribution::GetIconIndex(ShortcutEnum shortcut_enum) {
57 return kSxSIconIndex; 67 switch (shortcut_enum) {
68 case SHORTCUT_CHROME:
69 case SHORTCUT_ALTERNATE_CHROME:
70 return kSxSIconIndex;
71 case SHORTCUT_APP_LAUNCHER:
72 return 5;
73 default:
74 NOTREACHED();
75 return 0;
76 }
58 } 77 }
59 78
60 bool GoogleChromeSxSDistribution::GetChromeChannel(string16* channel) { 79 bool GoogleChromeSxSDistribution::GetChromeChannel(string16* channel) {
61 *channel = kChannelName; 80 *channel = kChannelName;
62 return true; 81 return true;
63 } 82 }
64 83
65 bool GoogleChromeSxSDistribution::GetCommandExecuteImplClsid( 84 bool GoogleChromeSxSDistribution::GetCommandExecuteImplClsid(
66 string16* handler_class_uuid) { 85 string16* handler_class_uuid) {
67 return false; 86 return false;
68 } 87 }
69 88
70 bool GoogleChromeSxSDistribution::AppHostIsSupported() { 89 bool GoogleChromeSxSDistribution::AppHostIsSupported() {
71 return false; 90 return false;
72 } 91 }
73 92
74 bool GoogleChromeSxSDistribution::ShouldSetExperimentLabels() { 93 bool GoogleChromeSxSDistribution::ShouldSetExperimentLabels() {
75 return true; 94 return true;
76 } 95 }
77 96
78 bool GoogleChromeSxSDistribution::HasUserExperiments() { 97 bool GoogleChromeSxSDistribution::HasUserExperiments() {
79 return true; 98 return true;
80 } 99 }
81 100
82 string16 GoogleChromeSxSDistribution::ChannelName() { 101 string16 GoogleChromeSxSDistribution::ChannelName() {
83 return kChannelName; 102 return kChannelName;
84 } 103 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698