OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/safe_browsing/services_delegate_impl.h" | 5 #include "chrome/browser/safe_browsing/services_delegate_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
11 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
12 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 12 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
13 #include "chrome/common/chrome_switches.h" | 13 #include "chrome/common/chrome_switches.h" |
14 #include "components/safe_browsing_db/v4_local_database_manager.h" | 14 #include "components/safe_browsing_db/v4_local_database_manager.h" |
15 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
| 16 #include "services/preferences/public/interfaces/tracked_preference_validation_d
elegate.mojom.h" |
16 | 17 |
17 namespace safe_browsing { | 18 namespace safe_browsing { |
18 | 19 |
19 // static | 20 // static |
20 std::unique_ptr<ServicesDelegate> ServicesDelegate::Create( | 21 std::unique_ptr<ServicesDelegate> ServicesDelegate::Create( |
21 SafeBrowsingService* safe_browsing_service) { | 22 SafeBrowsingService* safe_browsing_service) { |
22 return base::WrapUnique( | 23 return base::WrapUnique( |
23 new ServicesDelegateImpl(safe_browsing_service, nullptr)); | 24 new ServicesDelegateImpl(safe_browsing_service, nullptr)); |
24 } | 25 } |
25 | 26 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 download_service_->SetEnabled(enable); | 114 download_service_->SetEnabled(enable); |
114 } | 115 } |
115 | 116 |
116 void ServicesDelegateImpl::ProcessResourceRequest( | 117 void ServicesDelegateImpl::ProcessResourceRequest( |
117 const ResourceRequestInfo* request) { | 118 const ResourceRequestInfo* request) { |
118 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 119 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
119 if (resource_request_detector_) | 120 if (resource_request_detector_) |
120 resource_request_detector_->ProcessResourceRequest(request); | 121 resource_request_detector_->ProcessResourceRequest(request); |
121 } | 122 } |
122 | 123 |
123 std::unique_ptr<TrackedPreferenceValidationDelegate> | 124 std::unique_ptr<prefs::mojom::TrackedPreferenceValidationDelegate> |
124 ServicesDelegateImpl::CreatePreferenceValidationDelegate(Profile* profile) { | 125 ServicesDelegateImpl::CreatePreferenceValidationDelegate(Profile* profile) { |
125 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 126 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
126 return incident_service_->CreatePreferenceValidationDelegate(profile); | 127 return incident_service_->CreatePreferenceValidationDelegate(profile); |
127 } | 128 } |
128 | 129 |
129 void ServicesDelegateImpl::RegisterDelayedAnalysisCallback( | 130 void ServicesDelegateImpl::RegisterDelayedAnalysisCallback( |
130 const DelayedAnalysisCallback& callback) { | 131 const DelayedAnalysisCallback& callback) { |
131 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 132 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
132 incident_service_->RegisterDelayedAnalysisCallback(callback); | 133 incident_service_->RegisterDelayedAnalysisCallback(callback); |
133 } | 134 } |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 } | 173 } |
173 } | 174 } |
174 | 175 |
175 void ServicesDelegateImpl::StopOnIOThread(bool shutdown) { | 176 void ServicesDelegateImpl::StopOnIOThread(bool shutdown) { |
176 if (v4_local_database_manager_.get()) { | 177 if (v4_local_database_manager_.get()) { |
177 v4_local_database_manager_->StopOnIOThread(shutdown); | 178 v4_local_database_manager_->StopOnIOThread(shutdown); |
178 } | 179 } |
179 } | 180 } |
180 | 181 |
181 } // namespace safe_browsing | 182 } // namespace safe_browsing |
OLD | NEW |