| 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_SIMPLE_FEATURE_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_FEATURES_SIMPLE_FEATURE_H_ |
| 6 #define CHROME_COMMON_EXTENSIONS_FEATURES_SIMPLE_FEATURE_H_ | 6 #define CHROME_COMMON_EXTENSIONS_FEATURES_SIMPLE_FEATURE_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 const GURL& url, | 80 const GURL& url, |
| 81 Platform platform) const OVERRIDE; | 81 Platform platform) const OVERRIDE; |
| 82 | 82 |
| 83 virtual std::string GetAvailabilityMessage(AvailabilityResult result, | 83 virtual std::string GetAvailabilityMessage(AvailabilityResult result, |
| 84 Manifest::Type type, | 84 Manifest::Type type, |
| 85 const GURL& url) const OVERRIDE; | 85 const GURL& url) const OVERRIDE; |
| 86 | 86 |
| 87 virtual std::set<Context>* GetContexts() OVERRIDE; | 87 virtual std::set<Context>* GetContexts() OVERRIDE; |
| 88 | 88 |
| 89 virtual bool IsInternal() const OVERRIDE; | 89 virtual bool IsInternal() const OVERRIDE; |
| 90 virtual bool HasParent() const OVERRIDE; |
| 91 virtual void SetHasParent(bool has_parent) OVERRIDE; |
| 90 | 92 |
| 91 virtual bool IsIdInWhitelist(const std::string& extension_id) const OVERRIDE; | 93 virtual bool IsIdInWhitelist(const std::string& extension_id) const OVERRIDE; |
| 92 | 94 |
| 93 protected: | 95 protected: |
| 94 Availability CreateAvailability(AvailabilityResult result) const; | 96 Availability CreateAvailability(AvailabilityResult result) const; |
| 95 Availability CreateAvailability(AvailabilityResult result, | 97 Availability CreateAvailability(AvailabilityResult result, |
| 96 Manifest::Type type) const; | 98 Manifest::Type type) const; |
| 97 Availability CreateAvailability(AvailabilityResult result, | 99 Availability CreateAvailability(AvailabilityResult result, |
| 98 const GURL& url) const; | 100 const GURL& url) const; |
| 99 | 101 |
| 100 private: | 102 private: |
| 101 // For clarity and consistency, we handle the default value of each of these | 103 // For clarity and consistency, we handle the default value of each of these |
| 102 // members the same way: it matches everything. It is up to the higher level | 104 // members the same way: it matches everything. It is up to the higher level |
| 103 // code that reads Features out of static data to validate that data and set | 105 // code that reads Features out of static data to validate that data and set |
| 104 // sensible defaults. | 106 // sensible defaults. |
| 105 std::set<std::string> whitelist_; | 107 std::set<std::string> whitelist_; |
| 106 std::set<Manifest::Type> extension_types_; | 108 std::set<Manifest::Type> extension_types_; |
| 107 std::set<Context> contexts_; | 109 std::set<Context> contexts_; |
| 108 URLPatternSet matches_; | 110 URLPatternSet matches_; |
| 109 Location location_; // we only care about component/not-component now | 111 Location location_; // we only care about component/not-component now |
| 110 Platform platform_; // we only care about chromeos/not-chromeos now | 112 Platform platform_; // we only care about chromeos/not-chromeos now |
| 111 int min_manifest_version_; | 113 int min_manifest_version_; |
| 112 int max_manifest_version_; | 114 int max_manifest_version_; |
| 113 chrome::VersionInfo::Channel channel_; | 115 chrome::VersionInfo::Channel channel_; |
| 116 bool has_parent_; |
| 117 bool channel_has_been_set_; |
| 114 | 118 |
| 115 FRIEND_TEST_ALL_PREFIXES(ExtensionSimpleFeatureTest, Context); | 119 FRIEND_TEST_ALL_PREFIXES(ExtensionSimpleFeatureTest, Context); |
| 116 }; | 120 }; |
| 117 | 121 |
| 118 } // namespace extensions | 122 } // namespace extensions |
| 119 | 123 |
| 120 #endif // CHROME_COMMON_EXTENSIONS_FEATURES_SIMPLE_FEATURE_H_ | 124 #endif // CHROME_COMMON_EXTENSIONS_FEATURES_SIMPLE_FEATURE_H_ |
| OLD | NEW |