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

Side by Side Diff: chrome/browser/metrics/network_metrics_provider.h

Issue 328793002: Add wifi AP info to system profile metrics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/metrics/network_metrics_provider.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_METRICS_NETWORK_METRICS_PROVIDER_H_ 5 #ifndef CHROME_BROWSER_METRICS_NETWORK_METRICS_PROVIDER_H_
6 #define CHROME_BROWSER_METRICS_NETWORK_METRICS_PROVIDER_H_ 6 #define CHROME_BROWSER_METRICS_NETWORK_METRICS_PROVIDER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
11 #include "chrome/browser/metrics/wifi_access_point_info_provider.h"
11 #include "components/metrics/metrics_provider.h" 12 #include "components/metrics/metrics_provider.h"
12 #include "components/metrics/proto/system_profile.pb.h" 13 #include "components/metrics/proto/system_profile.pb.h"
13 #include "net/base/net_util.h" 14 #include "net/base/net_util.h"
14 #include "net/base/network_change_notifier.h" 15 #include "net/base/network_change_notifier.h"
15 16
16 // Registers as observer with net::NetworkChangeNotifier and keeps track of 17 // Registers as observer with net::NetworkChangeNotifier and keeps track of
17 // the network environment. 18 // the network environment.
18 class NetworkMetricsProvider 19 class NetworkMetricsProvider
19 : public metrics::MetricsProvider, 20 : public metrics::MetricsProvider,
20 public net::NetworkChangeNotifier::ConnectionTypeObserver { 21 public net::NetworkChangeNotifier::ConnectionTypeObserver {
(...skipping 14 matching lines...) Expand all
35 GetConnectionType() const; 36 GetConnectionType() const;
36 metrics::SystemProfileProto::Network::WifiPHYLayerProtocol 37 metrics::SystemProfileProto::Network::WifiPHYLayerProtocol
37 GetWifiPHYLayerProtocol() const; 38 GetWifiPHYLayerProtocol() const;
38 39
39 // Posts a call to net::GetWifiPHYLayerProtocol on the blocking pool. 40 // Posts a call to net::GetWifiPHYLayerProtocol on the blocking pool.
40 void ProbeWifiPHYLayerProtocol(); 41 void ProbeWifiPHYLayerProtocol();
41 // Callback from the blocking pool with the result of 42 // Callback from the blocking pool with the result of
42 // net::GetWifiPHYLayerProtocol. 43 // net::GetWifiPHYLayerProtocol.
43 void OnWifiPHYLayerProtocolResult(net::WifiPHYLayerProtocol mode); 44 void OnWifiPHYLayerProtocolResult(net::WifiPHYLayerProtocol mode);
44 45
46 // Writes info about the wireless access points that this system is
47 // connected to.
48 void WriteWifiAccessPointProto(
49 const WifiAccessPointInfoProvider::WifiAccessPointInfo& info,
50 metrics::SystemProfileProto::Network* network_proto);
51
45 // True if |connection_type_| changed during the lifetime of the log. 52 // True if |connection_type_| changed during the lifetime of the log.
46 bool connection_type_is_ambiguous_; 53 bool connection_type_is_ambiguous_;
47 // The connection type according to net::NetworkChangeNotifier. 54 // The connection type according to net::NetworkChangeNotifier.
48 net::NetworkChangeNotifier::ConnectionType connection_type_; 55 net::NetworkChangeNotifier::ConnectionType connection_type_;
49 56
50 // True if |wifi_phy_layer_protocol_| changed during the lifetime of the log. 57 // True if |wifi_phy_layer_protocol_| changed during the lifetime of the log.
51 bool wifi_phy_layer_protocol_is_ambiguous_; 58 bool wifi_phy_layer_protocol_is_ambiguous_;
52 // The PHY mode of the currently associated access point obtained via 59 // The PHY mode of the currently associated access point obtained via
53 // net::GetWifiPHYLayerProtocol. 60 // net::GetWifiPHYLayerProtocol.
54 net::WifiPHYLayerProtocol wifi_phy_layer_protocol_; 61 net::WifiPHYLayerProtocol wifi_phy_layer_protocol_;
55 62
56 base::WeakPtrFactory<NetworkMetricsProvider> weak_ptr_factory_; 63 base::WeakPtrFactory<NetworkMetricsProvider> weak_ptr_factory_;
57 64
65 // Helper object for retrieving connected wifi access point information.
66 scoped_ptr<WifiAccessPointInfoProvider> wifi_access_point_info_provider_;
67
58 DISALLOW_COPY_AND_ASSIGN(NetworkMetricsProvider); 68 DISALLOW_COPY_AND_ASSIGN(NetworkMetricsProvider);
59 }; 69 };
60 70
61 #endif // CHROME_BROWSER_METRICS_NETWORK_METRICS_PROVIDER_H_ 71 #endif // CHROME_BROWSER_METRICS_NETWORK_METRICS_PROVIDER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/metrics/network_metrics_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698