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

Side by Side Diff: chrome/browser/chromeos/net/wake_on_wifi_connection_observer.h

Issue 1891633002: Remove unnecessary calls to AddWakeOnPaketConnection and RemoveWakeOnPacketConnection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_CHROMEOS_NET_WAKE_ON_WIFI_CONNECTION_OBSERVER_H_
6 #define CHROME_BROWSER_CHROMEOS_NET_WAKE_ON_WIFI_CONNECTION_OBSERVER_H_
7
8 #include "base/gtest_prod_util.h"
9 #include "base/macros.h"
10 #include "chrome/browser/chromeos/net/wake_on_wifi_manager.h"
11 #include "components/gcm_driver/gcm_connection_observer.h"
12 #include "content/public/browser/notification_observer.h"
13 #include "net/base/ip_endpoint.h"
14
15 class Profile;
16
17 namespace chromeos {
18
19 class NetworkDeviceHandler;
20
21 // Simple class that listens for a connection to the GCM server and passes the
22 // connection information down to shill. Each profile gets its own instance
23 // of this class.
stevenjb 2016/04/20 20:16:28 The last sentence doesn't really apply to this cla
malaykeshav 2016/04/20 23:14:55 done
24 class WakeOnWifiConnectionObserver : public gcm::GCMConnectionObserver {
25 public:
26 ~WakeOnWifiConnectionObserver() override;
27
28 void HandleWifiDevicePropertiesReady();
stevenjb 2016/04/20 20:16:28 public methods should be documented (except trivia
malaykeshav 2016/04/20 23:14:55 done
29
30 // gcm::GCMConnectionObserver overrides:
31 void OnConnected(const net::IPEndPoint& ip_endpoint) override;
32 void OnDisconnected() override;
33
34 void set_feature(WakeOnWifiManager::WakeOnWifiFeature feature) {
35 feature_ = feature;
36 }
37
38 private:
39 FRIEND_TEST_ALL_PREFIXES(WakeOnWifiObserverTest, TestWakeOnWifiPacketAdd);
40 FRIEND_TEST_ALL_PREFIXES(WakeOnWifiObserverTest,
41 TestWakeOnWifiPacketRemove);
42 FRIEND_TEST_ALL_PREFIXES(WakeOnWifiObserverTest, TestWakeOnWifiNoneAdd);
43 FRIEND_TEST_ALL_PREFIXES(WakeOnWifiObserverTest, TestWakeOnWifiNoneRemove);
44 friend class WakeOnWifiManager;
45
46 WakeOnWifiConnectionObserver(Profile* profile,
47 bool wifi_properties_received,
48 WakeOnWifiManager::WakeOnWifiFeature feature,
49 NetworkDeviceHandler* network_device_handler);
50
51 void AddWakeOnPacketConnection();
52 void RemoveWakeOnPacketConnection();
53
54 Profile* profile_;
55 net::IPEndPoint ip_endpoint_;
56 bool wifi_properties_received_;
57 WakeOnWifiManager::WakeOnWifiFeature feature_;
58 NetworkDeviceHandler* network_device_handler_;
59
60 DISALLOW_COPY_AND_ASSIGN(WakeOnWifiConnectionObserver);
61 };
62
63 } // namespace chromeos
64
65 #endif // CHROME_BROWSER_CHROMEOS_NET_WAKE_ON_WIFI_CONNECTION_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698