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

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

Issue 6708059: Turn on client-side phishing detection for UMA users with SafeBrowsing enabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 9 years, 9 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 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after
928 safe_browsing_detection_service_.reset( 928 safe_browsing_detection_service_.reset(
929 safe_browsing::ClientSideDetectionService::Create( 929 safe_browsing::ClientSideDetectionService::Create(
930 model_file_path.Append(chrome::kSafeBrowsingPhishingModelFilename), 930 model_file_path.Append(chrome::kSafeBrowsingPhishingModelFilename),
931 profile->GetRequestContext())); 931 profile->GetRequestContext()));
932 } 932 }
933 } 933 }
934 934
935 bool BrowserProcessImpl::IsSafeBrowsingDetectionServiceEnabled() { 935 bool BrowserProcessImpl::IsSafeBrowsingDetectionServiceEnabled() {
936 // The safe browsing client-side detection is enabled only if the switch is 936 // The safe browsing client-side detection is enabled only if the switch is
937 // enabled and when safe browsing related stats is allowed to be collected. 937 // enabled and when safe browsing related stats is allowed to be collected.
938 return CommandLine::ForCurrentProcess()->HasSwitch( 938 return !CommandLine::ForCurrentProcess()->HasSwitch(
939 switches::kEnableClientSidePhishingDetection) && 939 switches::kDisableClientSidePhishingDetection) &&
940 resource_dispatcher_host()->safe_browsing_service() && 940 resource_dispatcher_host()->safe_browsing_service() &&
941 resource_dispatcher_host()->safe_browsing_service()->CanReportStats(); 941 resource_dispatcher_host()->safe_browsing_service()->CanReportStats();
942 } 942 }
943 943
944 // The BrowserProcess object must outlive the file thread so we use traits 944 // The BrowserProcess object must outlive the file thread so we use traits
945 // which don't do any management. 945 // which don't do any management.
946 DISABLE_RUNNABLE_METHOD_REFCOUNT(BrowserProcessImpl); 946 DISABLE_RUNNABLE_METHOD_REFCOUNT(BrowserProcessImpl);
947 947
948 #if defined(IPC_MESSAGE_LOG_ENABLED) 948 #if defined(IPC_MESSAGE_LOG_ENABLED)
949 949
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
1033 } 1033 }
1034 1034
1035 void BrowserProcessImpl::OnAutoupdateTimer() { 1035 void BrowserProcessImpl::OnAutoupdateTimer() {
1036 if (CanAutorestartForUpdate()) { 1036 if (CanAutorestartForUpdate()) {
1037 DLOG(WARNING) << "Detected update. Restarting browser."; 1037 DLOG(WARNING) << "Detected update. Restarting browser.";
1038 RestartPersistentInstance(); 1038 RestartPersistentInstance();
1039 } 1039 }
1040 } 1040 }
1041 1041
1042 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) 1042 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698