| 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 #include "chrome/browser/metrics/chrome_metrics_service_client.h" | 5 #include "chrome/browser/metrics/chrome_metrics_service_client.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 | 338 |
| 339 bool ChromeMetricsServiceClient::IsReportingPolicyManaged() { | 339 bool ChromeMetricsServiceClient::IsReportingPolicyManaged() { |
| 340 return IsMetricsReportingPolicyManaged(); | 340 return IsMetricsReportingPolicyManaged(); |
| 341 } | 341 } |
| 342 | 342 |
| 343 metrics::MetricsServiceClient::EnableMetricsDefault | 343 metrics::MetricsServiceClient::EnableMetricsDefault |
| 344 ChromeMetricsServiceClient::GetDefaultOptIn() { | 344 ChromeMetricsServiceClient::GetDefaultOptIn() { |
| 345 return GetMetricsReportingDefaultOptIn(g_browser_process->local_state()); | 345 return GetMetricsReportingDefaultOptIn(g_browser_process->local_state()); |
| 346 } | 346 } |
| 347 | 347 |
| 348 scoped_refptr<base::SingleThreadTaskRunner> |
| 349 ChromeMetricsServiceClient::GetMainThreadTaskRunner() { |
| 350 return content::BrowserThread::GetMessageLoopProxyForThread( |
| 351 content::BrowserThread::UI); |
| 352 } |
| 353 |
| 348 void ChromeMetricsServiceClient::Initialize() { | 354 void ChromeMetricsServiceClient::Initialize() { |
| 349 // Clear metrics reports if it is the first time cellular upload logic should | 355 // Clear metrics reports if it is the first time cellular upload logic should |
| 350 // apply to avoid sudden bulk uploads. It needs to be done before initializing | 356 // apply to avoid sudden bulk uploads. It needs to be done before initializing |
| 351 // metrics service so that metrics log manager is initialized correctly. | 357 // metrics service so that metrics log manager is initialized correctly. |
| 352 if (ShouldClearSavedMetrics()) { | 358 if (ShouldClearSavedMetrics()) { |
| 353 PrefService* local_state = g_browser_process->local_state(); | 359 PrefService* local_state = g_browser_process->local_state(); |
| 354 local_state->ClearPref(metrics::prefs::kMetricsInitialLogs); | 360 local_state->ClearPref(metrics::prefs::kMetricsInitialLogs); |
| 355 local_state->ClearPref(metrics::prefs::kMetricsOngoingLogs); | 361 local_state->ClearPref(metrics::prefs::kMetricsOngoingLogs); |
| 356 } | 362 } |
| 357 | 363 |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 } | 692 } |
| 687 } | 693 } |
| 688 | 694 |
| 689 void ChromeMetricsServiceClient::OnURLOpenedFromOmnibox(OmniboxLog* log) { | 695 void ChromeMetricsServiceClient::OnURLOpenedFromOmnibox(OmniboxLog* log) { |
| 690 metrics_service_->OnApplicationNotIdle(); | 696 metrics_service_->OnApplicationNotIdle(); |
| 691 } | 697 } |
| 692 | 698 |
| 693 bool ChromeMetricsServiceClient::IsUMACellularUploadLogicEnabled() { | 699 bool ChromeMetricsServiceClient::IsUMACellularUploadLogicEnabled() { |
| 694 return IsCellularLogicEnabled(); | 700 return IsCellularLogicEnabled(); |
| 695 } | 701 } |
| OLD | NEW |