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

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 const int kSxSAppLauncherIconIndex = 6;
20 21
21 } // namespace 22 } // namespace
22 23
23 GoogleChromeSxSDistribution::GoogleChromeSxSDistribution() 24 GoogleChromeSxSDistribution::GoogleChromeSxSDistribution()
24 : GoogleChromeDistribution() { 25 : GoogleChromeDistribution() {
25 GoogleChromeDistribution::set_product_guid(kChromeSxSGuid); 26 GoogleChromeDistribution::set_product_guid(kChromeSxSGuid);
26 } 27 }
27 28
28 string16 GoogleChromeSxSDistribution::GetBaseAppName() { 29 string16 GoogleChromeSxSDistribution::GetBaseAppName() {
29 return L"Google Chrome Canary"; 30 return L"Google Chrome Canary";
30 } 31 }
31 32
32 string16 GoogleChromeSxSDistribution::GetAppShortCutName() { 33 string16 GoogleChromeSxSDistribution::GetShortcutName(
33 const string16& shortcut_name = 34 ShortcutType shortcut_type) {
34 installer::GetLocalizedString(IDS_SXS_SHORTCUT_NAME_BASE); 35 switch (shortcut_type) {
35 return shortcut_name; 36 case SHORTCUT_CHROME_ALTERNATE:
37 // This should never be called. Returning the same string as Google Chrome
38 // preserves behavior, but it will result in a naming collision.
39 NOTREACHED();
40 return GoogleChromeDistribution::GetShortcutName(shortcut_type);
41 case SHORTCUT_APP_LAUNCHER:
42 return installer::GetLocalizedString(
43 IDS_APP_LIST_SHORTCUT_NAME_CANARY_BASE);
44 default:
45 DCHECK_EQ(shortcut_type, SHORTCUT_CHROME);
46 return installer::GetLocalizedString(IDS_SXS_SHORTCUT_NAME_BASE);
47 }
36 } 48 }
37 49
38 string16 GoogleChromeSxSDistribution::GetBaseAppId() { 50 string16 GoogleChromeSxSDistribution::GetBaseAppId() {
39 return kBrowserAppId; 51 return kBrowserAppId;
40 } 52 }
41 53
42 string16 GoogleChromeSxSDistribution::GetInstallSubDir() { 54 string16 GoogleChromeSxSDistribution::GetInstallSubDir() {
43 return GoogleChromeDistribution::GetInstallSubDir().append( 55 return GoogleChromeDistribution::GetInstallSubDir().append(
44 installer::kSxSSuffix); 56 installer::kSxSSuffix);
45 } 57 }
46 58
47 string16 GoogleChromeSxSDistribution::GetUninstallRegPath() { 59 string16 GoogleChromeSxSDistribution::GetUninstallRegPath() {
48 return GoogleChromeDistribution::GetUninstallRegPath().append( 60 return GoogleChromeDistribution::GetUninstallRegPath().append(
49 installer::kSxSSuffix); 61 installer::kSxSSuffix);
50 } 62 }
51 63
52 bool GoogleChromeSxSDistribution::CanSetAsDefault() { 64 bool GoogleChromeSxSDistribution::CanSetAsDefault() {
53 return false; 65 return false;
54 } 66 }
55 67
56 int GoogleChromeSxSDistribution::GetIconIndex() { 68 int GoogleChromeSxSDistribution::GetIconIndex(ShortcutType shortcut_type) {
69 // The Chrome App Launcher Canary icon is index 6; see chrome_exe.rc.
grt (UTC plus 2) 2013/07/16 19:38:44 please move this comment up to the definition of k
calamity 2013/07/18 07:56:14 Done.
70 if (shortcut_type == SHORTCUT_APP_LAUNCHER)
71 return kSxSAppLauncherIconIndex;
72 DCHECK(shortcut_type == SHORTCUT_CHROME ||
73 shortcut_type == SHORTCUT_CHROME_ALTERNATE) << shortcut_type;
57 return kSxSIconIndex; 74 return kSxSIconIndex;
58 } 75 }
59 76
60 bool GoogleChromeSxSDistribution::GetChromeChannel(string16* channel) { 77 bool GoogleChromeSxSDistribution::GetChromeChannel(string16* channel) {
61 *channel = kChannelName; 78 *channel = kChannelName;
62 return true; 79 return true;
63 } 80 }
64 81
65 bool GoogleChromeSxSDistribution::GetCommandExecuteImplClsid( 82 bool GoogleChromeSxSDistribution::GetCommandExecuteImplClsid(
66 string16* handler_class_uuid) { 83 string16* handler_class_uuid) {
67 return false; 84 return false;
68 } 85 }
69 86
70 bool GoogleChromeSxSDistribution::AppHostIsSupported() { 87 bool GoogleChromeSxSDistribution::AppHostIsSupported() {
71 return false; 88 return false;
72 } 89 }
73 90
74 bool GoogleChromeSxSDistribution::ShouldSetExperimentLabels() { 91 bool GoogleChromeSxSDistribution::ShouldSetExperimentLabels() {
75 return true; 92 return true;
76 } 93 }
77 94
78 bool GoogleChromeSxSDistribution::HasUserExperiments() { 95 bool GoogleChromeSxSDistribution::HasUserExperiments() {
79 return true; 96 return true;
80 } 97 }
81 98
82 string16 GoogleChromeSxSDistribution::ChannelName() { 99 string16 GoogleChromeSxSDistribution::ChannelName() {
83 return kChannelName; 100 return kChannelName;
84 } 101 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698