| 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_PRINTING_CLOUD_PRINT_PRIVET_NOTIFICATIONS_H_ |
| 6 #define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_NOTIFICATIONS_H_ | 6 #define CHROME_BROWSER_PRINTING_CLOUD_PRINT_PRIVET_NOTIFICATIONS_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/prefs/pref_member.h" | 11 #include "base/prefs/pref_member.h" |
| 12 #include "chrome/browser/local_discovery/privet_device_lister.h" | |
| 13 #include "chrome/browser/local_discovery/privet_http.h" | |
| 14 #include "chrome/browser/notifications/notification_delegate.h" | 12 #include "chrome/browser/notifications/notification_delegate.h" |
| 13 #include "chrome/browser/printing/cloud_print/privet_device_lister.h" |
| 14 #include "chrome/browser/printing/cloud_print/privet_http.h" |
| 15 #include "components/keyed_service/core/keyed_service.h" | 15 #include "components/keyed_service/core/keyed_service.h" |
| 16 | 16 |
| 17 class NotificationUIManager; | 17 class NotificationUIManager; |
| 18 | 18 |
| 19 namespace content { | 19 namespace content { |
| 20 class BrowserContext; | 20 class BrowserContext; |
| 21 } // namespace content | 21 } |
| 22 | 22 |
| 23 namespace local_discovery { | 23 namespace local_discovery { |
| 24 class ServiceDiscoverySharedClient; |
| 25 } |
| 24 | 26 |
| 25 class ServiceDiscoverySharedClient; | 27 namespace cloud_print { |
| 28 |
| 26 class PrivetDeviceLister; | 29 class PrivetDeviceLister; |
| 27 class PrivetHTTPAsynchronousFactory; | 30 class PrivetHTTPAsynchronousFactory; |
| 28 class PrivetHTTPResolution; | 31 class PrivetHTTPResolution; |
| 29 struct DeviceDescription; | 32 struct DeviceDescription; |
| 30 | 33 |
| 31 #if defined(ENABLE_MDNS) | 34 #if defined(ENABLE_MDNS) |
| 32 class PrivetTrafficDetector; | 35 class PrivetTrafficDetector; |
| 33 #endif // ENABLE_MDNS | 36 #endif // ENABLE_MDNS |
| 34 | 37 |
| 35 // Contains logic related to notifications not tied actually displaying them. | 38 // Contains logic related to notifications not tied actually displaying them. |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 static bool IsEnabled(); | 115 static bool IsEnabled(); |
| 113 static bool IsForced(); | 116 static bool IsForced(); |
| 114 | 117 |
| 115 private: | 118 private: |
| 116 void Start(); | 119 void Start(); |
| 117 void OnNotificationsEnabledChanged(); | 120 void OnNotificationsEnabledChanged(); |
| 118 void StartLister(); | 121 void StartLister(); |
| 119 | 122 |
| 120 content::BrowserContext* profile_; | 123 content::BrowserContext* profile_; |
| 121 scoped_ptr<PrivetDeviceLister> device_lister_; | 124 scoped_ptr<PrivetDeviceLister> device_lister_; |
| 122 scoped_refptr<ServiceDiscoverySharedClient> service_discovery_client_; | 125 scoped_refptr<local_discovery::ServiceDiscoverySharedClient> |
| 126 service_discovery_client_; |
| 123 scoped_ptr<PrivetNotificationsListener> privet_notifications_listener_; | 127 scoped_ptr<PrivetNotificationsListener> privet_notifications_listener_; |
| 124 BooleanPrefMember enable_privet_notification_member_; | 128 BooleanPrefMember enable_privet_notification_member_; |
| 125 | 129 |
| 126 #if defined(ENABLE_MDNS) | 130 #if defined(ENABLE_MDNS) |
| 127 scoped_refptr<PrivetTrafficDetector> traffic_detector_; | 131 scoped_refptr<PrivetTrafficDetector> traffic_detector_; |
| 128 #endif // ENABLE_MDNS | 132 #endif // ENABLE_MDNS |
| 129 }; | 133 }; |
| 130 | 134 |
| 131 class PrivetNotificationDelegate : public NotificationDelegate { | 135 class PrivetNotificationDelegate : public NotificationDelegate { |
| 132 public: | 136 public: |
| 133 explicit PrivetNotificationDelegate(content::BrowserContext* profile); | 137 explicit PrivetNotificationDelegate(content::BrowserContext* profile); |
| 134 | 138 |
| 135 // NotificationDelegate implementation. | 139 // NotificationDelegate implementation. |
| 136 std::string id() const override; | 140 std::string id() const override; |
| 137 void ButtonClick(int button_index) override; | 141 void ButtonClick(int button_index) override; |
| 138 | 142 |
| 139 private: | 143 private: |
| 140 void OpenTab(const GURL& url); | 144 void OpenTab(const GURL& url); |
| 141 void DisableNotifications(); | 145 void DisableNotifications(); |
| 142 | 146 |
| 143 ~PrivetNotificationDelegate() override; | 147 ~PrivetNotificationDelegate() override; |
| 144 | 148 |
| 145 content::BrowserContext* profile_; | 149 content::BrowserContext* profile_; |
| 146 }; | 150 }; |
| 147 | 151 |
| 148 } // namespace local_discovery | 152 } // namespace cloud_print |
| 149 | 153 |
| 150 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_NOTIFICATIONS_H_ | 154 #endif // CHROME_BROWSER_PRINTING_CLOUD_PRINT_PRIVET_NOTIFICATIONS_H_ |
| OLD | NEW |