Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CHROME_INSTALL_STATIC_INSTALL_DETAILS_H_ | 5 #ifndef CHROME_INSTALL_STATIC_INSTALL_DETAILS_H_ |
| 6 #define CHROME_INSTALL_STATIC_INSTALL_DETAILS_H_ | 6 #define CHROME_INSTALL_STATIC_INSTALL_DETAILS_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "chrome/install_static/install_constants.h" | 11 #include "chrome/install_static/install_constants.h" |
| 12 #include "chrome/install_static/install_modes.h" | |
| 12 | 13 |
| 13 namespace install_static { | 14 namespace install_static { |
| 14 | 15 |
| 15 class PrimaryInstallDetails; | 16 class PrimaryInstallDetails; |
| 16 | 17 |
| 18 // Re-declare the constants from install_modes.h to avoid cyclical dependency. | |
|
grt (UTC plus 2)
2016/11/29 12:40:24
nit: remove this now? :-)
| |
| 19 // extern const wchar_t kProductPathName[]; | |
| 20 // extern const size_t kProductPathNameLength; | |
| 21 | |
| 17 // Details relating to how Chrome is installed. This class and | 22 // Details relating to how Chrome is installed. This class and |
| 18 // PrimaryInstallDetails (below) are used in tandem so that one instance of the | 23 // PrimaryInstallDetails (below) are used in tandem so that one instance of the |
| 19 // latter may be initialized early during process startup and then shared with | 24 // latter may be initialized early during process startup and then shared with |
| 20 // other modules in the process. For example, chrome_elf creates the instance | 25 // other modules in the process. For example, chrome_elf creates the instance |
| 21 // for a Chrome process and exports a GetInstallDetailsPayload function used by | 26 // for a Chrome process and exports a GetInstallDetailsPayload function used by |
| 22 // chrome.exe and chrome.dll to create their own module-specific instances | 27 // chrome.exe and chrome.dll to create their own module-specific instances |
| 23 // referring to the same underlying payload. See install_modes.h for a gentle | 28 // referring to the same underlying payload. See install_modes.h for a gentle |
| 24 // introduction to such terms as "brand" and "mode". | 29 // introduction to such terms as "brand" and "mode". |
| 25 class InstallDetails { | 30 class InstallDetails { |
| 26 public: | 31 public: |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 65 // This mode's index into the brand's array of install modes. This will match | 70 // This mode's index into the brand's array of install modes. This will match |
| 66 // a brand-specific InstallConstantIndex enumerator. | 71 // a brand-specific InstallConstantIndex enumerator. |
| 67 int install_mode_index() const { return payload_->mode->index; } | 72 int install_mode_index() const { return payload_->mode->index; } |
| 68 | 73 |
| 69 // The mode's install suffix (e.g., " SxS" for canary Chrome), or an empty | 74 // The mode's install suffix (e.g., " SxS" for canary Chrome), or an empty |
| 70 // string for a brand's primary install mode. | 75 // string for a brand's primary install mode. |
| 71 const wchar_t* install_suffix() const { | 76 const wchar_t* install_suffix() const { |
| 72 return payload_->mode->install_suffix; | 77 return payload_->mode->install_suffix; |
| 73 } | 78 } |
| 74 | 79 |
| 80 // Returns the full name of the installed product (e.g. "Chrome SxS" for | |
| 81 // canary chrome). | |
| 82 std::wstring install_full_name() const { | |
| 83 return std::wstring(kProductPathName, kProductPathNameLength) | |
| 84 .append(install_suffix()); | |
| 85 } | |
| 86 | |
| 75 // The app GUID with which this mode is registered with Google Update, or an | 87 // The app GUID with which this mode is registered with Google Update, or an |
| 76 // empty string if this brand does not integrate with Google Update. | 88 // empty string if this brand does not integrate with Google Update. |
| 77 const wchar_t* app_guid() const { return payload_->mode->app_guid; } | 89 const wchar_t* app_guid() const { return payload_->mode->app_guid; } |
| 78 | 90 |
| 79 // True if the mode supports installation at system-level. | 91 // True if the mode supports installation at system-level. |
| 80 bool supports_system_level() const { | 92 bool supports_system_level() const { |
| 81 return payload_->mode->supports_system_level; | 93 return payload_->mode->supports_system_level; |
| 82 } | 94 } |
| 83 | 95 |
| 84 // True if the mode supports multi-install. | 96 // True if the mode supports multi-install. |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 163 } | 175 } |
| 164 | 176 |
| 165 private: | 177 private: |
| 166 std::wstring channel_; | 178 std::wstring channel_; |
| 167 Payload payload_ = Payload(); | 179 Payload payload_ = Payload(); |
| 168 }; | 180 }; |
| 169 | 181 |
| 170 } // namespace install_static | 182 } // namespace install_static |
| 171 | 183 |
| 172 #endif // CHROME_INSTALL_STATIC_INSTALL_DETAILS_H_ | 184 #endif // CHROME_INSTALL_STATIC_INSTALL_DETAILS_H_ |
| OLD | NEW |