| 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_PRINTING_CLOUD_PRINT_PRIVET_NOTIFICATIONS_H_ | 5 #ifndef CHROME_BROWSER_PRINTING_CLOUD_PRINT_PRIVET_NOTIFICATIONS_H_ |
| 6 #define CHROME_BROWSER_PRINTING_CLOUD_PRINT_PRIVET_NOTIFICATIONS_H_ | 6 #define CHROME_BROWSER_PRINTING_CLOUD_PRINT_PRIVET_NOTIFICATIONS_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #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" | 13 #include "chrome/browser/printing/cloud_print/privet_device_lister.h" |
| 14 #include "chrome/browser/printing/cloud_print/privet_http.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 #include "components/prefs/pref_member.h" | 16 #include "components/prefs/pref_member.h" |
| 17 | 17 |
| 18 class NotificationUIManager; | 18 class NotificationUIManager; |
| 19 class Profile; |
| 19 | 20 |
| 20 namespace content { | 21 namespace content { |
| 21 class BrowserContext; | 22 class BrowserContext; |
| 22 } | 23 } |
| 23 | 24 |
| 24 namespace local_discovery { | 25 namespace local_discovery { |
| 25 class ServiceDiscoverySharedClient; | 26 class ServiceDiscoverySharedClient; |
| 26 } | 27 } |
| 27 | 28 |
| 28 namespace cloud_print { | 29 namespace cloud_print { |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 std::unique_ptr<PrivetNotificationsListener> privet_notifications_listener_; | 127 std::unique_ptr<PrivetNotificationsListener> privet_notifications_listener_; |
| 127 BooleanPrefMember enable_privet_notification_member_; | 128 BooleanPrefMember enable_privet_notification_member_; |
| 128 | 129 |
| 129 #if defined(ENABLE_MDNS) | 130 #if defined(ENABLE_MDNS) |
| 130 scoped_refptr<PrivetTrafficDetector> traffic_detector_; | 131 scoped_refptr<PrivetTrafficDetector> traffic_detector_; |
| 131 #endif // ENABLE_MDNS | 132 #endif // ENABLE_MDNS |
| 132 }; | 133 }; |
| 133 | 134 |
| 134 class PrivetNotificationDelegate : public NotificationDelegate { | 135 class PrivetNotificationDelegate : public NotificationDelegate { |
| 135 public: | 136 public: |
| 136 explicit PrivetNotificationDelegate(content::BrowserContext* profile); | 137 explicit PrivetNotificationDelegate(Profile* profile); |
| 137 | 138 |
| 138 // NotificationDelegate implementation. | 139 // NotificationDelegate implementation. |
| 139 std::string id() const override; | 140 std::string id() const override; |
| 140 void ButtonClick(int button_index) override; | 141 void ButtonClick(int button_index) override; |
| 141 | 142 |
| 142 private: | 143 private: |
| 143 // Refcounted. | 144 // Refcounted. |
| 144 ~PrivetNotificationDelegate() override; | 145 ~PrivetNotificationDelegate() override; |
| 145 | 146 |
| 146 void OpenTab(const GURL& url); | 147 void OpenTab(const GURL& url); |
| 147 void DisableNotifications(); | 148 void DisableNotifications(); |
| 149 void CloseNotification(); |
| 148 | 150 |
| 149 content::BrowserContext* const profile_; | 151 Profile* const profile_; |
| 150 }; | 152 }; |
| 151 | 153 |
| 152 } // namespace cloud_print | 154 } // namespace cloud_print |
| 153 | 155 |
| 154 #endif // CHROME_BROWSER_PRINTING_CLOUD_PRINT_PRIVET_NOTIFICATIONS_H_ | 156 #endif // CHROME_BROWSER_PRINTING_CLOUD_PRINT_PRIVET_NOTIFICATIONS_H_ |
| OLD | NEW |