Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Side by Side Diff: chrome/browser/safe_browsing/safe_browsing_service.cc

Issue 2855643002: Very basic change to add a TriggerManager class owned by SafeBrowsingService. (Closed)
Patch Set: Fix copyright date Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 21 matching lines...) Expand all
32 #include "chrome/browser/safe_browsing/safe_browsing_navigation_observer_manager .h" 32 #include "chrome/browser/safe_browsing/safe_browsing_navigation_observer_manager .h"
33 #include "chrome/browser/safe_browsing/ui_manager.h" 33 #include "chrome/browser/safe_browsing/ui_manager.h"
34 #include "chrome/common/chrome_paths.h" 34 #include "chrome/common/chrome_paths.h"
35 #include "chrome/common/chrome_switches.h" 35 #include "chrome/common/chrome_switches.h"
36 #include "chrome/common/pref_names.h" 36 #include "chrome/common/pref_names.h"
37 #include "chrome/common/safe_browsing/file_type_policies.h" 37 #include "chrome/common/safe_browsing/file_type_policies.h"
38 #include "components/prefs/pref_change_registrar.h" 38 #include "components/prefs/pref_change_registrar.h"
39 #include "components/prefs/pref_service.h" 39 #include "components/prefs/pref_service.h"
40 #include "components/safe_browsing/common/safebrowsing_constants.h" 40 #include "components/safe_browsing/common/safebrowsing_constants.h"
41 #include "components/safe_browsing/common/safebrowsing_switches.h" 41 #include "components/safe_browsing/common/safebrowsing_switches.h"
42 #include "components/safe_browsing/triggers/trigger_manager.h"
42 #include "components/safe_browsing_db/database_manager.h" 43 #include "components/safe_browsing_db/database_manager.h"
43 #include "components/safe_browsing_db/v4_feature_list.h" 44 #include "components/safe_browsing_db/v4_feature_list.h"
44 #include "components/safe_browsing_db/v4_get_hash_protocol_manager.h" 45 #include "components/safe_browsing_db/v4_get_hash_protocol_manager.h"
45 #include "components/safe_browsing_db/v4_local_database_manager.h" 46 #include "components/safe_browsing_db/v4_local_database_manager.h"
46 #include "content/public/browser/browser_thread.h" 47 #include "content/public/browser/browser_thread.h"
47 #include "content/public/browser/cookie_store_factory.h" 48 #include "content/public/browser/cookie_store_factory.h"
48 #include "content/public/browser/notification_service.h" 49 #include "content/public/browser/notification_service.h"
49 #include "content/public/browser/resource_request_info.h" 50 #include "content/public/browser/resource_request_info.h"
50 #include "google_apis/google_api_keys.h" 51 #include "google_apis/google_api_keys.h"
51 #include "net/cookies/cookie_store.h" 52 #include "net/cookies/cookie_store.h"
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 323
323 if (!use_v4_only_) { 324 if (!use_v4_only_) {
324 database_manager_ = CreateDatabaseManager(); 325 database_manager_ = CreateDatabaseManager();
325 } 326 }
326 327
327 navigation_observer_manager_ = new SafeBrowsingNavigationObserverManager(); 328 navigation_observer_manager_ = new SafeBrowsingNavigationObserverManager();
328 329
329 services_delegate_->Initialize(v4_enabled_); 330 services_delegate_->Initialize(v4_enabled_);
330 services_delegate_->InitializeCsdService(url_request_context_getter_.get()); 331 services_delegate_->InitializeCsdService(url_request_context_getter_.get());
331 332
333 CreateTriggerManager();
334
332 // Track profile creation and destruction. 335 // Track profile creation and destruction.
333 profiles_registrar_.Add(this, chrome::NOTIFICATION_PROFILE_CREATED, 336 profiles_registrar_.Add(this, chrome::NOTIFICATION_PROFILE_CREATED,
334 content::NotificationService::AllSources()); 337 content::NotificationService::AllSources());
335 profiles_registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED, 338 profiles_registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED,
336 content::NotificationService::AllSources()); 339 content::NotificationService::AllSources());
337 340
338 // Register all the delayed analysis to the incident reporting service. 341 // Register all the delayed analysis to the incident reporting service.
339 RegisterAllDelayedAnalysis(); 342 RegisterAllDelayedAnalysis();
340 } 343 }
341 344
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
769 } 772 }
770 773
771 void SafeBrowsingService::RemovePasswordProtectionService(Profile* profile) { 774 void SafeBrowsingService::RemovePasswordProtectionService(Profile* profile) {
772 DCHECK_CURRENTLY_ON(BrowserThread::UI); 775 DCHECK_CURRENTLY_ON(BrowserThread::UI);
773 DCHECK(profile); 776 DCHECK(profile);
774 auto it = password_protection_service_map_.find(profile); 777 auto it = password_protection_service_map_.find(profile);
775 if (it != password_protection_service_map_.end()) 778 if (it != password_protection_service_map_.end())
776 password_protection_service_map_.erase(it); 779 password_protection_service_map_.erase(it);
777 } 780 }
778 781
782 void SafeBrowsingService::CreateTriggerManager() {
783 DCHECK_CURRENTLY_ON(BrowserThread::UI);
784 trigger_manager_ = base::MakeUnique<TriggerManager>();
785 }
779 } // namespace safe_browsing 786 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_service.h ('k') | components/safe_browsing/triggers/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698