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.
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_
12 #include "base/basictypes.h"
13 #include "base/files/file_path.h"
14 #include "base/strings/string16.h"
15 #include "base/version.h"
16 #include "chrome/installer/util/util_constants.h"
19 #include <windows.h> // NOLINT
22 class BrowserDistribution
{
32 virtual ~BrowserDistribution() {}
34 static BrowserDistribution
* GetDistribution();
36 static BrowserDistribution
* GetSpecificDistribution(Type type
);
38 Type
GetType() const { return type_
; }
40 virtual void DoPostUninstallOperations(const Version
& version
,
41 const base::FilePath
& local_data_path
,
42 const string16
& distribution_data
);
44 // Returns the GUID to be used when registering for Active Setup.
45 virtual string16
GetActiveSetupGuid();
47 virtual string16
GetAppGuid();
49 // Returns the unsuffixed application name of this program.
50 // 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
52 // decisions on the suffixing of the upcoming install, not by external callers
54 virtual string16
GetBaseAppName();
56 // Returns the localized name of the program.
57 virtual string16
GetAppShortCutName();
59 virtual string16
GetAlternateApplicationName();
61 // Returns the unsuffixed appid of this program.
62 // The AppUserModelId is a property of Windows programs.
63 // IMPORTANT: This should only be called by ShellUtil::GetAppId as the appid
64 // should be suffixed in all scenarios.
65 virtual string16
GetBaseAppId();
67 virtual string16
GetInstallSubDir();
69 virtual string16
GetPublisherName();
71 virtual string16
GetAppDescription();
73 virtual string16
GetLongAppDescription();
75 virtual std::string
GetSafeBrowsingName();
77 virtual string16
GetStateKey();
79 virtual string16
GetStateMediumKey();
81 virtual std::string
GetNetworkStatsServer() const;
83 virtual std::string
GetHttpPipeliningTestServer() const;
86 virtual string16
GetDistributionData(HKEY root_key
);
89 virtual string16
GetUninstallLinkName();
91 virtual string16
GetUninstallRegPath();
93 virtual string16
GetVersionKey();
95 virtual bool CanSetAsDefault();
97 virtual bool CanCreateDesktopShortcuts();
99 // Returns the executable filename (not path) that contains the product icon.
100 virtual string16
GetIconFilename();
102 // Returns the index of the icon for the product, inside the file specified by
103 // GetIconFilename().
104 virtual int GetIconIndex();
106 virtual bool GetChromeChannel(string16
* channel
);
108 // Returns true if this distribution includes a DelegateExecute verb handler,
109 // and provides the CommandExecuteImpl class UUID if |handler_class_uuid| is
111 virtual bool GetCommandExecuteImplClsid(string16
* handler_class_uuid
);
113 // Returns true if this distribution uses app_host.exe to run platform apps.
114 virtual bool AppHostIsSupported();
116 virtual void UpdateInstallStatus(bool system_install
,
117 installer::ArchiveType archive_type
,
118 installer::InstallStatus install_status
);
120 // Returns true if this distribution should set the Omaha experiment_labels
122 virtual bool ShouldSetExperimentLabels();
124 virtual bool HasUserExperiments();
127 explicit BrowserDistribution(Type type
);
129 template<class DistributionClass
>
130 static BrowserDistribution
* GetOrCreateBrowserDistribution(
131 BrowserDistribution
** dist
);
136 BrowserDistribution();
138 DISALLOW_COPY_AND_ASSIGN(BrowserDistribution
);
141 #endif // CHROME_INSTALLER_UTIL_BROWSER_DISTRIBUTION_H_