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

Unified Diff: chrome/browser/ui/tab_contents/tab_contents_wrapper.cc

Issue 7134017: Make safe browsing work in a multi-profile environment. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: a few tweaks in initialization &c 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/ui/tab_contents/tab_contents_wrapper.cc
===================================================================
--- chrome/browser/ui/tab_contents/tab_contents_wrapper.cc (revision 91725)
+++ chrome/browser/ui/tab_contents/tab_contents_wrapper.cc (working copy)
@@ -74,6 +74,7 @@
prefs::kDefaultCharset,
prefs::kDefaultZoomLevel,
prefs::kEnableReferrers,
+ prefs::kSafeBrowsingEnabled,
prefs::kWebKitAllowDisplayingInsecureContent,
prefs::kWebKitAllowRunningInsecureContent,
prefs::kWebKitDefaultFixedFontSize,
@@ -455,6 +456,8 @@
routing_id(), tab_contents()->GetZoomLevel()));
} else if (*pref_name_in == prefs::kEnableReferrers) {
UpdateRendererPreferences();
+ } else if (*pref_name_in == prefs::kSafeBrowsingEnabled) {
+ UpdateSafebrowsingDetectionHost();
mattm 2011/07/08 22:15:24 Just thought of one thing.. this is fine with this
Miranda Callahan 2011/07/12 16:24:08 Good point, yes -- made a note of this in 88661.
} else {
NOTREACHED() << "unexpected pref change notification" << *pref_name_in;
}
@@ -628,6 +631,21 @@
render_view_host()->SyncRendererPrefs();
}
+void TabContentsWrapper::UpdateSafebrowsingDetectionHost() {
+ PrefService* prefs = profile()->GetPrefs();
+ bool safe_browsing = prefs->GetBoolean(prefs::kSafeBrowsingEnabled);
mattm 2011/07/08 22:15:24 Should also check g_browser_process->safe_browsing
Miranda Callahan 2011/07/12 16:24:08 Done.
+ if (safe_browsing) {
+ if (!safebrowsing_detection_host_.get()) {
+ safebrowsing_detection_host_.reset(
+ safe_browsing::ClientSideDetectionHost::Create(tab_contents()));
+ }
+ } else {
+ safebrowsing_detection_host_.reset();
+ }
+ render_view_host()->Send(
+ new ViewMsg_SetClientSidePhishingDetection(routing_id(), safe_browsing));
+}
+
void TabContentsWrapper::RemoveInfoBarInternal(InfoBarDelegate* delegate,
bool animate) {
if (!infobars_enabled_) {

Powered by Google App Engine
This is Rietveld 408576698