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

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

Issue 6995092: Enable client-side phishing detection for release builds. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Remove unnecessary include Created 9 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 23 matching lines...) Expand all
34 #include "chrome/browser/google/google_url_tracker.h" 34 #include "chrome/browser/google/google_url_tracker.h"
35 #include "chrome/browser/icon_manager.h" 35 #include "chrome/browser/icon_manager.h"
36 #include "chrome/browser/intranet_redirect_detector.h" 36 #include "chrome/browser/intranet_redirect_detector.h"
37 #include "chrome/browser/io_thread.h" 37 #include "chrome/browser/io_thread.h"
38 #include "chrome/browser/metrics/metrics_service.h" 38 #include "chrome/browser/metrics/metrics_service.h"
39 #include "chrome/browser/metrics/thread_watcher.h" 39 #include "chrome/browser/metrics/thread_watcher.h"
40 #include "chrome/browser/net/chrome_net_log.h" 40 #include "chrome/browser/net/chrome_net_log.h"
41 #include "chrome/browser/net/predictor_api.h" 41 #include "chrome/browser/net/predictor_api.h"
42 #include "chrome/browser/net/sdch_dictionary_fetcher.h" 42 #include "chrome/browser/net/sdch_dictionary_fetcher.h"
43 #include "chrome/browser/notifications/notification_ui_manager.h" 43 #include "chrome/browser/notifications/notification_ui_manager.h"
44 #include "chrome/browser/platform_util.h"
45 #include "chrome/browser/plugin_data_remover.h" 44 #include "chrome/browser/plugin_data_remover.h"
46 #include "chrome/browser/policy/browser_policy_connector.h" 45 #include "chrome/browser/policy/browser_policy_connector.h"
47 #include "chrome/browser/prefs/browser_prefs.h" 46 #include "chrome/browser/prefs/browser_prefs.h"
48 #include "chrome/browser/prefs/pref_service.h" 47 #include "chrome/browser/prefs/pref_service.h"
49 #include "chrome/browser/prerender/prerender_tracker.h" 48 #include "chrome/browser/prerender/prerender_tracker.h"
50 #include "chrome/browser/printing/background_printing_manager.h" 49 #include "chrome/browser/printing/background_printing_manager.h"
51 #include "chrome/browser/printing/print_job_manager.h" 50 #include "chrome/browser/printing/print_job_manager.h"
52 #include "chrome/browser/printing/print_preview_tab_controller.h" 51 #include "chrome/browser/printing/print_preview_tab_controller.h"
53 #include "chrome/browser/profiles/profile_manager.h" 52 #include "chrome/browser/profiles/profile_manager.h"
54 #include "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate. h" 53 #include "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate. h"
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after
1004 safe_browsing::ClientSideDetectionService::Create( 1003 safe_browsing::ClientSideDetectionService::Create(
1005 model_file_path.Append(chrome::kSafeBrowsingPhishingModelFilename), 1004 model_file_path.Append(chrome::kSafeBrowsingPhishingModelFilename),
1006 profile->GetRequestContext())); 1005 profile->GetRequestContext()));
1007 } 1006 }
1008 } 1007 }
1009 1008
1010 bool BrowserProcessImpl::IsSafeBrowsingDetectionServiceEnabled() { 1009 bool BrowserProcessImpl::IsSafeBrowsingDetectionServiceEnabled() {
1011 // The safe browsing client-side detection is enabled only if the switch is 1010 // The safe browsing client-side detection is enabled only if the switch is
1012 // enabled and when safe browsing related stats is allowed to be collected. 1011 // enabled and when safe browsing related stats is allowed to be collected.
1013 // For now we only enable client-side detection on the canary, dev and beta 1012 // For now we only enable client-side detection on the canary, dev and beta
1014 // channel. 1013 // channel.
mattm 2011/06/09 20:07:02 Comment needs updating. Maybe add something about
noelutz 2011/06/09 21:13:41 Done.
1015 #ifdef OS_CHROMEOS 1014 #ifdef OS_CHROMEOS
1016 return false; 1015 return false;
1017 #else 1016 #else
1018 std::string channel = platform_util::GetVersionStringModifier();
1019 return !CommandLine::ForCurrentProcess()->HasSwitch( 1017 return !CommandLine::ForCurrentProcess()->HasSwitch(
1020 switches::kDisableClientSidePhishingDetection) && 1018 switches::kDisableClientSidePhishingDetection) &&
1021 safe_browsing_service() && 1019 safe_browsing_service() &&
1022 safe_browsing_service()->CanReportStats() && 1020 safe_browsing_service()->CanReportStats();
1023 // TODO(noelutz): use platform_util::GetChannel() once it has been
1024 // pushed to the release branch.
1025 (channel == "beta" || channel == "dev" || channel == "canary" ||
1026 channel == "beta-m" || channel == "dev-m" || channel == "canary-m");
1027
1028 #endif 1021 #endif
1029 } 1022 }
1030 1023
1031 void BrowserProcessImpl::ApplyDisabledSchemesPolicy() { 1024 void BrowserProcessImpl::ApplyDisabledSchemesPolicy() {
1032 std::set<std::string> schemes; 1025 std::set<std::string> schemes;
1033 const ListValue* scheme_list = local_state_->GetList(prefs::kDisabledSchemes); 1026 const ListValue* scheme_list = local_state_->GetList(prefs::kDisabledSchemes);
1034 for (ListValue::const_iterator iter = scheme_list->begin(); 1027 for (ListValue::const_iterator iter = scheme_list->begin();
1035 iter != scheme_list->end(); ++iter) { 1028 iter != scheme_list->end(); ++iter) {
1036 std::string scheme; 1029 std::string scheme;
1037 if ((*iter)->GetAsString(&scheme)) 1030 if ((*iter)->GetAsString(&scheme))
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
1137 } 1130 }
1138 1131
1139 void BrowserProcessImpl::OnAutoupdateTimer() { 1132 void BrowserProcessImpl::OnAutoupdateTimer() {
1140 if (CanAutorestartForUpdate()) { 1133 if (CanAutorestartForUpdate()) {
1141 DLOG(WARNING) << "Detected update. Restarting browser."; 1134 DLOG(WARNING) << "Detected update. Restarting browser.";
1142 RestartPersistentInstance(); 1135 RestartPersistentInstance();
1143 } 1136 }
1144 } 1137 }
1145 1138
1146 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) 1139 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698