Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_CHROMEOS_NET_WAKE_ON_WIFI_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_NET_WAKE_ON_WIFI_MANAGER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_NET_WAKE_ON_WIFI_MANAGER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_NET_WAKE_ON_WIFI_MANAGER_H_ |
| 7 | 7 |
| 8 #include "base/containers/scoped_ptr_hash_map.h" | 8 #include "base/containers/scoped_ptr_hash_map.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "content/public/browser/notification_observer.h" | 10 #include "content/public/browser/notification_observer.h" |
| 11 #include "content/public/browser/notification_registrar.h" | 11 #include "content/public/browser/notification_registrar.h" |
| 12 | 12 |
| 13 class Profile; | 13 class Profile; |
| 14 | 14 |
| 15 namespace chromeos { | 15 namespace chromeos { |
| 16 | 16 |
| 17 // This class is responsible for managing the various wake-on-wifi related bits | 17 // This class is responsible for managing the various wake-on-wifi related bits |
| 18 // of functionality in chrome. It is responsible for communicating the user's | 18 // of functionality in chrome. It is responsible for communicating the user's |
| 19 // preferences to shill as well as listening for connections to the Google GCM | 19 // preferences to shill as well as listening for connections to the Google GCM |
| 20 // servers and sending that connection information down to shill. This class is | 20 // servers and sending that connection information down to shill. This class is |
| 21 // owned by ChromeBrowserMainPartsChromeos. This class is also NOT thread-safe | 21 // owned by ChromeBrowserMainPartsChromeos. This class is also NOT thread-safe |
| 22 // and should only be called on the UI thread. | 22 // and should only be called on the UI thread. |
| 23 class WakeOnWifiManager : public content::NotificationObserver { | 23 class WakeOnWifiManager : public content::NotificationObserver { |
| 24 public: | 24 public: |
| 25 enum WakeOnWifiFeature { | 25 enum WakeOnWifiFeature { |
|
michaelpg
2014/12/17 02:30:54
specify in octal to show we want to use bitwise op
| |
| 26 WAKE_ON_NONE = 0, | 26 WAKE_ON_NONE = 0x00, |
| 27 WAKE_ON_PACKET = 1, | 27 WAKE_ON_PACKET = 0x01, |
| 28 WAKE_ON_SSID = 2, | 28 WAKE_ON_SSID = 0x02, |
| 29 WAKE_ON_PACKET_AND_SSID = 3, | 29 WAKE_ON_PACKET_AND_SSID = 0x03, |
| 30 INVALID = 4, | 30 INVALID = 0x04, |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 static WakeOnWifiManager* Get(); | 33 static WakeOnWifiManager* Get(); |
| 34 | 34 |
| 35 WakeOnWifiManager(); | 35 WakeOnWifiManager(); |
| 36 ~WakeOnWifiManager() override; | 36 ~WakeOnWifiManager() override; |
| 37 | 37 |
| 38 // Should be called whenever the primary user changes their preference for the | 38 // Should be called whenever the primary user changes their preference for the |
| 39 // wake-on-wifi features that should be enabled. | 39 // wake-on-wifi features that should be enabled. |
| 40 void OnPreferenceChanged(WakeOnWifiFeature feature); | 40 void OnPreferenceChanged(WakeOnWifiFeature feature); |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 55 connection_observers_; | 55 connection_observers_; |
| 56 | 56 |
| 57 content::NotificationRegistrar registrar_; | 57 content::NotificationRegistrar registrar_; |
| 58 | 58 |
| 59 DISALLOW_COPY_AND_ASSIGN(WakeOnWifiManager); | 59 DISALLOW_COPY_AND_ASSIGN(WakeOnWifiManager); |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 } // namespace chromeos | 62 } // namespace chromeos |
| 63 | 63 |
| 64 #endif // CHROME_BROWSER_CHROMEOS_NET_WAKE_ON_WIFI_MANAGER_H_ | 64 #endif // CHROME_BROWSER_CHROMEOS_NET_WAKE_ON_WIFI_MANAGER_H_ |
| OLD | NEW |