OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/safe_browsing_service.h" | 5 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 | 322 |
323 if (!use_v4_only_) { | 323 if (!use_v4_only_) { |
324 database_manager_ = CreateDatabaseManager(); | 324 database_manager_ = CreateDatabaseManager(); |
325 } | 325 } |
326 | 326 |
327 if (base::FeatureList::IsEnabled( | 327 if (base::FeatureList::IsEnabled( |
328 SafeBrowsingNavigationObserverManager::kDownloadAttribution)) { | 328 SafeBrowsingNavigationObserverManager::kDownloadAttribution)) { |
329 navigation_observer_manager_ = new SafeBrowsingNavigationObserverManager(); | 329 navigation_observer_manager_ = new SafeBrowsingNavigationObserverManager(); |
330 } | 330 } |
331 | 331 |
| 332 services_delegate_->Initialize(v4_enabled_); |
| 333 services_delegate_->InitializeCsdService(url_request_context_getter_.get()); |
| 334 |
332 // TODO(jialiul): When PasswordProtectionService does more than reporting UMA, | 335 // TODO(jialiul): When PasswordProtectionService does more than reporting UMA, |
333 // we need to add finch trial to gate its functionality. | 336 // we need to add finch trial to gate its functionality. |
334 password_protection_service_ = | 337 password_protection_service_ = |
335 base::MakeUnique<PasswordProtectionService>(database_manager()); | 338 base::MakeUnique<PasswordProtectionService>(database_manager()); |
336 | 339 |
337 services_delegate_->Initialize(v4_enabled_); | |
338 services_delegate_->InitializeCsdService(url_request_context_getter_.get()); | |
339 | |
340 // Track the safe browsing preference of existing profiles. | 340 // Track the safe browsing preference of existing profiles. |
341 // The SafeBrowsingService will be started if any existing profile has the | 341 // The SafeBrowsingService will be started if any existing profile has the |
342 // preference enabled. It will also listen for updates to the preferences. | 342 // preference enabled. It will also listen for updates to the preferences. |
343 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 343 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
344 if (profile_manager) { | 344 if (profile_manager) { |
345 std::vector<Profile*> profiles = profile_manager->GetLoadedProfiles(); | 345 std::vector<Profile*> profiles = profile_manager->GetLoadedProfiles(); |
346 // TODO(felt): I believe this for-loop is dead code. Confirm this and | 346 // TODO(felt): I believe this for-loop is dead code. Confirm this and |
347 // remove in a future CL. See https://codereview.chromium.org/1341533002/ | 347 // remove in a future CL. See https://codereview.chromium.org/1341533002/ |
348 DCHECK_EQ(0u, profiles.size()); | 348 DCHECK_EQ(0u, profiles.size()); |
349 for (size_t i = 0; i < profiles.size(); ++i) { | 349 for (size_t i = 0; i < profiles.size(); ++i) { |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
767 ping_manager()->ReportThreatDetails(report); | 767 ping_manager()->ReportThreatDetails(report); |
768 } | 768 } |
769 | 769 |
770 void SafeBrowsingService::ProcessResourceRequest( | 770 void SafeBrowsingService::ProcessResourceRequest( |
771 const ResourceRequestInfo& request) { | 771 const ResourceRequestInfo& request) { |
772 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 772 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
773 services_delegate_->ProcessResourceRequest(&request); | 773 services_delegate_->ProcessResourceRequest(&request); |
774 } | 774 } |
775 | 775 |
776 } // namespace safe_browsing | 776 } // namespace safe_browsing |
OLD | NEW |