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 IOS_CHROME_BROWSER_METRICS_IOS_CHROME_METRICS_SERVICE_CLIENT_H_ | 5 #ifndef IOS_CHROME_BROWSER_METRICS_IOS_CHROME_METRICS_SERVICE_CLIENT_H_ |
6 #define IOS_CHROME_BROWSER_METRICS_IOS_CHROME_METRICS_SERVICE_CLIENT_H_ | 6 #define IOS_CHROME_BROWSER_METRICS_IOS_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" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 // Factory function. | 44 // Factory function. |
45 static scoped_ptr<IOSChromeMetricsServiceClient> Create( | 45 static scoped_ptr<IOSChromeMetricsServiceClient> Create( |
46 metrics::MetricsStateManager* state_manager, | 46 metrics::MetricsStateManager* state_manager, |
47 PrefService* local_state); | 47 PrefService* local_state); |
48 | 48 |
49 // Registers local state prefs used by this class. | 49 // Registers local state prefs used by this class. |
50 static void RegisterPrefs(PrefRegistrySimple* registry); | 50 static void RegisterPrefs(PrefRegistrySimple* registry); |
51 | 51 |
52 // metrics::MetricsServiceClient: | 52 // metrics::MetricsServiceClient: |
53 metrics::MetricsService* GetMetricsService() override; | |
54 void SetMetricsClientId(const std::string& client_id) override; | 53 void SetMetricsClientId(const std::string& client_id) override; |
55 void OnRecordingDisabled() override; | 54 void OnRecordingDisabled() override; |
56 bool IsOffTheRecordSessionActive() override; | 55 bool IsOffTheRecordSessionActive() override; |
57 int32 GetProduct() override; | 56 int32 GetProduct() override; |
58 std::string GetApplicationLocale() override; | 57 std::string GetApplicationLocale() override; |
59 bool GetBrand(std::string* brand_code) override; | 58 bool GetBrand(std::string* brand_code) override; |
60 metrics::SystemProfileProto::Channel GetChannel() override; | 59 metrics::SystemProfileProto::Channel GetChannel() override; |
61 std::string GetVersionString() override; | 60 std::string GetVersionString() override; |
62 void OnLogUploadComplete() override; | 61 void OnLogUploadComplete() override; |
63 void InitializeSystemProfileMetrics( | 62 void InitializeSystemProfileMetrics( |
64 const base::Closure& done_callback) override; | 63 const base::Closure& done_callback) override; |
65 void CollectFinalMetricsForLog(const base::Closure& done_callback) override; | 64 void CollectFinalMetricsForLog(const base::Closure& done_callback) override; |
66 scoped_ptr<metrics::MetricsLogUploader> CreateUploader( | 65 scoped_ptr<metrics::MetricsLogUploader> CreateUploader( |
67 const base::Callback<void(int)>& on_upload_complete) override; | 66 const base::Callback<void(int)>& on_upload_complete) override; |
68 base::TimeDelta GetStandardUploadInterval() override; | 67 base::TimeDelta GetStandardUploadInterval() override; |
69 base::string16 GetRegistryBackupKey() override; | 68 base::string16 GetRegistryBackupKey() override; |
70 | 69 |
71 // web::GlobalWebStateObserver: | 70 // web::GlobalWebStateObserver: |
72 void WebStateDidStartLoading(web::WebState* web_state) override; | 71 void WebStateDidStartLoading(web::WebState* web_state) override; |
73 void WebStateDidStopLoading(web::WebState* web_state) override; | 72 void WebStateDidStopLoading(web::WebState* web_state) override; |
74 | 73 |
| 74 metrics::MetricsService* metrics_service() { return metrics_service_.get(); } |
| 75 |
75 // Records an unexpected renderer (web) process termination. | 76 // Records an unexpected renderer (web) process termination. |
76 // This path only exists on iOS because the other platforms use the (now | 77 // This path only exists on iOS because the other platforms use the (now |
77 // deprecated) content::Notification system to get this information into the | 78 // deprecated) content::Notification system to get this information into the |
78 // stability provider. | 79 // stability provider. |
79 void LogRendererProcessCrash(); | 80 void LogRendererProcessCrash(); |
80 | 81 |
81 private: | 82 private: |
82 explicit IOSChromeMetricsServiceClient( | 83 explicit IOSChromeMetricsServiceClient( |
83 metrics::MetricsStateManager* state_manager); | 84 metrics::MetricsStateManager* state_manager); |
84 | 85 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 // Whether this client has already uploaded profiler data during this session. | 159 // Whether this client has already uploaded profiler data during this session. |
159 // Profiler data is uploaded at most once per session. | 160 // Profiler data is uploaded at most once per session. |
160 bool has_uploaded_profiler_data_; | 161 bool has_uploaded_profiler_data_; |
161 | 162 |
162 base::WeakPtrFactory<IOSChromeMetricsServiceClient> weak_ptr_factory_; | 163 base::WeakPtrFactory<IOSChromeMetricsServiceClient> weak_ptr_factory_; |
163 | 164 |
164 DISALLOW_COPY_AND_ASSIGN(IOSChromeMetricsServiceClient); | 165 DISALLOW_COPY_AND_ASSIGN(IOSChromeMetricsServiceClient); |
165 }; | 166 }; |
166 | 167 |
167 #endif // IOS_CHROME_BROWSER_METRICS_IOS_CHROME_METRICS_SERVICE_CLIENT_H_ | 168 #endif // IOS_CHROME_BROWSER_METRICS_IOS_CHROME_METRICS_SERVICE_CLIENT_H_ |
OLD | NEW |