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

Unified Diff: chrome/browser/safe_browsing/client_side_detection_host.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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/safe_browsing/client_side_detection_host.cc
===================================================================
--- chrome/browser/safe_browsing/client_side_detection_host.cc (revision 91583)
+++ chrome/browser/safe_browsing/client_side_detection_host.cc (working copy)
@@ -12,11 +12,13 @@
#include "base/metrics/histogram.h"
#include "base/task.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/safe_browsing/browser_feature_extractor.h"
#include "chrome/browser/safe_browsing/client_side_detection_service.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/pref_names.h"
#include "chrome/common/safe_browsing/csd.pb.h"
#include "chrome/common/safe_browsing/safebrowsing_messages.h"
#include "content/browser/browser_thread.h"
@@ -266,13 +268,15 @@
ClientSideDetectionHost::ClientSideDetectionHost(TabContents* tab)
: TabContentsObserver(tab),
- csd_service_(g_browser_process->safe_browsing_detection_service()),
- feature_extractor_(
- new BrowserFeatureExtractor(
- tab,
- g_browser_process->safe_browsing_detection_service())),
cb_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
DCHECK(tab);
+ if (tab->profile()->GetPrefs()->GetBoolean(prefs::kSafeBrowsingEnabled)) {
+ csd_service_ = g_browser_process->safe_browsing_detection_service();
+ feature_extractor_.reset(new BrowserFeatureExtractor(tab, csd_service_));
+ } else {
+ csd_service_ = NULL;
+ feature_extractor_.reset(new BrowserFeatureExtractor(tab, NULL));
mattm 2011/07/07 21:34:55 I don't think we need to create the BrowserFeature
Miranda Callahan 2011/07/08 14:48:46 Done.
+ }
// Note: csd_service_ and sb_service_ might be NULL.
sb_service_ = g_browser_process->safe_browsing_service();
registrar_.Add(this, NotificationType::RESOURCE_RESPONSE_STARTED,

Powered by Google App Engine
This is Rietveld 408576698