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

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: addressed sky's nit 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 92179)
+++ 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,8 @@
old_bindings |= BindingsPolicy::DOM_AUTOMATION);
}
render_view->webview()->setPermissionClient(this);
+ if (!command_line.HasSwitch(switches::kDisableClientSidePhishingDetection))
+ OnSetClientSidePhishingDetection(true);
}
ChromeRenderViewObserver::~ChromeRenderViewObserver() {
@@ -200,6 +201,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 +342,16 @@
OnSetAllowDisplayingInsecureContent(allow);
}
+void ChromeRenderViewObserver::OnSetClientSidePhishingDetection(
+ bool enable_phishing_detection) {
+#if !defined(OS_CHROMEOS) || !defined(ENABLE_SAFE_BROWSING)
+ phishing_classifier_ = enable_phishing_detection ?
+ safe_browsing::PhishingClassifierDelegate::Create(
+ render_view(), NULL) :
+ NULL;
+#endif
+}
+
void ChromeRenderViewObserver::didSerializeDataForFrame(
const WebURL& frame_url,
const WebCString& data,
« no previous file with comments | « chrome/renderer/chrome_render_view_observer.h ('k') | content/browser/renderer_host/resource_dispatcher_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698