OLD | NEW |
---|---|
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 984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
995 } | 995 } |
996 | 996 |
997 void BrowserProcessImpl::CreateSafeBrowsingDetectionService() { | 997 void BrowserProcessImpl::CreateSafeBrowsingDetectionService() { |
998 DCHECK(safe_browsing_detection_service_.get() == NULL); | 998 DCHECK(safe_browsing_detection_service_.get() == NULL); |
999 // Set this flag to true so that we don't retry indefinitely to | 999 // Set this flag to true so that we don't retry indefinitely to |
1000 // create the service class if there was an error. | 1000 // create the service class if there was an error. |
1001 created_safe_browsing_detection_service_ = true; | 1001 created_safe_browsing_detection_service_ = true; |
1002 | 1002 |
1003 FilePath model_file_dir; | 1003 FilePath model_file_dir; |
1004 Profile* profile = profile_manager() ? | 1004 Profile* profile = profile_manager() ? |
1005 profile_manager()->GetDefaultProfile() : NULL; | 1005 profile_manager()->GetDefaultProfile() : NULL; |
mattm
2011/06/23 21:40:40
Did you see my comment about the client side phish
Miranda Callahan
2011/07/07 17:35:50
Done.
| |
1006 if (IsSafeBrowsingDetectionServiceEnabled() && | 1006 if (IsSafeBrowsingDetectionServiceEnabled() && |
1007 PathService::Get(chrome::DIR_USER_DATA, &model_file_dir) && | 1007 PathService::Get(chrome::DIR_USER_DATA, &model_file_dir) && |
1008 profile && profile->GetRequestContext()) { | 1008 profile && |
1009 profile->GetPrefs()->GetBoolean(prefs::kSafeBrowsingEnabled) && | |
1010 profile->GetRequestContext()) { | |
1009 safe_browsing_detection_service_.reset( | 1011 safe_browsing_detection_service_.reset( |
1010 safe_browsing::ClientSideDetectionService::Create( | 1012 safe_browsing::ClientSideDetectionService::Create( |
1011 model_file_dir, profile->GetRequestContext())); | 1013 model_file_dir, profile->GetRequestContext())); |
mattm
2011/06/23 21:40:40
I think this should use the system request context
Miranda Callahan
2011/07/07 17:35:50
Done.
| |
1012 } | 1014 } |
1013 } | 1015 } |
1014 | 1016 |
1015 bool BrowserProcessImpl::IsSafeBrowsingDetectionServiceEnabled() { | 1017 bool BrowserProcessImpl::IsSafeBrowsingDetectionServiceEnabled() { |
1016 // The safe browsing client-side detection is enabled only if the switch is | 1018 // The safe browsing client-side detection is enabled only if the switch is |
1017 // not disabled and when safe browsing related stats are allowed to be | 1019 // not disabled and when safe browsing related stats are allowed to be |
1018 // collected. | 1020 // collected. |
1019 #ifdef OS_CHROMEOS | 1021 #ifdef OS_CHROMEOS |
1020 return false; | 1022 return false; |
1021 #else | 1023 #else |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1135 } | 1137 } |
1136 | 1138 |
1137 void BrowserProcessImpl::OnAutoupdateTimer() { | 1139 void BrowserProcessImpl::OnAutoupdateTimer() { |
1138 if (CanAutorestartForUpdate()) { | 1140 if (CanAutorestartForUpdate()) { |
1139 DLOG(WARNING) << "Detected update. Restarting browser."; | 1141 DLOG(WARNING) << "Detected update. Restarting browser."; |
1140 RestartPersistentInstance(); | 1142 RestartPersistentInstance(); |
1141 } | 1143 } |
1142 } | 1144 } |
1143 | 1145 |
1144 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1146 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
OLD | NEW |