| 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 Value; | 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, |
| (...skipping 29 matching lines...) Expand all Loading... |
| 53 | 53 |
| 54 bool has_url() const { return has_url_; } | 54 bool has_url() const { return has_url_; } |
| 55 const GURL& url() const { return url_; } | 55 const GURL& url() const { return url_; } |
| 56 | 56 |
| 57 bool has_instance_id() const { return has_instance_id_; } | 57 bool has_instance_id() const { return has_instance_id_; } |
| 58 int instance_id() const { return instance_id_; } | 58 int instance_id() const { return instance_id_; } |
| 59 | 59 |
| 60 bool has_service_type() const { return !service_type_.empty(); } | 60 bool has_service_type() const { return !service_type_.empty(); } |
| 61 const std::string& service_type() const { return service_type_; } | 61 const std::string& service_type() const { return service_type_; } |
| 62 | 62 |
| 63 std::unique_ptr<base::Value> AsValue() const; | 63 std::unique_ptr<base::DictionaryValue> AsValue() const; |
| 64 bool IsEmpty() const; | |
| 65 | 64 |
| 66 private: | 65 private: |
| 67 bool has_url_; | 66 bool has_url_; |
| 68 GURL url_; | 67 GURL url_; |
| 69 std::string service_type_; | 68 std::string service_type_; |
| 70 | 69 |
| 71 bool has_instance_id_; | 70 bool has_instance_id_; |
| 72 int instance_id_; | 71 int instance_id_; |
| 73 | 72 |
| 74 bool has_window_type_; | 73 bool has_window_type_; |
| 75 std::string window_type_; | 74 std::string window_type_; |
| 76 | 75 |
| 77 bool has_window_exposed_by_default_; | 76 bool has_window_exposed_by_default_; |
| 78 bool window_exposed_by_default_; | 77 bool window_exposed_by_default_; |
| 79 | 78 |
| 80 // Allow implicit copy and assignment. | 79 // Allow implicit copy and assignment. |
| 81 }; | 80 }; |
| 82 | 81 |
| 83 } // namespace extensions | 82 } // namespace extensions |
| 84 | 83 |
| 85 #endif // EXTENSIONS_COMMON_EVENT_FILTERING_INFO_H_ | 84 #endif // EXTENSIONS_COMMON_EVENT_FILTERING_INFO_H_ |
| OLD | NEW |