Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(204)

Side by Side Diff: chrome/browser/local_discovery/privet_notifications.h

Issue 195983023: Enable devices page UI on MacOSX (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_dcheck
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/prefs/pref_member.h" 11 #include "base/prefs/pref_member.h"
12 #include "chrome/browser/local_discovery/privet_device_lister.h" 12 #include "chrome/browser/local_discovery/privet_device_lister.h"
13 #include "chrome/browser/local_discovery/privet_http.h" 13 #include "chrome/browser/local_discovery/privet_http.h"
14 #include "chrome/browser/notifications/notification_delegate.h" 14 #include "chrome/browser/notifications/notification_delegate.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 } // namespace content
22 22
23 namespace local_discovery { 23 namespace local_discovery {
24 24
25 class ServiceDiscoverySharedClient; 25 class ServiceDiscoverySharedClient;
26 class PrivetDeviceLister; 26 class PrivetDeviceLister;
27 class PrivetHTTPAsynchronousFactory; 27 class PrivetHTTPAsynchronousFactory;
28 class PrivetHTTPResolution; 28 class PrivetHTTPResolution;
29 struct DeviceDescription;
30
31 #if defined(ENABLE_MDNS)
29 class PrivetTrafficDetector; 32 class PrivetTrafficDetector;
30 struct DeviceDescription; 33 #endif // ENABLE_MDNS
31 34
32 // Contains logic related to notifications not tied actually displaying them. 35 // Contains logic related to notifications not tied actually displaying them.
33 class PrivetNotificationsListener { 36 class PrivetNotificationsListener {
34 public: 37 public:
35 class Delegate { 38 class Delegate {
36 public: 39 public:
37 virtual ~Delegate() {} 40 virtual ~Delegate() {}
38 41
39 // Notify user of the existence of device |device_name|. 42 // Notify user of the existence of device |device_name|.
40 virtual void PrivetNotify(bool multiple, bool added) = 0; 43 virtual void PrivetNotify(bool multiple, bool added) = 0;
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 static bool IsForced(); 112 static bool IsForced();
110 113
111 private: 114 private:
112 void Start(); 115 void Start();
113 void OnNotificationsEnabledChanged(); 116 void OnNotificationsEnabledChanged();
114 void StartLister(); 117 void StartLister();
115 118
116 content::BrowserContext* profile_; 119 content::BrowserContext* profile_;
117 scoped_ptr<PrivetDeviceLister> device_lister_; 120 scoped_ptr<PrivetDeviceLister> device_lister_;
118 scoped_refptr<ServiceDiscoverySharedClient> service_discovery_client_; 121 scoped_refptr<ServiceDiscoverySharedClient> service_discovery_client_;
119 scoped_refptr<PrivetTrafficDetector> traffic_detector_;
120 scoped_ptr<PrivetNotificationsListener> privet_notifications_listener_; 122 scoped_ptr<PrivetNotificationsListener> privet_notifications_listener_;
121 BooleanPrefMember enable_privet_notification_member_; 123 BooleanPrefMember enable_privet_notification_member_;
124
125 #if defined(ENABLE_MDNS)
126 scoped_refptr<PrivetTrafficDetector> traffic_detector_;
127 #endif // ENABLE_MDNS
122 }; 128 };
123 129
124 class PrivetNotificationDelegate : public NotificationDelegate { 130 class PrivetNotificationDelegate : public NotificationDelegate {
125 public: 131 public:
126 explicit PrivetNotificationDelegate(content::BrowserContext* profile); 132 explicit PrivetNotificationDelegate(content::BrowserContext* profile);
127 133
128 // NotificationDelegate implementation. 134 // NotificationDelegate implementation.
129 virtual std::string id() const OVERRIDE; 135 virtual std::string id() const OVERRIDE;
130 virtual content::RenderViewHost* GetRenderViewHost() const OVERRIDE; 136 virtual content::RenderViewHost* GetRenderViewHost() const OVERRIDE;
131 virtual void Display() OVERRIDE; 137 virtual void Display() OVERRIDE;
132 virtual void Error() OVERRIDE; 138 virtual void Error() OVERRIDE;
133 virtual void Close(bool by_user) OVERRIDE; 139 virtual void Close(bool by_user) OVERRIDE;
134 virtual void Click() OVERRIDE; 140 virtual void Click() OVERRIDE;
135 virtual void ButtonClick(int button_index) OVERRIDE; 141 virtual void ButtonClick(int button_index) OVERRIDE;
136 142
137 private: 143 private:
138 void OpenTab(const GURL& url); 144 void OpenTab(const GURL& url);
139 void DisableNotifications(); 145 void DisableNotifications();
140 146
141 virtual ~PrivetNotificationDelegate(); 147 virtual ~PrivetNotificationDelegate();
142 148
143 content::BrowserContext* profile_; 149 content::BrowserContext* profile_;
144 }; 150 };
145 151
146 } // namespace local_discovery 152 } // namespace local_discovery
147 153
148 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_NOTIFICATIONS_H_ 154 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_NOTIFICATIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698