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
3 // found in the LICENSE file.
5 #ifndef CHROME_COMMON_EXTENSIONS_FEATURES_CHROME_CHANNEL_FEATURE_FILTER_H_
6 #define CHROME_COMMON_EXTENSIONS_FEATURES_CHROME_CHANNEL_FEATURE_FILTER_H_
8 #include "chrome/common/chrome_version_info.h"
9 #include "extensions/common/features/simple_feature_filter.h"
11 namespace extensions {
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.
15 class ChromeChannelFeatureFilter : public SimpleFeatureFilter {
17 explicit ChromeChannelFeatureFilter(SimpleFeature* feature);
18 virtual ~ChromeChannelFeatureFilter();
20 // SimpleFeatureFilter implementation.
21 virtual std::string Parse(const base::DictionaryValue* value) OVERRIDE;
22 virtual Feature::Availability IsAvailableToManifest(
23 const std::string& extension_id,
25 Manifest::Location location,
27 Feature::Platform platform) const OVERRIDE;
30 bool channel_has_been_set_;
31 chrome::VersionInfo::Channel channel_;
34 } // namespace extensions
36 #endif // CHROME_COMMON_EXTENSIONS_FEATURES_CHROME_CHANNEL_FEATURE_FILTER_H_