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 |
11 #include "base/memory/linked_ptr.h" | |
12 #include "base/memory/scoped_ptr.h" | |
13 #include "chrome/browser/local_discovery/privet_device_lister.h" | 11 #include "chrome/browser/local_discovery/privet_device_lister.h" |
14 #include "chrome/browser/local_discovery/privet_device_lister_impl.h" | |
15 #include "chrome/browser/local_discovery/privet_http.h" | 12 #include "chrome/browser/local_discovery/privet_http.h" |
16 #include "chrome/browser/local_discovery/privet_http_asynchronous_factory.h" | |
17 #include "chrome/browser/local_discovery/service_discovery_host_client.h" | |
18 #include "chrome/browser/notifications/notification_delegate.h" | 13 #include "chrome/browser/notifications/notification_delegate.h" |
19 #include "chrome/browser/notifications/notification_ui_manager.h" | |
20 #include "components/browser_context_keyed_service/browser_context_keyed_service
.h" | 14 #include "components/browser_context_keyed_service/browser_context_keyed_service
.h" |
21 #include "ui/message_center/notification_delegate.h" | 15 |
| 16 class NotificationUIManager; |
22 | 17 |
23 namespace content { | 18 namespace content { |
24 class BrowserContext; | 19 class BrowserContext; |
25 } // namespace content | 20 } // namespace content |
26 | 21 |
27 namespace local_discovery { | 22 namespace local_discovery { |
28 | 23 |
| 24 class PrivetDeviceLister; |
| 25 class PrivetHTTPAsynchronousFactory; |
| 26 class PrivetHTTPResolution; |
| 27 class ServiceDiscoveryHostClient; |
| 28 struct DeviceDescription; |
| 29 |
29 // Contains logic related to notifications not tied actually displaying them. | 30 // Contains logic related to notifications not tied actually displaying them. |
30 class PrivetNotificationsListener : public PrivetInfoOperation::Delegate { | 31 class PrivetNotificationsListener : public PrivetInfoOperation::Delegate { |
31 public: | 32 public: |
32 class Delegate { | 33 class Delegate { |
33 public: | 34 public: |
34 virtual ~Delegate() {} | 35 virtual ~Delegate() {} |
35 | 36 |
36 // Notify user of the existence of device |device_name|. | 37 // Notify user of the existence of device |device_name|. |
37 virtual void PrivetNotify(const std::string& device_name, | 38 virtual void PrivetNotify(const std::string& device_name, |
38 const std::string& human_readable_name, | 39 const std::string& human_readable_name, |
(...skipping 26 matching lines...) Expand all Loading... |
65 private: | 66 private: |
66 struct DeviceContext { | 67 struct DeviceContext { |
67 DeviceContext(); | 68 DeviceContext(); |
68 ~DeviceContext(); | 69 ~DeviceContext(); |
69 | 70 |
70 bool notification_may_be_active; | 71 bool notification_may_be_active; |
71 bool registered; | 72 bool registered; |
72 std::string human_readable_name; | 73 std::string human_readable_name; |
73 std::string description; | 74 std::string description; |
74 scoped_ptr<PrivetInfoOperation> info_operation; | 75 scoped_ptr<PrivetInfoOperation> info_operation; |
75 scoped_ptr<PrivetHTTPAsynchronousFactory::Resolution> | 76 scoped_ptr<PrivetHTTPResolution> privet_http_resolution; |
76 privet_http_resolution; | |
77 scoped_ptr<PrivetHTTPClient> privet_http; | 77 scoped_ptr<PrivetHTTPClient> privet_http; |
78 }; | 78 }; |
79 | 79 |
80 typedef std::map<std::string, linked_ptr<DeviceContext> > DeviceContextMap; | 80 typedef std::map<std::string, linked_ptr<DeviceContext> > DeviceContextMap; |
81 | 81 |
82 void CreateInfoOperation(scoped_ptr<PrivetHTTPClient> http_client); | 82 void CreateInfoOperation(scoped_ptr<PrivetHTTPClient> http_client); |
83 | 83 |
84 Delegate* delegate_; | 84 Delegate* delegate_; |
85 scoped_ptr<PrivetDeviceLister> device_lister_; | 85 scoped_ptr<PrivetDeviceLister> device_lister_; |
86 scoped_ptr<PrivetHTTPAsynchronousFactory> privet_http_factory_; | 86 scoped_ptr<PrivetHTTPAsynchronousFactory> privet_http_factory_; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 138 |
139 virtual ~PrivetNotificationDelegate(); | 139 virtual ~PrivetNotificationDelegate(); |
140 | 140 |
141 std::string device_id_; | 141 std::string device_id_; |
142 content::BrowserContext* profile_; | 142 content::BrowserContext* profile_; |
143 }; | 143 }; |
144 | 144 |
145 } // namespace local_discovery | 145 } // namespace local_discovery |
146 | 146 |
147 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_NOTIFICATIONS_H_ | 147 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_NOTIFICATIONS_H_ |
OLD | NEW |