blob: c5207f5bfeab85e41f087fb514cbd4319b112db7 [file] [log] [blame]
grte29f8ab2016-11-15 22:26:301// Copyright 2016 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 constants that describe specifics of a Chromium-based
6// browser's branding and modes of installation.
7//
8// A browser's brand comprises all identifying markings that distinguish it from
9// a browser produced by another party. Chromium has remnants of both the
10// Chromium and Google Chrome brands.
11//
12// Each brand defines one primary install mode for the browser. A brand may
13// additionally define one or more secondary install modes (e.g., Google
14// Chrome's SxS mode for the canary channel). Install modes are described by
15// compile-time instantiations of the `InstallConstants` struct in a brand's
16// `kInstallModes` array. Index 0 of this array always describes the primary
17// install mode. All other entries describe secondary modes, which are
18// distinguished by an install suffix (e.g., " SxS") that appears in file and
grt0f3aff7d2017-02-21 15:52:2819// registry paths. A given machine may have any combination of a brand's modes
20// installed at the same time (e.g., primary only, one or more secondary, or
21// even primary and all secondary modes). Parallel installs of a brand's modes
22// (e.g., Google Chrome and Google Chrome SxS (canary) installed on the same
23// machine) store user data in distinct directories. Administrative policies, on
24// the other hand, apply to all of a brand's install modes (e.g., the
25// AlwaysOpenPdfExternally group policy setting applies to both Google Chrome
26// and Google Chrome SxS.
grte29f8ab2016-11-15 22:26:3027
28#ifndef CHROME_INSTALL_STATIC_INSTALL_MODES_H_
29#define CHROME_INSTALL_STATIC_INSTALL_MODES_H_
30
31#include <string>
32
pastarmovja3eac432016-12-07 17:38:5233#include "chrome/install_static/install_constants.h"
grte29f8ab2016-11-15 22:26:3034
35// Include the brand-specific values. Each of these must define:
36// - enum InstallConstantIndex: named indices of the brand's kInstallModes
37// array.
38// - NUM_INSTALL_MODES: the total numer of modes (i.e., the numer of items in
39// kInstallModes.
40// - kUseGoogleUpdateIntegration: true or false indicating whether or not the
41// brand uses Chrome's integration with Google Update. Google Chrome does,
42// while Chromium does not.
43#if defined(GOOGLE_CHROME_BUILD)
44#include "chrome/install_static/google_chrome_install_modes.h"
45#else
46#include "chrome/install_static/chromium_install_modes.h"
47#endif
48
49namespace install_static {
50
51// The brand-specific company name to be included as a component of the install
52// and user data directory paths. May be empty if no such dir is to be used.
53extern const wchar_t kCompanyPathName[];
54
55// The brand-specific product name to be included as a component of the install
56// and user data directory paths.
57extern const wchar_t kProductPathName[];
58
59// The length, in characters, of kProductPathName not including the terminator.
60extern const size_t kProductPathNameLength;
61
grt8b090302017-01-11 11:55:3862// The GUID with which the brand's multi-install binaries were registered with
63// Google Update for modes that once supported the now-deprecated multi-install.
64// Must be empty if the brand does not integrate with Google Update.
grte29f8ab2016-11-15 22:26:3065extern const wchar_t kBinariesAppGuid[];
66
67// The name of the registry key in which data for the brand's multi-install
grt8b090302017-01-11 11:55:3868// binaries were stored for modes that once supported the now-deprecated
69// multi-install. Must be empty if the brand integrates with Google Update.
grte29f8ab2016-11-15 22:26:3070extern const wchar_t kBinariesPathName[];
71
72// A brand's collection of install modes.
73extern const InstallConstants kInstallModes[];
74
75// The following convenience functions behave conditionally on whether or not
76// the brand uses Chrome's integration with Google Update. For brands that do
77// not (e.g., Chromium), they return something like "Software\Chromium" or
78// "Software\Chromium Binaries". Otherwise, for brands that do integrate with
79// Google Update, they return something like
80// "Software\Google\Update\ClientState{Medium}\<guid>" where "<guid>" is either
81// |mode|'s appguid or the brand's kBinariesAppGuid.
grt0f3aff7d2017-02-21 15:52:2882std::wstring GetClientsKeyPath(const wchar_t* app_guid);
grte29f8ab2016-11-15 22:26:3083std::wstring GetClientStateKeyPath(const wchar_t* app_guid);
grte29f8ab2016-11-15 22:26:3084std::wstring GetClientStateMediumKeyPath(const wchar_t* app_guid);
grt0f3aff7d2017-02-21 15:52:2885std::wstring GetBinariesClientsKeyPath();
86std::wstring GetBinariesClientStateKeyPath();
grte29f8ab2016-11-15 22:26:3087std::wstring GetBinariesClientStateMediumKeyPath();
88
89} // namespace install_static
90
91#endif // CHROME_INSTALL_STATIC_INSTALL_MODES_H_