| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_LOCAL_DISCOVERY_PRIVET_NOTIFICATIONS_H_ | 5 #ifndef CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_NOTIFICATIONS_H_ |
| 6 #define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_NOTIFICATIONS_H_ | 6 #define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_NOTIFICATIONS_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 Delegate* delegate); | 47 Delegate* delegate); |
| 48 virtual ~PrivetNotificationsListener(); | 48 virtual ~PrivetNotificationsListener(); |
| 49 | 49 |
| 50 // These two methods are akin to those of PrivetDeviceLister::Delegate. The | 50 // These two methods are akin to those of PrivetDeviceLister::Delegate. The |
| 51 // user of PrivetNotificationListener should create a PrivetDeviceLister and | 51 // user of PrivetNotificationListener should create a PrivetDeviceLister and |
| 52 // forward device notifications to the PrivetNotificationLister. | 52 // forward device notifications to the PrivetNotificationLister. |
| 53 void DeviceChanged(bool added, | 53 void DeviceChanged(bool added, |
| 54 const std::string& name, | 54 const std::string& name, |
| 55 const DeviceDescription& description); | 55 const DeviceDescription& description); |
| 56 void DeviceRemoved(const std::string& name); | 56 void DeviceRemoved(const std::string& name); |
| 57 virtual void DeviceCacheFlushed(); |
| 57 | 58 |
| 58 // PrivetInfoOperation::Delegate implementation. | 59 // PrivetInfoOperation::Delegate implementation. |
| 59 virtual void OnPrivetInfoDone( | 60 virtual void OnPrivetInfoDone( |
| 60 PrivetInfoOperation* operation, | 61 PrivetInfoOperation* operation, |
| 61 int http_code, | 62 int http_code, |
| 62 const base::DictionaryValue* json_value) OVERRIDE; | 63 const base::DictionaryValue* json_value) OVERRIDE; |
| 63 | 64 |
| 64 private: | 65 private: |
| 65 struct DeviceContext { | 66 struct DeviceContext { |
| 66 DeviceContext(); | 67 DeviceContext(); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 const DeviceDescription& description) OVERRIDE; | 102 const DeviceDescription& description) OVERRIDE; |
| 102 virtual void DeviceRemoved(const std::string& name) OVERRIDE; | 103 virtual void DeviceRemoved(const std::string& name) OVERRIDE; |
| 103 | 104 |
| 104 // PrivetNotificationListener::Delegate implementation: | 105 // PrivetNotificationListener::Delegate implementation: |
| 105 virtual void PrivetNotify(const std::string& device_name, | 106 virtual void PrivetNotify(const std::string& device_name, |
| 106 const std::string& human_readable_name, | 107 const std::string& human_readable_name, |
| 107 const std::string& description) OVERRIDE; | 108 const std::string& description) OVERRIDE; |
| 108 | 109 |
| 109 virtual void PrivetRemoveNotification( | 110 virtual void PrivetRemoveNotification( |
| 110 const std::string& device_name) OVERRIDE; | 111 const std::string& device_name) OVERRIDE; |
| 112 virtual void DeviceCacheFlushed() OVERRIDE; |
| 113 |
| 111 private: | 114 private: |
| 112 void Start(); | 115 void Start(); |
| 113 | 116 |
| 114 content::BrowserContext* profile_; | 117 content::BrowserContext* profile_; |
| 115 NotificationUIManager* notification_manager_; | 118 NotificationUIManager* notification_manager_; |
| 116 scoped_ptr<PrivetDeviceLister> device_lister_; | 119 scoped_ptr<PrivetDeviceLister> device_lister_; |
| 117 scoped_refptr<ServiceDiscoveryHostClient> service_discovery_client_; | 120 scoped_refptr<ServiceDiscoveryHostClient> service_discovery_client_; |
| 118 scoped_ptr<PrivetNotificationsListener> privet_notifications_listener_; | 121 scoped_ptr<PrivetNotificationsListener> privet_notifications_listener_; |
| 119 }; | 122 }; |
| 120 | 123 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 137 | 140 |
| 138 virtual ~PrivetNotificationDelegate(); | 141 virtual ~PrivetNotificationDelegate(); |
| 139 | 142 |
| 140 std::string device_id_; | 143 std::string device_id_; |
| 141 content::BrowserContext* profile_; | 144 content::BrowserContext* profile_; |
| 142 }; | 145 }; |
| 143 | 146 |
| 144 } // namespace local_discovery | 147 } // namespace local_discovery |
| 145 | 148 |
| 146 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_NOTIFICATIONS_H_ | 149 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_NOTIFICATIONS_H_ |
| OLD | NEW |