Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(307)

Side by Side Diff: chrome/install_static/install_details.h

Issue 2459583002: Use InstallDetails in setup. (Closed)
Patch Set: compile fix Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 InstallDetails& operator=(const InstallDetails&) = delete; 58 InstallDetails& operator=(const InstallDetails&) = delete;
59 virtual ~InstallDetails() = default; 59 virtual ~InstallDetails() = default;
60 60
61 // Returns the instance for this module. 61 // Returns the instance for this module.
62 static const InstallDetails& Get(); 62 static const InstallDetails& Get();
63 63
64 // This mode's index into the brand's array of install modes. This will match 64 // This mode's index into the brand's array of install modes. This will match
65 // a brand-specific InstallConstantIndex enumerator. 65 // a brand-specific InstallConstantIndex enumerator.
66 int install_mode_index() const { return payload_->mode->index; } 66 int install_mode_index() const { return payload_->mode->index; }
67 67
68 // Returns true if the current mode is the brand's primary install mode rather
69 // than one of its secondary modes (e.g., canary Chrome).
70 bool is_primary_mode() const { return install_mode_index() == 0; }
71
68 // The mode's install suffix (e.g., " SxS" for canary Chrome), or an empty 72 // The mode's install suffix (e.g., " SxS" for canary Chrome), or an empty
69 // string for a brand's primary install mode. 73 // string for a brand's primary install mode.
70 const wchar_t* install_suffix() const { 74 const wchar_t* install_suffix() const {
71 return payload_->mode->install_suffix; 75 return payload_->mode->install_suffix;
72 } 76 }
73 77
78 // The mode's logo suffix (e.g., "Canary" for canary Chrome), or an empty
79 // string for a brand's primary install mode.
80 const wchar_t* logo_suffix() const { return payload_->mode->logo_suffix; }
81
74 // Returns the full name of the installed product (e.g. "Chrome SxS" for 82 // Returns the full name of the installed product (e.g. "Chrome SxS" for
75 // canary chrome). 83 // canary chrome).
76 std::wstring install_full_name() const { 84 std::wstring install_full_name() const {
77 return std::wstring(kProductPathName, kProductPathNameLength) 85 return std::wstring(kProductPathName, kProductPathNameLength)
78 .append(install_suffix()); 86 .append(install_suffix());
79 } 87 }
80 88
81 const InstallConstants& mode() const { return *payload_->mode; } 89 const InstallConstants& mode() const { return *payload_->mode; }
82 90
83 // The app GUID with which this mode is registered with Google Update, or an 91 // The app GUID with which this mode is registered with Google Update, or an
84 // empty string if this brand does not integrate with Google Update. 92 // empty string if this brand does not integrate with Google Update.
85 const wchar_t* app_guid() const { return payload_->mode->app_guid; } 93 const wchar_t* app_guid() const { return payload_->mode->app_guid; }
86 94
87 // True if the mode supports installation at system-level. 95 // True if the mode supports installation at system-level.
88 bool supports_system_level() const { 96 bool supports_system_level() const {
89 return payload_->mode->supports_system_level; 97 return payload_->mode->supports_system_level;
90 } 98 }
91 99
92 // True if the mode once supported multi-install. 100 // True if the mode once supported multi-install.
robertshield 2017/02/20 19:11:16 Maybe expand this to "True if the mode once supp
grt (UTC plus 2) 2017/02/21 13:21:15 Done.
93 bool supported_multi_install() const { 101 bool supported_multi_install() const {
94 return payload_->mode->supported_multi_install; 102 return payload_->mode->supported_multi_install;
95 } 103 }
96 104
97 // The install's update channel, or an empty string if the brand does not 105 // The install's update channel, or an empty string if the brand does not
98 // integrate with Google Update. 106 // integrate with Google Update.
99 std::wstring channel() const { 107 std::wstring channel() const {
100 return std::wstring(payload_->channel, payload_->channel_length); 108 return std::wstring(payload_->channel, payload_->channel_length);
101 } 109 }
102 bool system_level() const { return payload_->system_level; } 110 bool system_level() const { return payload_->system_level; }
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 } 175 }
168 176
169 private: 177 private:
170 std::wstring channel_; 178 std::wstring channel_;
171 Payload payload_ = Payload(); 179 Payload payload_ = Payload();
172 }; 180 };
173 181
174 } // namespace install_static 182 } // namespace install_static
175 183
176 #endif // CHROME_INSTALL_STATIC_INSTALL_DETAILS_H_ 184 #endif // CHROME_INSTALL_STATIC_INSTALL_DETAILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698