| 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 #include "chrome/browser/interstitials/chrome_metrics_helper.h" | 5 #include "chrome/browser/interstitials/chrome_metrics_helper.h" |
| 6 | 6 |
| 7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
| 8 #include "chrome/browser/history/history_service_factory.h" | 8 #include "chrome/browser/history/history_service_factory.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "components/history/core/browser/history_service.h" | 10 #include "components/history/core/browser/history_service.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 const std::string& sampling_event_name) | 26 const std::string& sampling_event_name) |
| 27 : security_interstitials::MetricsHelper( | 27 : security_interstitials::MetricsHelper( |
| 28 request_url, | 28 request_url, |
| 29 settings, | 29 settings, |
| 30 HistoryServiceFactory::GetForProfile( | 30 HistoryServiceFactory::GetForProfile( |
| 31 Profile::FromBrowserContext(web_contents->GetBrowserContext()), | 31 Profile::FromBrowserContext(web_contents->GetBrowserContext()), |
| 32 ServiceAccessType::EXPLICIT_ACCESS), | 32 ServiceAccessType::EXPLICIT_ACCESS), |
| 33 g_browser_process->rappor_service() | 33 g_browser_process->rappor_service() |
| 34 ? g_browser_process->rappor_service()->AsWeakPtr() | 34 ? g_browser_process->rappor_service()->AsWeakPtr() |
| 35 : base::WeakPtr<rappor::RapporService>()), | 35 : base::WeakPtr<rappor::RapporService>()), |
| 36 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) || defined(ENABLE_EXTENSIONS) |
| 36 web_contents_(web_contents), | 37 web_contents_(web_contents), |
| 38 #endif |
| 37 request_url_(request_url), | 39 request_url_(request_url), |
| 38 sampling_event_name_(sampling_event_name) { | 40 sampling_event_name_(sampling_event_name) { |
| 39 DCHECK(!sampling_event_name_.empty()); | 41 DCHECK(!sampling_event_name_.empty()); |
| 40 } | 42 } |
| 41 | 43 |
| 42 ChromeMetricsHelper::~ChromeMetricsHelper() {} | 44 ChromeMetricsHelper::~ChromeMetricsHelper() {} |
| 43 | 45 |
| 44 void ChromeMetricsHelper::StartRecordingCaptivePortalMetrics(bool overridable) { | 46 void ChromeMetricsHelper::StartRecordingCaptivePortalMetrics(bool overridable) { |
| 45 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) | 47 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) |
| 46 captive_portal_recorder_.reset( | 48 captive_portal_recorder_.reset( |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 case TOTAL_VISITS: | 108 case TOTAL_VISITS: |
| 107 case SET_EXTENDED_REPORTING_ENABLED: | 109 case SET_EXTENDED_REPORTING_ENABLED: |
| 108 case SET_EXTENDED_REPORTING_DISABLED: | 110 case SET_EXTENDED_REPORTING_DISABLED: |
| 109 case EXTENDED_REPORTING_IS_ENABLED: | 111 case EXTENDED_REPORTING_IS_ENABLED: |
| 110 case REPORT_PHISHING_ERROR: | 112 case REPORT_PHISHING_ERROR: |
| 111 case MAX_INTERACTION: | 113 case MAX_INTERACTION: |
| 112 break; | 114 break; |
| 113 } | 115 } |
| 114 #endif | 116 #endif |
| 115 } | 117 } |
| OLD | NEW |