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 declares a class that contains various method related to branding. | 5 // This file declares a class that contains various method related to branding. |
6 | 6 |
7 #ifndef CHROME_INSTALLER_UTIL_BROWSER_DISTRIBUTION_H_ | 7 #ifndef CHROME_INSTALLER_UTIL_BROWSER_DISTRIBUTION_H_ |
8 #define CHROME_INSTALLER_UTIL_BROWSER_DISTRIBUTION_H_ | 8 #define CHROME_INSTALLER_UTIL_BROWSER_DISTRIBUTION_H_ |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 11 matching lines...) Expand all Loading... | |
22 class BrowserDistribution { | 22 class BrowserDistribution { |
23 public: | 23 public: |
24 enum Type { | 24 enum Type { |
25 CHROME_BROWSER, | 25 CHROME_BROWSER, |
26 CHROME_FRAME, | 26 CHROME_FRAME, |
27 CHROME_BINARIES, | 27 CHROME_BINARIES, |
28 CHROME_APP_HOST, | 28 CHROME_APP_HOST, |
29 NUM_TYPES | 29 NUM_TYPES |
30 }; | 30 }; |
31 | 31 |
32 enum ShortcutType { | |
33 SHORTCUT_CHROME, | |
34 SHORTCUT_ALTERNATE_CHROME, | |
grt (UTC plus 2)
2013/07/05 17:27:37
I prefer SHORTCUT_CHROME_ALTERNATE for this since
gab
2013/07/08 12:59:02
Suggestion sgtm, please use SHORTCUT_CHROME_ALTERN
huangs
2013/07/08 19:43:57
(Optional) please consider changing SHORTCUT_CHROM
gab
2013/07/08 20:20:32
This is easily mitigated by a simple regex though
huangs
2013/07/09 15:02:53
Sounds good.
calamity
2013/07/16 04:05:17
Done.
| |
35 SHORTCUT_APP_LAUNCHER | |
36 }; | |
37 | |
38 enum Subfolder { | |
39 SUBFOLDER_CHROME, | |
40 // TODO(calamity): add SUBFOLDER_APPS when refactoring chrome app dir code. | |
41 }; | |
42 | |
32 virtual ~BrowserDistribution() {} | 43 virtual ~BrowserDistribution() {} |
33 | 44 |
34 static BrowserDistribution* GetDistribution(); | 45 static BrowserDistribution* GetDistribution(); |
35 | 46 |
36 static BrowserDistribution* GetSpecificDistribution(Type type); | 47 static BrowserDistribution* GetSpecificDistribution(Type type); |
37 | 48 |
38 Type GetType() const { return type_; } | 49 Type GetType() const { return type_; } |
39 | 50 |
40 virtual void DoPostUninstallOperations(const Version& version, | 51 virtual void DoPostUninstallOperations(const Version& version, |
41 const base::FilePath& local_data_path, | 52 const base::FilePath& local_data_path, |
42 const string16& distribution_data); | 53 const string16& distribution_data); |
43 | 54 |
44 // Returns the GUID to be used when registering for Active Setup. | 55 // Returns the GUID to be used when registering for Active Setup. |
45 virtual string16 GetActiveSetupGuid(); | 56 virtual string16 GetActiveSetupGuid(); |
46 | 57 |
47 virtual string16 GetAppGuid(); | 58 virtual string16 GetAppGuid(); |
48 | 59 |
49 // Returns the unsuffixed application name of this program. | 60 // Returns the unsuffixed application name of this program. |
50 // This is the base of the name registered with Default Programs on Windows. | 61 // This is the base of the name registered with Default Programs on Windows. |
51 // IMPORTANT: This should only be called by the installer which needs to make | 62 // IMPORTANT: This should only be called by the installer which needs to make |
52 // decisions on the suffixing of the upcoming install, not by external callers | 63 // decisions on the suffixing of the upcoming install, not by external callers |
53 // at run-time. | 64 // at run-time. |
54 virtual string16 GetBaseAppName(); | 65 virtual string16 GetBaseAppName(); |
55 | 66 |
56 // Returns the localized name of the program. | 67 // Returns the display name of this distribution. |
gab
2013/07/05 14:23:37
s/display name/localized display name
to be expli
calamity
2013/07/16 04:05:17
Done.
| |
57 virtual string16 GetAppShortCutName(); | 68 virtual string16 GetDisplayName(); |
58 | 69 |
59 virtual string16 GetAlternateApplicationName(); | 70 // Returns the name of the shortcut identified by |shortcut_type| for this |
gab
2013/07/05 14:23:37
s/name/localized name
(same idea as above)
calamity
2013/07/16 04:05:17
Done.
| |
71 // distribution. | |
72 virtual string16 GetShortcutName(ShortcutType shortcut_type); | |
73 | |
74 // Returns the index of the icon for the product identified by | |
75 // |shortcut_type|, inside the file specified by GetIconFilename(). | |
76 virtual int GetIconIndex(ShortcutType shortcut_type); | |
77 | |
78 // Returns the executable filename (not path) that contains the product icon. | |
79 virtual string16 GetIconFilename(); | |
80 | |
81 // Returns the name of the subfolder in the Start Menu identified by | |
gab
2013/07/05 14:23:37
s/name/localized name
(same idea as above)
calamity
2013/07/16 04:05:17
Done.
| |
82 // |subfolder_type| that this distribution should create shortcuts in. | |
grt (UTC plus 2)
2013/07/05 17:27:37
Please add to this comment that this returns GetSh
gab
2013/07/08 12:59:02
I don't see why you say that subclasses of BD assu
grt (UTC plus 2)
2013/07/08 15:15:50
Exactly. GoogleChromeDistribution and GoogleChrome
calamity
2013/07/16 04:05:17
Done.
| |
83 virtual string16 GetStartMenuShortcutSubfolder(Subfolder subfolder_type); | |
60 | 84 |
61 // Returns the unsuffixed appid of this program. | 85 // Returns the unsuffixed appid of this program. |
62 // The AppUserModelId is a property of Windows programs. | 86 // The AppUserModelId is a property of Windows programs. |
63 // IMPORTANT: This should only be called by ShellUtil::GetAppId as the appid | 87 // IMPORTANT: This should only be called by ShellUtil::GetAppId as the appid |
64 // should be suffixed in all scenarios. | 88 // should be suffixed in all scenarios. |
65 virtual string16 GetBaseAppId(); | 89 virtual string16 GetBaseAppId(); |
66 | 90 |
67 virtual string16 GetInstallSubDir(); | 91 virtual string16 GetInstallSubDir(); |
68 | 92 |
69 virtual string16 GetPublisherName(); | 93 virtual string16 GetPublisherName(); |
(...skipping 19 matching lines...) Expand all Loading... | |
89 virtual string16 GetUninstallLinkName(); | 113 virtual string16 GetUninstallLinkName(); |
90 | 114 |
91 virtual string16 GetUninstallRegPath(); | 115 virtual string16 GetUninstallRegPath(); |
92 | 116 |
93 virtual string16 GetVersionKey(); | 117 virtual string16 GetVersionKey(); |
94 | 118 |
95 virtual bool CanSetAsDefault(); | 119 virtual bool CanSetAsDefault(); |
96 | 120 |
97 virtual bool CanCreateDesktopShortcuts(); | 121 virtual bool CanCreateDesktopShortcuts(); |
98 | 122 |
99 // Returns the executable filename (not path) that contains the product icon. | |
100 virtual string16 GetIconFilename(); | |
101 | |
102 // Returns the index of the icon for the product, inside the file specified by | |
103 // GetIconFilename(). | |
104 virtual int GetIconIndex(); | |
105 | |
106 virtual bool GetChromeChannel(string16* channel); | 123 virtual bool GetChromeChannel(string16* channel); |
107 | 124 |
108 // Returns true if this distribution includes a DelegateExecute verb handler, | 125 // Returns true if this distribution includes a DelegateExecute verb handler, |
109 // and provides the CommandExecuteImpl class UUID if |handler_class_uuid| is | 126 // and provides the CommandExecuteImpl class UUID if |handler_class_uuid| is |
110 // non-NULL. | 127 // non-NULL. |
111 virtual bool GetCommandExecuteImplClsid(string16* handler_class_uuid); | 128 virtual bool GetCommandExecuteImplClsid(string16* handler_class_uuid); |
112 | 129 |
113 // Returns true if this distribution uses app_host.exe to run platform apps. | 130 // Returns true if this distribution uses app_host.exe to run platform apps. |
114 virtual bool AppHostIsSupported(); | 131 virtual bool AppHostIsSupported(); |
115 | 132 |
116 virtual void UpdateInstallStatus(bool system_install, | 133 virtual void UpdateInstallStatus(bool system_install, |
117 installer::ArchiveType archive_type, | 134 installer::ArchiveType archive_type, |
118 installer::InstallStatus install_status); | 135 installer::InstallStatus install_status); |
119 | 136 |
120 // Returns true if this distribution should set the Omaha experiment_labels | 137 // Returns true if this distribution should set the Omaha experiment_labels |
121 // registry value. | 138 // registry value. |
122 virtual bool ShouldSetExperimentLabels(); | 139 virtual bool ShouldSetExperimentLabels(); |
123 | 140 |
124 virtual bool HasUserExperiments(); | 141 virtual bool HasUserExperiments(); |
125 | 142 |
126 protected: | 143 protected: |
127 explicit BrowserDistribution(Type type); | 144 explicit BrowserDistribution(Type type); |
128 | 145 |
129 template<class DistributionClass> | 146 template<class DistributionClass> |
130 static BrowserDistribution* GetOrCreateBrowserDistribution( | 147 static BrowserDistribution* GetOrCreateBrowserDistribution( |
131 BrowserDistribution** dist); | 148 BrowserDistribution** dist); |
132 | 149 |
150 static const char* kDefaultAlternateChromeShortcutName; | |
grt (UTC plus 2)
2013/07/05 17:27:37
This appears to be unused. Remove it?
calamity
2013/07/16 04:05:17
Done.
| |
151 | |
133 const Type type_; | 152 const Type type_; |
134 | 153 |
135 private: | 154 private: |
136 BrowserDistribution(); | 155 BrowserDistribution(); |
137 | 156 |
138 DISALLOW_COPY_AND_ASSIGN(BrowserDistribution); | 157 DISALLOW_COPY_AND_ASSIGN(BrowserDistribution); |
139 }; | 158 }; |
140 | 159 |
141 #endif // CHROME_INSTALLER_UTIL_BROWSER_DISTRIBUTION_H_ | 160 #endif // CHROME_INSTALLER_UTIL_BROWSER_DISTRIBUTION_H_ |
OLD | NEW |