| 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 EXTENSIONS_COMMON_EVENT_FILTERING_INFO_H_ | 5 #ifndef EXTENSIONS_COMMON_EVENT_FILTERING_INFO_H_ |
| 6 #define EXTENSIONS_COMMON_EVENT_FILTERING_INFO_H_ | 6 #define EXTENSIONS_COMMON_EVENT_FILTERING_INFO_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "url/gurl.h" | 10 #include "url/gurl.h" |
| 11 | 11 |
| 12 namespace base { | 12 namespace base { |
| 13 class DictionaryValue; | 13 class DictionaryValue; |
| 14 } | 14 } |
| 15 | 15 |
| 16 namespace extensions { | 16 namespace extensions { |
| 17 | 17 |
| 18 // Extra information about an event that is used in event filtering. | 18 // Extra information about an event that is used in event filtering. |
| 19 // | 19 // |
| 20 // This is the information that is matched against criteria specified in JS | 20 // This is the information that is matched against criteria specified in JS |
| 21 // extension event listeners. Eg: | 21 // extension event listeners. Eg: |
| 22 // | 22 // |
| 23 // chrome.someApi.onSomeEvent.addListener(cb, | 23 // chrome.someApi.onSomeEvent.addListener(cb, |
| 24 // {url: [{hostSuffix: 'google.com'}], | 24 // {url: [{hostSuffix: 'google.com'}], |
| 25 // tabId: 1}); | 25 // tabId: 1}); |
| 26 class EventFilteringInfo { | 26 class EventFilteringInfo { |
| 27 public: | 27 public: |
| 28 EventFilteringInfo(); | 28 EventFilteringInfo(); |
| 29 explicit EventFilteringInfo(const base::DictionaryValue& dict); |
| 29 EventFilteringInfo(const EventFilteringInfo& other); | 30 EventFilteringInfo(const EventFilteringInfo& other); |
| 30 ~EventFilteringInfo(); | 31 ~EventFilteringInfo(); |
| 31 void SetWindowExposedByDefault(bool exposed); | 32 void SetWindowExposedByDefault(bool exposed); |
| 32 void SetWindowType(const std::string& window_type); | 33 void SetWindowType(const std::string& window_type); |
| 33 void SetURL(const GURL& url); | 34 void SetURL(const GURL& url); |
| 34 void SetInstanceID(int instance_id); | 35 void SetInstanceID(int instance_id); |
| 35 void SetServiceType(const std::string& service_type) { | 36 void SetServiceType(const std::string& service_type) { |
| 36 service_type_ = service_type; | 37 service_type_ = service_type; |
| 37 } | 38 } |
| 38 | 39 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 | 76 |
| 76 bool has_window_exposed_by_default_; | 77 bool has_window_exposed_by_default_; |
| 77 bool window_exposed_by_default_; | 78 bool window_exposed_by_default_; |
| 78 | 79 |
| 79 // Allow implicit copy and assignment. | 80 // Allow implicit copy and assignment. |
| 80 }; | 81 }; |
| 81 | 82 |
| 82 } // namespace extensions | 83 } // namespace extensions |
| 83 | 84 |
| 84 #endif // EXTENSIONS_COMMON_EVENT_FILTERING_INFO_H_ | 85 #endif // EXTENSIONS_COMMON_EVENT_FILTERING_INFO_H_ |
| OLD | NEW |