OLD | NEW |
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" |
(...skipping 14 matching lines...) Expand all Loading... |
25 // The Chrome App Launcher Canary icon is index 6; see chrome_exe.rc. | 25 // The Chrome App Launcher Canary icon is index 6; see chrome_exe.rc. |
26 const int kSxSAppLauncherIconIndex = 6; | 26 const int kSxSAppLauncherIconIndex = 6; |
27 | 27 |
28 } // namespace | 28 } // namespace |
29 | 29 |
30 GoogleChromeSxSDistribution::GoogleChromeSxSDistribution() | 30 GoogleChromeSxSDistribution::GoogleChromeSxSDistribution() |
31 : GoogleChromeDistribution() { | 31 : GoogleChromeDistribution() { |
32 GoogleChromeDistribution::set_product_guid(kChromeSxSGuid); | 32 GoogleChromeDistribution::set_product_guid(kChromeSxSGuid); |
33 } | 33 } |
34 | 34 |
35 string16 GoogleChromeSxSDistribution::GetBaseAppName() { | 35 base::string16 GoogleChromeSxSDistribution::GetBaseAppName() { |
36 return L"Google Chrome Canary"; | 36 return L"Google Chrome Canary"; |
37 } | 37 } |
38 | 38 |
39 string16 GoogleChromeSxSDistribution::GetShortcutName( | 39 base::string16 GoogleChromeSxSDistribution::GetShortcutName( |
40 ShortcutType shortcut_type) { | 40 ShortcutType shortcut_type) { |
41 switch (shortcut_type) { | 41 switch (shortcut_type) { |
42 case SHORTCUT_CHROME_ALTERNATE: | 42 case SHORTCUT_CHROME_ALTERNATE: |
43 // This should never be called. Returning the same string as Google Chrome | 43 // This should never be called. Returning the same string as Google Chrome |
44 // preserves behavior, but it will result in a naming collision. | 44 // preserves behavior, but it will result in a naming collision. |
45 NOTREACHED(); | 45 NOTREACHED(); |
46 return GoogleChromeDistribution::GetShortcutName(shortcut_type); | 46 return GoogleChromeDistribution::GetShortcutName(shortcut_type); |
47 case SHORTCUT_APP_LAUNCHER: | 47 case SHORTCUT_APP_LAUNCHER: |
48 return installer::GetLocalizedString( | 48 return installer::GetLocalizedString( |
49 IDS_APP_LIST_SHORTCUT_NAME_CANARY_BASE); | 49 IDS_APP_LIST_SHORTCUT_NAME_CANARY_BASE); |
50 default: | 50 default: |
51 DCHECK_EQ(shortcut_type, SHORTCUT_CHROME); | 51 DCHECK_EQ(shortcut_type, SHORTCUT_CHROME); |
52 return installer::GetLocalizedString(IDS_SXS_SHORTCUT_NAME_BASE); | 52 return installer::GetLocalizedString(IDS_SXS_SHORTCUT_NAME_BASE); |
53 } | 53 } |
54 } | 54 } |
55 | 55 |
56 string16 GoogleChromeSxSDistribution::GetStartMenuShortcutSubfolder( | 56 base::string16 GoogleChromeSxSDistribution::GetStartMenuShortcutSubfolder( |
57 Subfolder subfolder_type) { | 57 Subfolder subfolder_type) { |
58 switch (subfolder_type) { | 58 switch (subfolder_type) { |
59 case SUBFOLDER_APPS: | 59 case SUBFOLDER_APPS: |
60 return installer::GetLocalizedString( | 60 return installer::GetLocalizedString( |
61 IDS_APP_SHORTCUTS_SUBDIR_NAME_CANARY_BASE); | 61 IDS_APP_SHORTCUTS_SUBDIR_NAME_CANARY_BASE); |
62 default: | 62 default: |
63 DCHECK_EQ(subfolder_type, SUBFOLDER_CHROME); | 63 DCHECK_EQ(subfolder_type, SUBFOLDER_CHROME); |
64 return GetShortcutName(SHORTCUT_CHROME); | 64 return GetShortcutName(SHORTCUT_CHROME); |
65 } | 65 } |
66 } | 66 } |
67 | 67 |
68 string16 GoogleChromeSxSDistribution::GetBaseAppId() { | 68 base::string16 GoogleChromeSxSDistribution::GetBaseAppId() { |
69 return kBrowserAppId; | 69 return kBrowserAppId; |
70 } | 70 } |
71 | 71 |
72 string16 GoogleChromeSxSDistribution::GetBrowserProgIdPrefix() { | 72 base::string16 GoogleChromeSxSDistribution::GetBrowserProgIdPrefix() { |
73 return kBrowserProgIdPrefix; | 73 return kBrowserProgIdPrefix; |
74 } | 74 } |
75 | 75 |
76 string16 GoogleChromeSxSDistribution::GetBrowserProgIdDesc() { | 76 base::string16 GoogleChromeSxSDistribution::GetBrowserProgIdDesc() { |
77 return kBrowserProgIdDesc; | 77 return kBrowserProgIdDesc; |
78 } | 78 } |
79 | 79 |
80 string16 GoogleChromeSxSDistribution::GetInstallSubDir() { | 80 base::string16 GoogleChromeSxSDistribution::GetInstallSubDir() { |
81 return GoogleChromeDistribution::GetInstallSubDir().append( | 81 return GoogleChromeDistribution::GetInstallSubDir().append( |
82 installer::kSxSSuffix); | 82 installer::kSxSSuffix); |
83 } | 83 } |
84 | 84 |
85 string16 GoogleChromeSxSDistribution::GetUninstallRegPath() { | 85 base::string16 GoogleChromeSxSDistribution::GetUninstallRegPath() { |
86 return GoogleChromeDistribution::GetUninstallRegPath().append( | 86 return GoogleChromeDistribution::GetUninstallRegPath().append( |
87 installer::kSxSSuffix); | 87 installer::kSxSSuffix); |
88 } | 88 } |
89 | 89 |
90 BrowserDistribution::DefaultBrowserControlPolicy | 90 BrowserDistribution::DefaultBrowserControlPolicy |
91 GoogleChromeSxSDistribution::GetDefaultBrowserControlPolicy() { | 91 GoogleChromeSxSDistribution::GetDefaultBrowserControlPolicy() { |
92 return DEFAULT_BROWSER_OS_CONTROL_ONLY; | 92 return DEFAULT_BROWSER_OS_CONTROL_ONLY; |
93 } | 93 } |
94 | 94 |
95 int GoogleChromeSxSDistribution::GetIconIndex(ShortcutType shortcut_type) { | 95 int GoogleChromeSxSDistribution::GetIconIndex(ShortcutType shortcut_type) { |
96 if (shortcut_type == SHORTCUT_APP_LAUNCHER) | 96 if (shortcut_type == SHORTCUT_APP_LAUNCHER) |
97 return kSxSAppLauncherIconIndex; | 97 return kSxSAppLauncherIconIndex; |
98 DCHECK(shortcut_type == SHORTCUT_CHROME || | 98 DCHECK(shortcut_type == SHORTCUT_CHROME || |
99 shortcut_type == SHORTCUT_CHROME_ALTERNATE) << shortcut_type; | 99 shortcut_type == SHORTCUT_CHROME_ALTERNATE) << shortcut_type; |
100 return kSxSIconIndex; | 100 return kSxSIconIndex; |
101 } | 101 } |
102 | 102 |
103 bool GoogleChromeSxSDistribution::GetChromeChannel(string16* channel) { | 103 bool GoogleChromeSxSDistribution::GetChromeChannel(base::string16* channel) { |
104 *channel = kChannelName; | 104 *channel = kChannelName; |
105 return true; | 105 return true; |
106 } | 106 } |
107 | 107 |
108 bool GoogleChromeSxSDistribution::GetCommandExecuteImplClsid( | 108 bool GoogleChromeSxSDistribution::GetCommandExecuteImplClsid( |
109 string16* handler_class_uuid) { | 109 base::string16* handler_class_uuid) { |
110 if (handler_class_uuid) | 110 if (handler_class_uuid) |
111 *handler_class_uuid = kCommandExecuteImplUuid; | 111 *handler_class_uuid = kCommandExecuteImplUuid; |
112 return true; | 112 return true; |
113 } | 113 } |
114 | 114 |
115 bool GoogleChromeSxSDistribution::AppHostIsSupported() { | 115 bool GoogleChromeSxSDistribution::AppHostIsSupported() { |
116 return false; | 116 return false; |
117 } | 117 } |
118 | 118 |
119 bool GoogleChromeSxSDistribution::ShouldSetExperimentLabels() { | 119 bool GoogleChromeSxSDistribution::ShouldSetExperimentLabels() { |
120 return true; | 120 return true; |
121 } | 121 } |
122 | 122 |
123 bool GoogleChromeSxSDistribution::HasUserExperiments() { | 123 bool GoogleChromeSxSDistribution::HasUserExperiments() { |
124 return true; | 124 return true; |
125 } | 125 } |
126 | 126 |
127 string16 GoogleChromeSxSDistribution::ChannelName() { | 127 base::string16 GoogleChromeSxSDistribution::ChannelName() { |
128 return kChannelName; | 128 return kChannelName; |
129 } | 129 } |
OLD | NEW |