OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CONTENT_PREDICATE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CONTENT_PREDICATE_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CONTENT_PREDICATE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CONTENT_PREDICATE_H_ |
7 | 7 |
| 8 #include <memory> |
8 #include <string> | 9 #include <string> |
9 | 10 |
10 #include "base/macros.h" | 11 #include "base/macros.h" |
11 #include "base/memory/scoped_ptr.h" | |
12 | 12 |
13 namespace base { | 13 namespace base { |
14 class Value; | 14 class Value; |
15 } | 15 } |
16 | 16 |
17 namespace extensions { | 17 namespace extensions { |
18 | 18 |
19 class ContentPredicateEvaluator; | 19 class ContentPredicateEvaluator; |
20 class Extension; | 20 class Extension; |
21 | 21 |
(...skipping 30 matching lines...) Expand all Loading... |
52 // https://developer.chrome.com/extensions/declarativeContent#rules, | 52 // https://developer.chrome.com/extensions/declarativeContent#rules, |
53 // ContentPredicateFactories are directly responsible for creating individual | 53 // ContentPredicateFactories are directly responsible for creating individual |
54 // predicates from the { hostEquals: 'www.google.com', schemes: ['https'] } and | 54 // predicates from the { hostEquals: 'www.google.com', schemes: ['https'] } and |
55 // ["input[type='password']"] JSON entities encoded in |value|. | 55 // ["input[type='password']"] JSON entities encoded in |value|. |
56 class ContentPredicateFactory { | 56 class ContentPredicateFactory { |
57 public: | 57 public: |
58 virtual ~ContentPredicateFactory(); | 58 virtual ~ContentPredicateFactory(); |
59 | 59 |
60 // Creates a new predicate from |value|, as specified in the declarative | 60 // Creates a new predicate from |value|, as specified in the declarative |
61 // API. Sets *|error| and returns null if creation failed for any reason. | 61 // API. Sets *|error| and returns null if creation failed for any reason. |
62 virtual scoped_ptr<const ContentPredicate> CreatePredicate( | 62 virtual std::unique_ptr<const ContentPredicate> CreatePredicate( |
63 const Extension* extension, | 63 const Extension* extension, |
64 const base::Value& value, | 64 const base::Value& value, |
65 std::string* error) = 0; | 65 std::string* error) = 0; |
66 | 66 |
67 protected: | 67 protected: |
68 ContentPredicateFactory(); | 68 ContentPredicateFactory(); |
69 | 69 |
70 private: | 70 private: |
71 DISALLOW_COPY_AND_ASSIGN(ContentPredicateFactory); | 71 DISALLOW_COPY_AND_ASSIGN(ContentPredicateFactory); |
72 }; | 72 }; |
73 | 73 |
74 } // namespace extensions | 74 } // namespace extensions |
75 | 75 |
76 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CONTENT_PREDICATE_H
_ | 76 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CONTENT_PREDICATE_H
_ |
OLD | NEW |