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