Chromium Code Reviews| 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 "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "url/gurl.h" | 9 #include "url/gurl.h" |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 21 // | 21 // |
| 22 // chrome.someApi.onSomeEvent.addListener(cb, | 22 // chrome.someApi.onSomeEvent.addListener(cb, |
| 23 // {url: [{hostSuffix: 'google.com'}], | 23 // {url: [{hostSuffix: 'google.com'}], |
| 24 // tabId: 1}); | 24 // tabId: 1}); |
| 25 class EventFilteringInfo { | 25 class EventFilteringInfo { |
| 26 public: | 26 public: |
| 27 EventFilteringInfo(); | 27 EventFilteringInfo(); |
| 28 ~EventFilteringInfo(); | 28 ~EventFilteringInfo(); |
| 29 void SetURL(const GURL& url); | 29 void SetURL(const GURL& url); |
| 30 void SetInstanceID(int instance_id); | 30 void SetInstanceID(int instance_id); |
| 31 void SetServiceType(const std::string& service_type) { | |
| 32 service_type_ = service_type; | |
| 33 } | |
| 31 | 34 |
| 32 bool has_url() const { return has_url_; } | 35 bool has_url() const { return has_url_; } |
| 33 const GURL& url() const { return url_; } | 36 const GURL& url() const { return url_; } |
| 34 | 37 |
| 35 bool has_instance_id() const { return has_instance_id_; } | 38 bool has_instance_id() const { return has_instance_id_; } |
| 36 int instance_id() const { return instance_id_; } | 39 int instance_id() const { return instance_id_; } |
| 37 | 40 |
| 41 const std::string &service_type() const { return service_type_; } | |
|
Matt Perry
2013/09/05 20:14:18
nit: space after &, not before.
Matt Perry
2013/09/05 20:14:18
I'd also add a has_service_type() that just checks
justinlin
2013/09/05 21:44:04
Done.
justinlin
2013/09/05 21:44:04
Done.
| |
| 42 | |
| 38 scoped_ptr<base::Value> AsValue() const; | 43 scoped_ptr<base::Value> AsValue() const; |
| 39 bool IsEmpty() const; | 44 bool IsEmpty() const; |
| 40 | 45 |
| 41 private: | 46 private: |
| 42 bool has_url_; | 47 bool has_url_; |
| 43 GURL url_; | 48 GURL url_; |
| 49 std::string service_type_; | |
| 44 | 50 |
| 45 bool has_instance_id_; | 51 bool has_instance_id_; |
| 46 int instance_id_; | 52 int instance_id_; |
| 47 | 53 |
| 48 // Allow implicit copy and assignment. | 54 // Allow implicit copy and assignment. |
| 49 }; | 55 }; |
| 50 | 56 |
| 51 } // namespace extensions | 57 } // namespace extensions |
| 52 | 58 |
| 53 #endif // EXTENSIONS_COMMON_EVENT_FILTERING_INFO_H_ | 59 #endif // EXTENSIONS_COMMON_EVENT_FILTERING_INFO_H_ |
| OLD | NEW |