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

Side by Side Diff: chrome/browser/browser_process_impl.cc

Issue 7134017: Make safe browsing work in a multi-profile environment. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: fix incognito browser tests Created 9 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/browser_process_impl.h" 5 #include "chrome/browser/browser_process_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after
955 print_preview_tab_controller_ = new printing::PrintPreviewTabController(); 955 print_preview_tab_controller_ = new printing::PrintPreviewTabController();
956 } 956 }
957 957
958 void BrowserProcessImpl::CreateBackgroundPrintingManager() { 958 void BrowserProcessImpl::CreateBackgroundPrintingManager() {
959 DCHECK(background_printing_manager_.get() == NULL); 959 DCHECK(background_printing_manager_.get() == NULL);
960 background_printing_manager_.reset(new printing::BackgroundPrintingManager()); 960 background_printing_manager_.reset(new printing::BackgroundPrintingManager());
961 } 961 }
962 962
963 void BrowserProcessImpl::CreateSafeBrowsingService() { 963 void BrowserProcessImpl::CreateSafeBrowsingService() {
964 DCHECK(safe_browsing_service_.get() == NULL); 964 DCHECK(safe_browsing_service_.get() == NULL);
965 // Set this flag to true so that we don't retry indefinitely to
966 // create the service class if there was an error.
965 created_safe_browsing_service_ = true; 967 created_safe_browsing_service_ = true;
966 safe_browsing_service_ = SafeBrowsingService::CreateSafeBrowsingService(); 968 safe_browsing_service_ = SafeBrowsingService::CreateSafeBrowsingService();
967 safe_browsing_service_->Initialize(); 969 safe_browsing_service_->Initialize();
968 } 970 }
969 971
970 void BrowserProcessImpl::CreateSafeBrowsingDetectionService() { 972 void BrowserProcessImpl::CreateSafeBrowsingDetectionService() {
971 DCHECK(safe_browsing_detection_service_.get() == NULL); 973 DCHECK(safe_browsing_detection_service_.get() == NULL);
972 // Set this flag to true so that we don't retry indefinitely to 974 // Set this flag to true so that we don't retry indefinitely to
973 // create the service class if there was an error. 975 // create the service class if there was an error.
974 created_safe_browsing_detection_service_ = true; 976 created_safe_browsing_detection_service_ = true;
975 977
976 FilePath model_file_dir; 978 FilePath model_file_dir;
977 Profile* profile = profile_manager() ?
978 profile_manager()->GetDefaultProfile() : NULL;
979 if (IsSafeBrowsingDetectionServiceEnabled() && 979 if (IsSafeBrowsingDetectionServiceEnabled() &&
980 PathService::Get(chrome::DIR_USER_DATA, &model_file_dir) && 980 PathService::Get(chrome::DIR_USER_DATA, &model_file_dir)) {
981 profile && profile->GetRequestContext()) {
982 safe_browsing_detection_service_.reset( 981 safe_browsing_detection_service_.reset(
983 safe_browsing::ClientSideDetectionService::Create( 982 safe_browsing::ClientSideDetectionService::Create(
984 model_file_dir, profile->GetRequestContext())); 983 model_file_dir, g_browser_process->system_request_context()));
985 } 984 }
986 } 985 }
987 986
988 bool BrowserProcessImpl::IsSafeBrowsingDetectionServiceEnabled() { 987 bool BrowserProcessImpl::IsSafeBrowsingDetectionServiceEnabled() {
989 // The safe browsing client-side detection is enabled only if the switch is 988 // The safe browsing client-side detection is enabled only if the switch is
990 // not disabled and when safe browsing related stats are allowed to be 989 // not disabled and when safe browsing related stats are allowed to be
991 // collected. 990 // collected.
992 #ifdef OS_CHROMEOS 991 #ifdef OS_CHROMEOS
993 return false; 992 return false;
994 #else 993 #else
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
1108 } 1107 }
1109 1108
1110 void BrowserProcessImpl::OnAutoupdateTimer() { 1109 void BrowserProcessImpl::OnAutoupdateTimer() {
1111 if (CanAutorestartForUpdate()) { 1110 if (CanAutorestartForUpdate()) {
1112 DLOG(WARNING) << "Detected update. Restarting browser."; 1111 DLOG(WARNING) << "Detected update. Restarting browser.";
1113 RestartPersistentInstance(); 1112 RestartPersistentInstance();
1114 } 1113 }
1115 } 1114 }
1116 1115
1117 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) 1116 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698