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

Unified Diff: chrome/renderer/chrome_render_view_observer.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/renderer/chrome_render_view_observer.cc
===================================================================
--- chrome/renderer/chrome_render_view_observer.cc (revision 91725)
+++ chrome/renderer/chrome_render_view_observer.cc (working copy)
@@ -158,13 +158,12 @@
RenderView* render_view,
ContentSettingsObserver* content_settings,
ExtensionDispatcher* extension_dispatcher,
- TranslateHelper* translate_helper,
- safe_browsing::PhishingClassifierDelegate* phishing_classifier)
+ TranslateHelper* translate_helper)
: RenderViewObserver(render_view),
content_settings_(content_settings),
extension_dispatcher_(extension_dispatcher),
translate_helper_(translate_helper),
- phishing_classifier_(phishing_classifier),
+ phishing_classifier_(NULL),
last_indexed_page_id_(-1),
allow_displaying_insecure_content_(false),
allow_running_insecure_content_(false),
@@ -176,6 +175,7 @@
old_bindings |= BindingsPolicy::DOM_AUTOMATION);
}
render_view->webview()->setPermissionClient(this);
+ OnSetClientSidePhishingDetection(true);
}
ChromeRenderViewObserver::~ChromeRenderViewObserver() {
@@ -200,6 +200,8 @@
OnSetAllowDisplayingInsecureContent)
IPC_MESSAGE_HANDLER(ViewMsg_SetAllowRunningInsecureContent,
OnSetAllowRunningInsecureContent)
+ IPC_MESSAGE_HANDLER(ViewMsg_SetClientSidePhishingDetection,
+ OnSetClientSidePhishingDetection)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -339,6 +341,19 @@
OnSetAllowDisplayingInsecureContent(allow);
}
+void ChromeRenderViewObserver::OnSetClientSidePhishingDetection(
+ bool enable_phishing_detection) {
+#ifndef OS_CHROMEOS
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableClientSidePhishingDetection)) {
mattm 2011/07/08 22:15:24 Hm, since we use the switch to set the initial sta
Miranda Callahan 2011/07/12 16:24:08 Done.
+ phishing_classifier_ = enable_phishing_detection ?
+ safe_browsing::PhishingClassifierDelegate::Create(
+ render_view(), NULL) :
+ NULL;
+ }
+#endif
+}
+
void ChromeRenderViewObserver::didSerializeDataForFrame(
const WebURL& frame_url,
const WebCString& data,

Powered by Google App Engine
This is Rietveld 408576698