Remove obsolete for_web_contents parameter in FontRenderParamsQuery.
[chromium-blink-merge.git] / chrome / installer / util / browser_distribution.h
blob46fc4b9c274f705356ac49350e6e154c26aa9b5d
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
3 // found in the LICENSE file.
4 //
5 // This file declares a class that contains various method related to branding.
7 #ifndef CHROME_INSTALLER_UTIL_BROWSER_DISTRIBUTION_H_
8 #define CHROME_INSTALLER_UTIL_BROWSER_DISTRIBUTION_H_
10 #include <string>
12 #include "base/basictypes.h"
13 #include "base/files/file_path.h"
14 #include "base/memory/scoped_ptr.h"
15 #include "base/strings/string16.h"
16 #include "base/version.h"
17 #include "chrome/installer/util/util_constants.h"
19 #if defined(OS_WIN)
20 #include <windows.h> // NOLINT
21 #endif
23 class AppRegistrationData;
25 class BrowserDistribution {
26 public:
27 enum Type {
28 CHROME_BROWSER,
29 CHROME_FRAME,
30 CHROME_BINARIES,
31 NUM_TYPES
34 enum ShortcutType {
35 SHORTCUT_CHROME,
36 SHORTCUT_CHROME_ALTERNATE,
37 SHORTCUT_APP_LAUNCHER
40 enum Subfolder {
41 SUBFOLDER_CHROME,
42 SUBFOLDER_APPS,
45 enum DefaultBrowserControlPolicy {
46 DEFAULT_BROWSER_UNSUPPORTED,
47 DEFAULT_BROWSER_OS_CONTROL_ONLY,
48 DEFAULT_BROWSER_FULL_CONTROL
51 virtual ~BrowserDistribution();
53 static BrowserDistribution* GetDistribution();
55 static BrowserDistribution* GetSpecificDistribution(Type type);
57 Type GetType() const { return type_; }
59 // Getter and adaptors for the underlying |app_reg_data_|.
60 const AppRegistrationData& GetAppRegistrationData() const;
61 base::string16 GetAppGuid() const;
62 base::string16 GetStateKey() const;
63 base::string16 GetStateMediumKey() const;
64 base::string16 GetVersionKey() const;
66 virtual void DoPostUninstallOperations(
67 const Version& version,
68 const base::FilePath& local_data_path,
69 const base::string16& distribution_data);
71 // Returns the GUID to be used when registering for Active Setup.
72 virtual base::string16 GetActiveSetupGuid();
74 // Returns the unsuffixed application name of this program.
75 // This is the base of the name registered with Default Programs on Windows.
76 // IMPORTANT: This should only be called by the installer which needs to make
77 // decisions on the suffixing of the upcoming install, not by external callers
78 // at run-time.
79 virtual base::string16 GetBaseAppName();
81 // Returns the localized display name of this distribution.
82 virtual base::string16 GetDisplayName();
84 // Returns the localized name of the shortcut identified by |shortcut_type|
85 // for this distribution.
86 virtual base::string16 GetShortcutName(ShortcutType shortcut_type);
88 // Returns the index of the icon for the product identified by
89 // |shortcut_type|, inside the file specified by GetIconFilename().
90 virtual int GetIconIndex(ShortcutType shortcut_type);
92 // Returns the executable filename (not path) that contains the product icon.
93 virtual base::string16 GetIconFilename();
95 // Returns the localized name of the subfolder in the Start Menu identified by
96 // |subfolder_type| that this distribution should create shortcuts in. For
97 // SUBFOLDER_CHROME this returns GetShortcutName(SHORTCUT_CHROME).
98 virtual base::string16 GetStartMenuShortcutSubfolder(
99 Subfolder subfolder_type);
101 // Returns the unsuffixed appid of this program.
102 // The AppUserModelId is a property of Windows programs.
103 // IMPORTANT: This should only be called by ShellUtil::GetAppId as the appid
104 // should be suffixed in all scenarios.
105 virtual base::string16 GetBaseAppId();
107 // Returns the Browser ProgId prefix (e.g. ChromeHTML, ChromiumHTM, etc...).
108 // The full id is of the form |prefix|.|suffix| and is limited to a maximum
109 // length of 39 characters including null-terminator. See
110 // http://msdn.microsoft.com/library/aa911706.aspx for details. We define
111 // |suffix| as a fixed-length 26-character alphanumeric identifier, therefore
112 // the return value of this function must have a maximum length of
113 // 39 - 1(null-term) - 26(|suffix|) - 1(dot separator) = 11 characters.
114 virtual base::string16 GetBrowserProgIdPrefix();
116 // Returns the Browser ProgId description.
117 virtual base::string16 GetBrowserProgIdDesc();
119 virtual base::string16 GetInstallSubDir();
121 virtual base::string16 GetPublisherName();
123 virtual base::string16 GetAppDescription();
125 virtual base::string16 GetLongAppDescription();
127 virtual std::string GetSafeBrowsingName();
129 virtual std::string GetNetworkStatsServer() const;
131 #if defined(OS_WIN)
132 virtual base::string16 GetDistributionData(HKEY root_key);
133 #endif
135 virtual base::string16 GetUninstallLinkName();
137 virtual base::string16 GetUninstallRegPath();
139 // Returns an enum specifying the different ways in which this distribution
140 // is allowed to be set as default.
141 virtual DefaultBrowserControlPolicy GetDefaultBrowserControlPolicy();
143 virtual bool CanCreateDesktopShortcuts();
145 virtual bool GetChromeChannel(base::string16* channel);
147 // Returns true if this distribution includes a DelegateExecute verb handler,
148 // and provides the CommandExecuteImpl class UUID if |handler_class_uuid| is
149 // non-NULL.
150 virtual bool GetCommandExecuteImplClsid(base::string16* handler_class_uuid);
152 virtual void UpdateInstallStatus(bool system_install,
153 installer::ArchiveType archive_type,
154 installer::InstallStatus install_status);
156 // Returns true if this distribution should set the Omaha experiment_labels
157 // registry value.
158 virtual bool ShouldSetExperimentLabels();
160 virtual bool HasUserExperiments();
162 protected:
163 BrowserDistribution(Type type, scoped_ptr<AppRegistrationData> app_reg_data);
165 template<class DistributionClass>
166 static BrowserDistribution* GetOrCreateBrowserDistribution(
167 BrowserDistribution** dist);
169 const Type type_;
171 scoped_ptr<AppRegistrationData> app_reg_data_;
173 private:
174 BrowserDistribution();
176 DISALLOW_COPY_AND_ASSIGN(BrowserDistribution);
179 #endif // CHROME_INSTALLER_UTIL_BROWSER_DISTRIBUTION_H_