| 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_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CONTENT_CONDITION_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CONTENT_CONDITION_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CONTENT_CONDITION_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CONTENT_CONDITION_H_ |
| 7 | 7 |
| 8 #include <map> | |
| 9 #include <set> | 8 #include <set> |
| 10 #include <string> | 9 #include <string> |
| 11 #include <vector> | 10 #include <vector> |
| 12 | 11 |
| 13 #include "base/containers/hash_tables.h" | 12 #include "base/containers/hash_tables.h" |
| 14 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 15 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/values.h" | |
| 17 #include "components/url_matcher/url_matcher.h" | 15 #include "components/url_matcher/url_matcher.h" |
| 18 #include "extensions/browser/api/declarative/declarative_rule.h" | 16 |
| 17 namespace base { |
| 18 class Value; |
| 19 } |
| 19 | 20 |
| 20 namespace extensions { | 21 namespace extensions { |
| 21 | 22 |
| 23 class Extension; |
| 24 |
| 22 struct RendererContentMatchData { | 25 struct RendererContentMatchData { |
| 23 RendererContentMatchData(); | 26 RendererContentMatchData(); |
| 24 ~RendererContentMatchData(); | 27 ~RendererContentMatchData(); |
| 25 // Match IDs for the URL of the top-level page the renderer is | 28 // Match IDs for the URL of the top-level page the renderer is |
| 26 // returning data for. | 29 // returning data for. |
| 27 std::set<url_matcher::URLMatcherConditionSet::ID> page_url_matches; | 30 std::set<url_matcher::URLMatcherConditionSet::ID> page_url_matches; |
| 28 // All watched CSS selectors that match on frames with the same | 31 // All watched CSS selectors that match on frames with the same |
| 29 // origin as the page's main frame. | 32 // origin as the page's main frame. |
| 30 base::hash_set<std::string> css_selectors; | 33 base::hash_set<std::string> css_selectors; |
| 31 }; | 34 }; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 return css_selectors_; | 101 return css_selectors_; |
| 99 } | 102 } |
| 100 | 103 |
| 101 private: | 104 private: |
| 102 scoped_refptr<url_matcher::URLMatcherConditionSet> url_matcher_conditions_; | 105 scoped_refptr<url_matcher::URLMatcherConditionSet> url_matcher_conditions_; |
| 103 std::vector<std::string> css_selectors_; | 106 std::vector<std::string> css_selectors_; |
| 104 | 107 |
| 105 DISALLOW_COPY_AND_ASSIGN(ContentCondition); | 108 DISALLOW_COPY_AND_ASSIGN(ContentCondition); |
| 106 }; | 109 }; |
| 107 | 110 |
| 108 typedef DeclarativeConditionSet<ContentCondition> ContentConditionSet; | |
| 109 | |
| 110 } // namespace extensions | 111 } // namespace extensions |
| 111 | 112 |
| 112 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CONTENT_CONDITION_H
_ | 113 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CONTENT_CONDITION_H
_ |
| OLD | NEW |