Chromium Code Reviews| 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, |