Chromium Code Reviews| Index: chrome/browser/chromeos/net/wake_on_wifi_manager.h |
| diff --git a/chrome/browser/chromeos/net/wake_on_wifi_manager.h b/chrome/browser/chromeos/net/wake_on_wifi_manager.h |
| index 9a2516c21eb274794adea6a7d4604cf2e67741f5..a8220a7ec9b0a7e6272edfe2dd396b940388c46f 100644 |
| --- a/chrome/browser/chromeos/net/wake_on_wifi_manager.h |
| +++ b/chrome/browser/chromeos/net/wake_on_wifi_manager.h |
| @@ -5,15 +5,16 @@ |
| #ifndef CHROME_BROWSER_CHROMEOS_NET_WAKE_ON_WIFI_MANAGER_H_ |
| #define CHROME_BROWSER_CHROMEOS_NET_WAKE_ON_WIFI_MANAGER_H_ |
| -#include <memory> |
| +#include <map> |
| -#include "base/containers/scoped_ptr_hash_map.h" |
| +#include "base/gtest_prod_util.h" |
| #include "base/macros.h" |
| #include "base/memory/weak_ptr.h" |
| #include "chrome/browser/chromeos/power/extension_event_observer.h" |
| #include "chromeos/network/network_state_handler_observer.h" |
| #include "content/public/browser/notification_observer.h" |
| #include "content/public/browser/notification_registrar.h" |
| +#include "net/base/ip_endpoint.h" |
|
stevenjb
2016/04/20 20:16:28
No longer needed
malaykeshav
2016/04/20 23:14:56
Done
|
| class Profile; |
| @@ -23,6 +24,10 @@ class DictionaryValue; |
| namespace chromeos { |
| +class ConnectionObserverTest; |
| +class NetworkDeviceHandler; |
|
stevenjb
2016/04/20 20:16:28
Both of these should be forward declared in wake_o
malaykeshav
2016/04/20 23:14:55
Done
|
| +class WakeOnWifiConnectionObserver; |
| + |
| // This class is responsible for managing the various wake-on-wifi related bits |
| // of functionality in chrome. It is responsible for communicating the user's |
| // preferences to shill as well as listening for connections to the Google GCM |
| @@ -42,6 +47,7 @@ class WakeOnWifiManager : public content::NotificationObserver, |
| }; |
| static WakeOnWifiManager* Get(); |
| + static bool IsWakeOnPacketEnabled(WakeOnWifiFeature feature); |
| WakeOnWifiManager(); |
| ~WakeOnWifiManager() override; |
| @@ -64,6 +70,11 @@ class WakeOnWifiManager : public content::NotificationObserver, |
| void DevicePropertiesUpdated(const DeviceState* device) override; |
| private: |
| + FRIEND_TEST_ALL_PREFIXES(WakeOnWifiObserverTest, TestWakeOnWifiPacketAdd); |
| + FRIEND_TEST_ALL_PREFIXES(WakeOnWifiObserverTest, TestWakeOnWifiPacketRemove); |
| + FRIEND_TEST_ALL_PREFIXES(WakeOnWifiObserverTest, TestWakeOnWifiNoneAdd); |
| + FRIEND_TEST_ALL_PREFIXES(WakeOnWifiObserverTest, TestWakeOnWifiNoneRemove); |
| + |
| // Sends the user's preference to shill, updates the timer used by the GCM |
| // client to send heartbeats, and tells |extension_event_observer_| to block |
| // (or not block) suspends based on the value of |current_feature_|. |
| @@ -86,10 +97,8 @@ class WakeOnWifiManager : public content::NotificationObserver, |
| // shill. |
| bool wifi_properties_received_; |
| - class WakeOnPacketConnectionObserver; |
| - base::ScopedPtrHashMap<Profile*, |
| - std::unique_ptr<WakeOnPacketConnectionObserver>> |
| - connection_observers_; |
| + std::map<Profile*, |
| + std::unique_ptr<WakeOnWifiConnectionObserver>> connection_observers_; |
| std::unique_ptr<ExtensionEventObserver> extension_event_observer_; |