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 COMPONENTS_METRICS_NET_WIFI_ACCESS_POINT_INFO_PROVIDER_CHROMEOS_H_ | 5 #ifndef COMPONENTS_METRICS_NET_WIFI_ACCESS_POINT_INFO_PROVIDER_CHROMEOS_H_ |
6 #define COMPONENTS_METRICS_NET_WIFI_ACCESS_POINT_INFO_PROVIDER_CHROMEOS_H_ | 6 #define COMPONENTS_METRICS_NET_WIFI_ACCESS_POINT_INFO_PROVIDER_CHROMEOS_H_ |
7 | 7 |
| 8 #include <string> |
| 9 |
8 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
9 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
10 #include "base/values.h" | 12 #include "base/values.h" |
11 #include "chromeos/network/network_state_handler_observer.h" | 13 #include "chromeos/network/network_state_handler_observer.h" |
12 #include "components/metrics/net/wifi_access_point_info_provider.h" | 14 #include "components/metrics/net/wifi_access_point_info_provider.h" |
13 | 15 |
| 16 namespace metrics { |
| 17 |
14 // WifiAccessPointInfoProviderChromeos provides the connected wifi | 18 // WifiAccessPointInfoProviderChromeos provides the connected wifi |
15 // acccess point information for chromeos. | 19 // acccess point information for chromeos. |
16 class WifiAccessPointInfoProviderChromeos | 20 class WifiAccessPointInfoProviderChromeos |
17 : public WifiAccessPointInfoProvider, | 21 : public WifiAccessPointInfoProvider, |
18 public chromeos::NetworkStateHandlerObserver, | 22 public chromeos::NetworkStateHandlerObserver, |
19 public base::SupportsWeakPtr<WifiAccessPointInfoProviderChromeos> { | 23 public base::SupportsWeakPtr<WifiAccessPointInfoProviderChromeos> { |
20 public: | 24 public: |
21 WifiAccessPointInfoProviderChromeos(); | 25 WifiAccessPointInfoProviderChromeos(); |
22 virtual ~WifiAccessPointInfoProviderChromeos(); | 26 virtual ~WifiAccessPointInfoProviderChromeos(); |
23 | 27 |
24 // WifiAccessPointInfoProvider | 28 // WifiAccessPointInfoProvider: |
25 virtual bool GetInfo(WifiAccessPointInfo* info) override; | 29 bool GetInfo(WifiAccessPointInfo* info) override; |
26 | 30 |
27 // NetworkStateHandlerObserver overrides. | 31 // NetworkStateHandlerObserver: |
28 virtual void DefaultNetworkChanged( | 32 void DefaultNetworkChanged( |
29 const chromeos::NetworkState* default_network) override; | 33 const chromeos::NetworkState* default_network) override; |
30 | 34 |
31 private: | 35 private: |
32 // Callback from Shill.Service.GetProperties. Parses |properties| to obtain | 36 // Callback from Shill.Service.GetProperties. Parses |properties| to obtain |
33 // the wifi access point information. | 37 // the wifi access point information. |
34 void ParseInfo(const std::string& service_path, | 38 void ParseInfo(const std::string& service_path, |
35 const base::DictionaryValue& properties); | 39 const base::DictionaryValue& properties); |
36 | 40 |
37 WifiAccessPointInfo wifi_access_point_info_; | 41 WifiAccessPointInfo wifi_access_point_info_; |
38 | 42 |
39 DISALLOW_COPY_AND_ASSIGN(WifiAccessPointInfoProviderChromeos); | 43 DISALLOW_COPY_AND_ASSIGN(WifiAccessPointInfoProviderChromeos); |
40 }; | 44 }; |
41 | 45 |
| 46 } // namespace metrics |
| 47 |
42 #endif // COMPONENTS_METRICS_NET_WIFI_ACCESS_POINT_INFO_PROVIDER_CHROMEOS_H_ | 48 #endif // COMPONENTS_METRICS_NET_WIFI_ACCESS_POINT_INFO_PROVIDER_CHROMEOS_H_ |
OLD | NEW |