OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 ANDROID_WEBVIEW_BROWSER_AW_METRICS_SERVICE_CLIENT_IMPL_H_ | 5 #ifndef ANDROID_WEBVIEW_BROWSER_AW_METRICS_SERVICE_CLIENT_IMPL_H_ |
6 #define ANDROID_WEBVIEW_BROWSER_AW_METRICS_SERVICE_CLIENT_IMPL_H_ | 6 #define ANDROID_WEBVIEW_BROWSER_AW_METRICS_SERVICE_CLIENT_IMPL_H_ |
7 | 7 |
8 #include "android_webview/browser/aw_metrics_service_client.h" | 8 #include <memory> |
9 | |
10 #include <string> | 9 #include <string> |
11 | 10 |
| 11 #include "android_webview/browser/aw_metrics_service_client.h" |
12 #include "base/lazy_instance.h" | 12 #include "base/lazy_instance.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/scoped_ptr.h" | |
15 #include "components/metrics/metrics_service_client.h" | 14 #include "components/metrics/metrics_service_client.h" |
16 | 15 |
17 class PrefService; | 16 class PrefService; |
18 | 17 |
19 namespace base { | 18 namespace base { |
20 class FilePath; | 19 class FilePath; |
21 } | 20 } |
22 | 21 |
23 namespace metrics { | 22 namespace metrics { |
24 struct ClientInfo; | 23 struct ClientInfo; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 bool IsOffTheRecordSessionActive() override; | 56 bool IsOffTheRecordSessionActive() override; |
58 int32_t GetProduct() override; | 57 int32_t GetProduct() override; |
59 std::string GetApplicationLocale() override; | 58 std::string GetApplicationLocale() override; |
60 bool GetBrand(std::string* brand_code) override; | 59 bool GetBrand(std::string* brand_code) override; |
61 metrics::SystemProfileProto::Channel GetChannel() override; | 60 metrics::SystemProfileProto::Channel GetChannel() override; |
62 std::string GetVersionString() override; | 61 std::string GetVersionString() override; |
63 void OnLogUploadComplete() override; | 62 void OnLogUploadComplete() override; |
64 void InitializeSystemProfileMetrics( | 63 void InitializeSystemProfileMetrics( |
65 const base::Closure& done_callback) override; | 64 const base::Closure& done_callback) override; |
66 void CollectFinalMetricsForLog(const base::Closure& done_callback) override; | 65 void CollectFinalMetricsForLog(const base::Closure& done_callback) override; |
67 scoped_ptr<metrics::MetricsLogUploader> CreateUploader( | 66 std::unique_ptr<metrics::MetricsLogUploader> CreateUploader( |
68 const base::Callback<void(int)>& on_upload_complete) override; | 67 const base::Callback<void(int)>& on_upload_complete) override; |
69 base::TimeDelta GetStandardUploadInterval() override; | 68 base::TimeDelta GetStandardUploadInterval() override; |
70 | 69 |
71 private: | 70 private: |
72 AwMetricsServiceClient(); | 71 AwMetricsServiceClient(); |
73 ~AwMetricsServiceClient() override; | 72 ~AwMetricsServiceClient() override; |
74 | 73 |
75 void InitializeWithGUID(std::string* guid); | 74 void InitializeWithGUID(std::string* guid); |
76 | 75 |
77 // Callback for metrics::MetricsStateManager::Create | 76 // Callback for metrics::MetricsStateManager::Create |
78 bool is_reporting_enabled(); | 77 bool is_reporting_enabled(); |
79 | 78 |
80 bool is_initialized_; | 79 bool is_initialized_; |
81 bool is_enabled_; | 80 bool is_enabled_; |
82 PrefService* pref_service_; | 81 PrefService* pref_service_; |
83 net::URLRequestContextGetter* request_context_; | 82 net::URLRequestContextGetter* request_context_; |
84 scoped_ptr<metrics::MetricsStateManager> metrics_state_manager_; | 83 std::unique_ptr<metrics::MetricsStateManager> metrics_state_manager_; |
85 scoped_ptr<metrics::MetricsService> metrics_service_; | 84 std::unique_ptr<metrics::MetricsService> metrics_service_; |
86 | 85 |
87 DISALLOW_COPY_AND_ASSIGN(AwMetricsServiceClient); | 86 DISALLOW_COPY_AND_ASSIGN(AwMetricsServiceClient); |
88 }; | 87 }; |
89 | 88 |
90 } // namespace android_webview | 89 } // namespace android_webview |
91 | 90 |
92 #endif // ANDROID_WEBVIEW_BROWSER_AW_METRICS_SERVICE_CLIENT_IMPL_H_ | 91 #endif // ANDROID_WEBVIEW_BROWSER_AW_METRICS_SERVICE_CLIENT_IMPL_H_ |
OLD | NEW |