| 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 |
| 17 // Details relating to how Chrome is installed. This class and | 18 // Details relating to how Chrome is installed. This class and |
| 18 // PrimaryInstallDetails (below) are used in tandem so that one instance of the | 19 // 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 | 20 // 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 | 21 // other modules in the process. For example, chrome_elf creates the instance |
| 21 // for a Chrome process and exports a GetInstallDetailsPayload function used by | 22 // for a Chrome process and exports a GetInstallDetailsPayload function used by |
| (...skipping 43 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 | 66 // This mode's index into the brand's array of install modes. This will match |
| 66 // a brand-specific InstallConstantIndex enumerator. | 67 // a brand-specific InstallConstantIndex enumerator. |
| 67 int install_mode_index() const { return payload_->mode->index; } | 68 int install_mode_index() const { return payload_->mode->index; } |
| 68 | 69 |
| 69 // The mode's install suffix (e.g., " SxS" for canary Chrome), or an empty | 70 // The mode's install suffix (e.g., " SxS" for canary Chrome), or an empty |
| 70 // string for a brand's primary install mode. | 71 // string for a brand's primary install mode. |
| 71 const wchar_t* install_suffix() const { | 72 const wchar_t* install_suffix() const { |
| 72 return payload_->mode->install_suffix; | 73 return payload_->mode->install_suffix; |
| 73 } | 74 } |
| 74 | 75 |
| 76 // Returns the full name of the installed product (e.g. "Chrome SxS" for |
| 77 // canary chrome). |
| 78 std::wstring install_full_name() const { |
| 79 return std::wstring(kProductPathName, kProductPathNameLength) |
| 80 .append(install_suffix()); |
| 81 } |
| 82 |
| 75 const InstallConstants& mode() const { return *payload_->mode; } | 83 const InstallConstants& mode() const { return *payload_->mode; } |
| 76 | 84 |
| 77 // The app GUID with which this mode is registered with Google Update, or an | 85 // The app GUID with which this mode is registered with Google Update, or an |
| 78 // empty string if this brand does not integrate with Google Update. | 86 // empty string if this brand does not integrate with Google Update. |
| 79 const wchar_t* app_guid() const { return payload_->mode->app_guid; } | 87 const wchar_t* app_guid() const { return payload_->mode->app_guid; } |
| 80 | 88 |
| 81 // True if the mode supports installation at system-level. | 89 // True if the mode supports installation at system-level. |
| 82 bool supports_system_level() const { | 90 bool supports_system_level() const { |
| 83 return payload_->mode->supports_system_level; | 91 return payload_->mode->supports_system_level; |
| 84 } | 92 } |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 } | 173 } |
| 166 | 174 |
| 167 private: | 175 private: |
| 168 std::wstring channel_; | 176 std::wstring channel_; |
| 169 Payload payload_ = Payload(); | 177 Payload payload_ = Payload(); |
| 170 }; | 178 }; |
| 171 | 179 |
| 172 } // namespace install_static | 180 } // namespace install_static |
| 173 | 181 |
| 174 #endif // CHROME_INSTALL_STATIC_INSTALL_DETAILS_H_ | 182 #endif // CHROME_INSTALL_STATIC_INSTALL_DETAILS_H_ |
| OLD | NEW |