OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_CHROME_CHANNEL_FEATURE_FILTER_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_FEATURES_CHROME_CHANNEL_FEATURE_FILTER_H_ |
6 #define CHROME_COMMON_EXTENSIONS_FEATURES_CHROME_CHANNEL_FEATURE_FILTER_H_ | 6 #define CHROME_COMMON_EXTENSIONS_FEATURES_CHROME_CHANNEL_FEATURE_FILTER_H_ |
7 | 7 |
8 #include "chrome/common/chrome_version_info.h" | 8 #include "chrome/common/chrome_version_info.h" |
9 #include "extensions/common/features/simple_feature_filter.h" | 9 #include "extensions/common/features/simple_feature_filter.h" |
10 | 10 |
11 namespace extensions { | 11 namespace extensions { |
12 | 12 |
13 // This filter parses a "channel" key from feature value data and makes features | 13 // This filter parses a "channel" key from feature value data and makes features |
14 // unavailable if they aren't stable enough for the current channel. | 14 // unavailable if they aren't stable enough for the current channel. |
15 class ChromeChannelFeatureFilter : public SimpleFeatureFilter { | 15 class ChromeChannelFeatureFilter : public SimpleFeatureFilter { |
16 public: | 16 public: |
17 explicit ChromeChannelFeatureFilter(SimpleFeature* feature); | 17 explicit ChromeChannelFeatureFilter(SimpleFeature* feature); |
18 virtual ~ChromeChannelFeatureFilter(); | 18 virtual ~ChromeChannelFeatureFilter(); |
19 | 19 |
20 // SimpleFeatureFilter implementation. | 20 // SimpleFeatureFilter implementation. |
21 virtual std::string Parse(const base::DictionaryValue* value) OVERRIDE; | 21 virtual std::string Parse(const base::DictionaryValue* value) override; |
22 virtual Feature::Availability IsAvailableToManifest( | 22 virtual Feature::Availability IsAvailableToManifest( |
23 const std::string& extension_id, | 23 const std::string& extension_id, |
24 Manifest::Type type, | 24 Manifest::Type type, |
25 Manifest::Location location, | 25 Manifest::Location location, |
26 int manifest_version, | 26 int manifest_version, |
27 Feature::Platform platform) const OVERRIDE; | 27 Feature::Platform platform) const override; |
28 | 28 |
29 private: | 29 private: |
30 bool channel_has_been_set_; | 30 bool channel_has_been_set_; |
31 chrome::VersionInfo::Channel channel_; | 31 chrome::VersionInfo::Channel channel_; |
32 }; | 32 }; |
33 | 33 |
34 } // namespace extensions | 34 } // namespace extensions |
35 | 35 |
36 #endif // CHROME_COMMON_EXTENSIONS_FEATURES_CHROME_CHANNEL_FEATURE_FILTER_H_ | 36 #endif // CHROME_COMMON_EXTENSIONS_FEATURES_CHROME_CHANNEL_FEATURE_FILTER_H_ |
OLD | NEW |