| 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 #import <UIKit/UIKit.h> | 5 #import <UIKit/UIKit.h> |
| 6 | 6 |
| 7 #import "ios/chrome/today_extension/today_metrics_logger.h" | 7 #import "ios/chrome/today_extension/today_metrics_logger.h" |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/cpu.h" | 10 #include "base/cpu.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 class TodayMetricsServiceClient : public metrics::MetricsServiceClient { | 55 class TodayMetricsServiceClient : public metrics::MetricsServiceClient { |
| 56 public: | 56 public: |
| 57 TodayMetricsServiceClient() {} | 57 TodayMetricsServiceClient() {} |
| 58 metrics::MetricsService* GetMetricsService() override; | 58 metrics::MetricsService* GetMetricsService() override; |
| 59 void SetMetricsClientId(const std::string& client_id) override; | 59 void SetMetricsClientId(const std::string& client_id) override; |
| 60 int32_t GetProduct() override; | 60 int32_t GetProduct() override; |
| 61 std::string GetApplicationLocale() override; | 61 std::string GetApplicationLocale() override; |
| 62 bool GetBrand(std::string* brand_code) override; | 62 bool GetBrand(std::string* brand_code) override; |
| 63 metrics::SystemProfileProto::Channel GetChannel() override; | 63 metrics::SystemProfileProto::Channel GetChannel() override; |
| 64 std::string GetVersionString() override; | 64 std::string GetVersionString() override; |
| 65 void OnLogUploadComplete() override; | |
| 66 void InitializeSystemProfileMetrics( | 65 void InitializeSystemProfileMetrics( |
| 67 const base::Closure& done_callback) override; | 66 const base::Closure& done_callback) override; |
| 68 void CollectFinalMetricsForLog(const base::Closure& done_callback) override; | 67 void CollectFinalMetricsForLog(const base::Closure& done_callback) override; |
| 69 std::unique_ptr<metrics::MetricsLogUploader> CreateUploader( | 68 std::unique_ptr<metrics::MetricsLogUploader> CreateUploader( |
| 70 const std::string& server_url, | 69 const std::string& server_url, |
| 71 const std::string& mime_type, | 70 const std::string& mime_type, |
| 72 const base::Callback<void(int)>& on_upload_complete) override; | 71 const base::Callback<void(int)>& on_upload_complete) override; |
| 73 base::TimeDelta GetStandardUploadInterval() override; | 72 base::TimeDelta GetStandardUploadInterval() override; |
| 74 | 73 |
| 75 private: | 74 private: |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 127 |
| 129 std::string TodayMetricsServiceClient::GetApplicationLocale() { | 128 std::string TodayMetricsServiceClient::GetApplicationLocale() { |
| 130 return base::SysNSStringToUTF8( | 129 return base::SysNSStringToUTF8( |
| 131 [[[NSBundle mainBundle] preferredLocalizations] objectAtIndex:0]); | 130 [[[NSBundle mainBundle] preferredLocalizations] objectAtIndex:0]); |
| 132 } | 131 } |
| 133 | 132 |
| 134 std::string TodayMetricsServiceClient::GetVersionString() { | 133 std::string TodayMetricsServiceClient::GetVersionString() { |
| 135 return metrics::GetVersionString(); | 134 return metrics::GetVersionString(); |
| 136 } | 135 } |
| 137 | 136 |
| 138 void TodayMetricsServiceClient::OnLogUploadComplete() { | |
| 139 NOTREACHED(); | |
| 140 } | |
| 141 | |
| 142 void TodayMetricsServiceClient::InitializeSystemProfileMetrics( | 137 void TodayMetricsServiceClient::InitializeSystemProfileMetrics( |
| 143 const base::Closure& done_callback) { | 138 const base::Closure& done_callback) { |
| 144 NOTREACHED(); | 139 NOTREACHED(); |
| 145 } | 140 } |
| 146 | 141 |
| 147 void TodayMetricsServiceClient::CollectFinalMetricsForLog( | 142 void TodayMetricsServiceClient::CollectFinalMetricsForLog( |
| 148 const base::Closure& done_callback) { | 143 const base::Closure& done_callback) { |
| 149 NOTREACHED(); | 144 NOTREACHED(); |
| 150 } | 145 } |
| 151 | 146 |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 void TodayMetricsLogger::UniqueInconsistencyDetected( | 292 void TodayMetricsLogger::UniqueInconsistencyDetected( |
| 298 base::HistogramBase::Inconsistency problem) { | 293 base::HistogramBase::Inconsistency problem) { |
| 299 UMA_HISTOGRAM_ENUMERATION("Histogram.InconsistenciesBrowserUnique", problem, | 294 UMA_HISTOGRAM_ENUMERATION("Histogram.InconsistenciesBrowserUnique", problem, |
| 300 base::HistogramBase::NEVER_EXCEEDED_VALUE); | 295 base::HistogramBase::NEVER_EXCEEDED_VALUE); |
| 301 } | 296 } |
| 302 | 297 |
| 303 void TodayMetricsLogger::InconsistencyDetectedInLoggedCount(int amount) { | 298 void TodayMetricsLogger::InconsistencyDetectedInLoggedCount(int amount) { |
| 304 UMA_HISTOGRAM_COUNTS("Histogram.InconsistentSnapshotBrowser", | 299 UMA_HISTOGRAM_COUNTS("Histogram.InconsistentSnapshotBrowser", |
| 305 std::abs(amount)); | 300 std::abs(amount)); |
| 306 } | 301 } |
| OLD | NEW |