OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_COMMON_EXTENSIONS_FEATURES_FEATURE_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_FEATURES_FEATURE_H_ |
6 #define CHROME_COMMON_EXTENSIONS_FEATURES_FEATURE_H_ | 6 #define CHROME_COMMON_EXTENSIONS_FEATURES_FEATURE_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 // See http://crbug.com/126535. | 74 // See http://crbug.com/126535. |
75 static void SetChannelCheckingEnabled(bool enabled); | 75 static void SetChannelCheckingEnabled(bool enabled); |
76 static void ResetChannelCheckingEnabled(); | 76 static void ResetChannelCheckingEnabled(); |
77 | 77 |
78 // (Re)Sets the Channel to for all Features to compare against. This is | 78 // (Re)Sets the Channel to for all Features to compare against. This is |
79 // usually chrome::VersionInfo::GetChannel(), but for tests allow this to be | 79 // usually chrome::VersionInfo::GetChannel(), but for tests allow this to be |
80 // overridden. | 80 // overridden. |
81 static void SetChannelForTesting(chrome::VersionInfo::Channel channel); | 81 static void SetChannelForTesting(chrome::VersionInfo::Channel channel); |
82 static void ResetChannelForTesting(); | 82 static void ResetChannelForTesting(); |
83 | 83 |
| 84 // Returns the current channel as seen by the Feature system (i.e. the |
| 85 // ChannelForTesting if one is set, otherwise the actual channel). |
| 86 static chrome::VersionInfo::Channel GetCurrentChannel(); |
| 87 |
84 const std::string& name() const { return name_; } | 88 const std::string& name() const { return name_; } |
85 void set_name(const std::string& name) { name_ = name; } | 89 void set_name(const std::string& name) { name_ = name; } |
86 | 90 |
87 // Gets the platform the code is currently running on. | 91 // Gets the platform the code is currently running on. |
88 static Platform GetCurrentPlatform(); | 92 static Platform GetCurrentPlatform(); |
89 | 93 |
90 // Gets the Feature::Location value for the specified Extension::Location. | 94 // Gets the Feature::Location value for the specified Extension::Location. |
91 static Location ConvertLocation(Extension::Location extension_location); | 95 static Location ConvertLocation(Extension::Location extension_location); |
92 | 96 |
93 std::set<std::string>* whitelist() { return &whitelist_; } | 97 std::set<std::string>* whitelist() { return &whitelist_; } |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 Location location_; // we only care about component/not-component now | 163 Location location_; // we only care about component/not-component now |
160 Platform platform_; // we only care about chromeos/not-chromeos now | 164 Platform platform_; // we only care about chromeos/not-chromeos now |
161 int min_manifest_version_; | 165 int min_manifest_version_; |
162 int max_manifest_version_; | 166 int max_manifest_version_; |
163 chrome::VersionInfo::Channel channel_; | 167 chrome::VersionInfo::Channel channel_; |
164 }; | 168 }; |
165 | 169 |
166 } // namespace extensions | 170 } // namespace extensions |
167 | 171 |
168 #endif // CHROME_COMMON_EXTENSIONS_FEATURES_FEATURE_H_ | 172 #endif // CHROME_COMMON_EXTENSIONS_FEATURES_FEATURE_H_ |
OLD | NEW |