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_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_ |
| 6 #define CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_ | 6 #define CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/threading/thread_checker.h" | 14 #include "base/threading/thread_checker.h" |
| 15 #include "chrome/browser/metrics/metrics_memory_details.h" | 15 #include "chrome/browser/metrics/metrics_memory_details.h" |
| 16 #include "chrome/browser/metrics/network_stats_uploader.h" | 16 #include "chrome/browser/metrics/network_stats_uploader.h" |
| 17 #include "components/metrics/metrics_service_client.h" | 17 #include "components/metrics/metrics_service_client.h" |
| 18 #include "components/metrics/net/network_metrics_provider.h" | |
| 18 #include "components/metrics/profiler/tracking_synchronizer_observer.h" | 19 #include "components/metrics/profiler/tracking_synchronizer_observer.h" |
| 19 #include "content/public/browser/notification_observer.h" | 20 #include "content/public/browser/notification_observer.h" |
| 20 #include "content/public/browser/notification_registrar.h" | 21 #include "content/public/browser/notification_registrar.h" |
| 21 | 22 |
| 22 class ChromeOSMetricsProvider; | 23 class ChromeOSMetricsProvider; |
| 23 class GoogleUpdateMetricsProviderWin; | 24 class GoogleUpdateMetricsProviderWin; |
| 24 class PluginMetricsProvider; | 25 class PluginMetricsProvider; |
| 25 class PrefRegistrySimple; | 26 class PrefRegistrySimple; |
| 26 | 27 |
| 27 #if !defined(OS_CHROMEOS) && !defined(OS_IOS) | 28 #if !defined(OS_CHROMEOS) && !defined(OS_IOS) |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 56 static void RegisterPrefs(PrefRegistrySimple* registry); | 57 static void RegisterPrefs(PrefRegistrySimple* registry); |
| 57 | 58 |
| 58 // metrics::MetricsServiceClient: | 59 // metrics::MetricsServiceClient: |
| 59 void SetMetricsClientId(const std::string& client_id) override; | 60 void SetMetricsClientId(const std::string& client_id) override; |
| 60 bool IsOffTheRecordSessionActive() override; | 61 bool IsOffTheRecordSessionActive() override; |
| 61 int32 GetProduct() override; | 62 int32 GetProduct() override; |
| 62 std::string GetApplicationLocale() override; | 63 std::string GetApplicationLocale() override; |
| 63 bool GetBrand(std::string* brand_code) override; | 64 bool GetBrand(std::string* brand_code) override; |
| 64 metrics::SystemProfileProto::Channel GetChannel() override; | 65 metrics::SystemProfileProto::Channel GetChannel() override; |
| 65 std::string GetVersionString() override; | 66 std::string GetVersionString() override; |
| 66 void OnLogUploadComplete() override; | 67 void OnLogUploadComplete(bool upload_succeeded) override; |
| 67 void StartGatheringMetrics(const base::Closure& done_callback) override; | 68 void StartGatheringMetrics(const base::Closure& done_callback) override; |
| 68 void CollectFinalMetrics(const base::Closure& done_callback) override; | 69 void CollectFinalMetrics(const base::Closure& done_callback) override; |
| 69 scoped_ptr<metrics::MetricsLogUploader> CreateUploader( | 70 scoped_ptr<metrics::MetricsLogUploader> CreateUploader( |
| 70 const base::Callback<void(int)>& on_upload_complete) override; | 71 const base::Callback<void(int)>& on_upload_complete) override; |
| 71 base::TimeDelta GetStandardUploadInterval() override; | 72 base::TimeDelta GetStandardUploadInterval() override; |
| 72 base::string16 GetRegistryBackupKey() override; | 73 base::string16 GetRegistryBackupKey() override; |
| 73 | 74 |
| 74 metrics::MetricsService* metrics_service() { return metrics_service_.get(); } | 75 metrics::MetricsService* metrics_service() { return metrics_service_.get(); } |
| 75 | 76 |
| 76 void LogPluginLoadingError(const base::FilePath& plugin_path); | 77 void LogPluginLoadingError(const base::FilePath& plugin_path); |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 165 GoogleUpdateMetricsProviderWin* google_update_metrics_provider_; | 166 GoogleUpdateMetricsProviderWin* google_update_metrics_provider_; |
| 166 #endif | 167 #endif |
| 167 | 168 |
| 168 // Callback that is called when initial metrics gathering is complete. | 169 // Callback that is called when initial metrics gathering is complete. |
| 169 base::Closure finished_gathering_initial_metrics_callback_; | 170 base::Closure finished_gathering_initial_metrics_callback_; |
| 170 | 171 |
| 171 // The MemoryGrowthTracker instance that tracks memory usage growth in | 172 // The MemoryGrowthTracker instance that tracks memory usage growth in |
| 172 // MemoryDetails. | 173 // MemoryDetails. |
| 173 MemoryGrowthTracker memory_growth_tracker_; | 174 MemoryGrowthTracker memory_growth_tracker_; |
| 174 | 175 |
| 175 // Callback to determine whether or not a cellular network is currently being | 176 // The network metrics provider for determining network connection type. |
| 176 // used. | 177 const metrics::NetworkMetricsProvider* network_metrics_provider_; |
|
Ilya Sherman
2015/03/24 00:14:23
Please move this to be defined near where the othe
gayane -on leave until 09-2017
2015/03/24 20:45:55
Done.
| |
| 177 base::Callback<void(bool*)> cellular_callback_; | |
| 178 | 178 |
| 179 base::WeakPtrFactory<ChromeMetricsServiceClient> weak_ptr_factory_; | 179 base::WeakPtrFactory<ChromeMetricsServiceClient> weak_ptr_factory_; |
| 180 | 180 |
| 181 DISALLOW_COPY_AND_ASSIGN(ChromeMetricsServiceClient); | 181 DISALLOW_COPY_AND_ASSIGN(ChromeMetricsServiceClient); |
| 182 }; | 182 }; |
| 183 | 183 |
| 184 #endif // CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_ | 184 #endif // CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_ |
| OLD | NEW |