| 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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 | 337 |
| 338 bool ChromeMetricsServiceClient::IsReportingPolicyManaged() { | 338 bool ChromeMetricsServiceClient::IsReportingPolicyManaged() { |
| 339 return IsMetricsReportingPolicyManaged(); | 339 return IsMetricsReportingPolicyManaged(); |
| 340 } | 340 } |
| 341 | 341 |
| 342 metrics::MetricsServiceClient::EnableMetricsDefault | 342 metrics::MetricsServiceClient::EnableMetricsDefault |
| 343 ChromeMetricsServiceClient::GetDefaultOptIn() { | 343 ChromeMetricsServiceClient::GetDefaultOptIn() { |
| 344 return GetMetricsReportingDefaultOptIn(g_browser_process->local_state()); | 344 return GetMetricsReportingDefaultOptIn(g_browser_process->local_state()); |
| 345 } | 345 } |
| 346 | 346 |
| 347 scoped_refptr<base::SingleThreadTaskRunner> |
| 348 ChromeMetricsServiceClient::GetUIThreadTaskRunner() { |
| 349 return content::BrowserThread::GetMessageLoopProxyForThread( |
| 350 content::BrowserThread::UI); |
| 351 } |
| 352 |
| 347 void ChromeMetricsServiceClient::Initialize() { | 353 void ChromeMetricsServiceClient::Initialize() { |
| 348 // Clear metrics reports if it is the first time cellular upload logic should | 354 // Clear metrics reports if it is the first time cellular upload logic should |
| 349 // apply to avoid sudden bulk uploads. It needs to be done before initializing | 355 // apply to avoid sudden bulk uploads. It needs to be done before initializing |
| 350 // metrics service so that metrics log manager is initialized correctly. | 356 // metrics service so that metrics log manager is initialized correctly. |
| 351 if (ShouldClearSavedMetrics()) { | 357 if (ShouldClearSavedMetrics()) { |
| 352 PrefService* local_state = g_browser_process->local_state(); | 358 PrefService* local_state = g_browser_process->local_state(); |
| 353 local_state->ClearPref(metrics::prefs::kMetricsInitialLogs); | 359 local_state->ClearPref(metrics::prefs::kMetricsInitialLogs); |
| 354 local_state->ClearPref(metrics::prefs::kMetricsOngoingLogs); | 360 local_state->ClearPref(metrics::prefs::kMetricsOngoingLogs); |
| 355 } | 361 } |
| 356 | 362 |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 break; | 683 break; |
| 678 | 684 |
| 679 default: | 685 default: |
| 680 NOTREACHED(); | 686 NOTREACHED(); |
| 681 } | 687 } |
| 682 } | 688 } |
| 683 | 689 |
| 684 void ChromeMetricsServiceClient::OnURLOpenedFromOmnibox(OmniboxLog* log) { | 690 void ChromeMetricsServiceClient::OnURLOpenedFromOmnibox(OmniboxLog* log) { |
| 685 metrics_service_->OnApplicationNotIdle(); | 691 metrics_service_->OnApplicationNotIdle(); |
| 686 } | 692 } |
| OLD | NEW |