| 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));
|
| + }
|
| // Note: csd_service_ and sb_service_ might be NULL.
|
| sb_service_ = g_browser_process->safe_browsing_service();
|
| registrar_.Add(this, NotificationType::RESOURCE_RESPONSE_STARTED,
|
|
|