| 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 | 8 | 
| 9 #include "app/clipboard/clipboard.h" | 9 #include "app/clipboard/clipboard.h" | 
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" | 
| (...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 799       profile && profile->GetRequestContext()) { | 799       profile && profile->GetRequestContext()) { | 
| 800     safe_browsing_detection_service_.reset( | 800     safe_browsing_detection_service_.reset( | 
| 801         safe_browsing::ClientSideDetectionService::Create( | 801         safe_browsing::ClientSideDetectionService::Create( | 
| 802             model_file_path.Append(chrome::kSafeBrowsingPhishingModelFilename), | 802             model_file_path.Append(chrome::kSafeBrowsingPhishingModelFilename), | 
| 803             profile->GetRequestContext())); | 803             profile->GetRequestContext())); | 
| 804   } | 804   } | 
| 805 } | 805 } | 
| 806 | 806 | 
| 807 bool BrowserProcessImpl::IsSafeBrowsingDetectionServiceEnabled() { | 807 bool BrowserProcessImpl::IsSafeBrowsingDetectionServiceEnabled() { | 
| 808   // The safe browsing client-side detection is enabled only if the switch is | 808   // The safe browsing client-side detection is enabled only if the switch is | 
| 809   // enabled, the user has opted in to UMA usage stats and SafeBrowsing | 809   // enabled and when safe browsing related stats is allowed to be collected. | 
| 810   // is enabled. | 810   return CommandLine::ForCurrentProcess()->HasSwitch( | 
| 811   Profile* profile = profile_manager() ? | 811       switches::kEnableClientSidePhishingDetection) && | 
| 812       profile_manager()->GetDefaultProfile() : NULL; | 812       resource_dispatcher_host()->safe_browsing_service() && | 
| 813   return (CommandLine::ForCurrentProcess()->HasSwitch( | 813       resource_dispatcher_host()->safe_browsing_service()->CanReportStats(); | 
| 814               switches::kEnableClientSidePhishingDetection) && |  | 
| 815           metrics_service() && metrics_service()->reporting_active() && |  | 
| 816           profile && profile->GetPrefs() && |  | 
| 817           profile->GetPrefs()->GetBoolean(prefs::kSafeBrowsingEnabled)); |  | 
| 818 } | 814 } | 
| 819 | 815 | 
| 820 // The BrowserProcess object must outlive the file thread so we use traits | 816 // The BrowserProcess object must outlive the file thread so we use traits | 
| 821 // which don't do any management. | 817 // which don't do any management. | 
| 822 DISABLE_RUNNABLE_METHOD_REFCOUNT(BrowserProcessImpl); | 818 DISABLE_RUNNABLE_METHOD_REFCOUNT(BrowserProcessImpl); | 
| 823 | 819 | 
| 824 #if defined(IPC_MESSAGE_LOG_ENABLED) | 820 #if defined(IPC_MESSAGE_LOG_ENABLED) | 
| 825 | 821 | 
| 826 void BrowserProcessImpl::SetIPCLoggingEnabled(bool enable) { | 822 void BrowserProcessImpl::SetIPCLoggingEnabled(bool enable) { | 
| 827   // First enable myself. | 823   // First enable myself. | 
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 922 } | 918 } | 
| 923 | 919 | 
| 924 void BrowserProcessImpl::OnAutoupdateTimer() { | 920 void BrowserProcessImpl::OnAutoupdateTimer() { | 
| 925   if (CanAutorestartForUpdate()) { | 921   if (CanAutorestartForUpdate()) { | 
| 926     DLOG(WARNING) << "Detected update.  Restarting browser."; | 922     DLOG(WARNING) << "Detected update.  Restarting browser."; | 
| 927     RestartPersistentInstance(); | 923     RestartPersistentInstance(); | 
| 928   } | 924   } | 
| 929 } | 925 } | 
| 930 | 926 | 
| 931 #endif  // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 927 #endif  // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 
| OLD | NEW | 
|---|