grt | e29f8ab | 2016-11-15 22:26:30 | [diff] [blame] | 1 | // 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 |
grt | 0f3aff7d | 2017-02-21 15:52:28 | [diff] [blame] | 19 | // 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. |
grt | e29f8ab | 2016-11-15 22:26:30 | [diff] [blame] | 27 | |
| 28 | #ifndef CHROME_INSTALL_STATIC_INSTALL_MODES_H_ |
| 29 | #define CHROME_INSTALL_STATIC_INSTALL_MODES_H_ |
| 30 | |
| 31 | #include <string> |
| 32 | |
pastarmovj | a3eac43 | 2016-12-07 17:38:52 | [diff] [blame] | 33 | #include "chrome/install_static/install_constants.h" |
grt | e29f8ab | 2016-11-15 22:26:30 | [diff] [blame] | 34 | |
| 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 | |
| 49 | namespace 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. |
| 53 | extern 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. |
| 57 | extern const wchar_t kProductPathName[]; |
| 58 | |
| 59 | // The length, in characters, of kProductPathName not including the terminator. |
| 60 | extern const size_t kProductPathNameLength; |
| 61 | |
grt | 8b09030 | 2017-01-11 11:55:38 | [diff] [blame] | 62 | // 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. |
grt | e29f8ab | 2016-11-15 22:26:30 | [diff] [blame] | 65 | extern const wchar_t kBinariesAppGuid[]; |
| 66 | |
| 67 | // The name of the registry key in which data for the brand's multi-install |
grt | 8b09030 | 2017-01-11 11:55:38 | [diff] [blame] | 68 | // binaries were stored for modes that once supported the now-deprecated |
| 69 | // multi-install. Must be empty if the brand integrates with Google Update. |
grt | e29f8ab | 2016-11-15 22:26:30 | [diff] [blame] | 70 | extern const wchar_t kBinariesPathName[]; |
| 71 | |
| 72 | // A brand's collection of install modes. |
| 73 | extern 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. |
grt | 0f3aff7d | 2017-02-21 15:52:28 | [diff] [blame] | 82 | std::wstring GetClientsKeyPath(const wchar_t* app_guid); |
grt | e29f8ab | 2016-11-15 22:26:30 | [diff] [blame] | 83 | std::wstring GetClientStateKeyPath(const wchar_t* app_guid); |
grt | e29f8ab | 2016-11-15 22:26:30 | [diff] [blame] | 84 | std::wstring GetClientStateMediumKeyPath(const wchar_t* app_guid); |
grt | 0f3aff7d | 2017-02-21 15:52:28 | [diff] [blame] | 85 | std::wstring GetBinariesClientsKeyPath(); |
| 86 | std::wstring GetBinariesClientStateKeyPath(); |
grt | e29f8ab | 2016-11-15 22:26:30 | [diff] [blame] | 87 | std::wstring GetBinariesClientStateMediumKeyPath(); |
| 88 | |
| 89 | } // namespace install_static |
| 90 | |
| 91 | #endif // CHROME_INSTALL_STATIC_INSTALL_MODES_H_ |