OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/renderer/chrome_content_renderer_client.h" | 5 #include "chrome/renderer/chrome_content_renderer_client.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 | 190 |
191 WebString internal_scheme(ASCIIToUTF16(chrome::kChromeInternalScheme)); | 191 WebString internal_scheme(ASCIIToUTF16(chrome::kChromeInternalScheme)); |
192 WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(internal_scheme); | 192 WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(internal_scheme); |
193 | 193 |
194 // chrome-extension: resources shouldn't trigger insecure content warnings. | 194 // chrome-extension: resources shouldn't trigger insecure content warnings. |
195 WebString extension_scheme(ASCIIToUTF16(chrome::kExtensionScheme)); | 195 WebString extension_scheme(ASCIIToUTF16(chrome::kExtensionScheme)); |
196 WebSecurityPolicy::registerURLSchemeAsSecure(extension_scheme); | 196 WebSecurityPolicy::registerURLSchemeAsSecure(extension_scheme); |
197 } | 197 } |
198 | 198 |
199 void ChromeContentRendererClient::RenderViewCreated(RenderView* render_view) { | 199 void ChromeContentRendererClient::RenderViewCreated(RenderView* render_view) { |
200 safe_browsing::PhishingClassifierDelegate* phishing_classifier = NULL; | |
201 #if defined(ENABLE_SAFE_BROWSING) && !defined(OS_CHROMEOS) | |
202 if (!CommandLine::ForCurrentProcess()->HasSwitch( | |
203 switches::kDisableClientSidePhishingDetection)) { | |
204 phishing_classifier = | |
205 safe_browsing::PhishingClassifierDelegate::Create(render_view, NULL); | |
206 } | |
207 #endif | |
208 | |
209 ContentSettingsObserver* content_settings = | 200 ContentSettingsObserver* content_settings = |
210 new ContentSettingsObserver(render_view); | 201 new ContentSettingsObserver(render_view); |
211 new DevToolsAgent(render_view); | 202 new DevToolsAgent(render_view); |
212 new ExtensionHelper(render_view, extension_dispatcher_.get()); | 203 new ExtensionHelper(render_view, extension_dispatcher_.get()); |
213 new MHTMLGenerator(render_view); | 204 new MHTMLGenerator(render_view); |
214 new PageLoadHistograms(render_view, histogram_snapshots_.get()); | 205 new PageLoadHistograms(render_view, histogram_snapshots_.get()); |
215 new PrintWebViewHelper(render_view); | 206 new PrintWebViewHelper(render_view); |
216 new SearchBox(render_view); | 207 new SearchBox(render_view); |
217 new SpellCheckProvider(render_view, spellcheck_.get()); | 208 new SpellCheckProvider(render_view, spellcheck_.get()); |
218 #if defined(ENABLE_SAFE_BROWSING) | 209 #if defined(ENABLE_SAFE_BROWSING) |
(...skipping 10 matching lines...) Expand all Loading... |
229 password_autofill_manager); | 220 password_autofill_manager); |
230 PageClickTracker* page_click_tracker = new PageClickTracker(render_view); | 221 PageClickTracker* page_click_tracker = new PageClickTracker(render_view); |
231 // Note that the order of insertion of the listeners is important. | 222 // Note that the order of insertion of the listeners is important. |
232 // The password_autocomplete_manager takes the first shot at processing the | 223 // The password_autocomplete_manager takes the first shot at processing the |
233 // notification and can stop the propagation. | 224 // notification and can stop the propagation. |
234 page_click_tracker->AddListener(password_autofill_manager); | 225 page_click_tracker->AddListener(password_autofill_manager); |
235 page_click_tracker->AddListener(autofill_agent); | 226 page_click_tracker->AddListener(autofill_agent); |
236 | 227 |
237 TranslateHelper* translate = new TranslateHelper(render_view, autofill_agent); | 228 TranslateHelper* translate = new TranslateHelper(render_view, autofill_agent); |
238 new ChromeRenderViewObserver( | 229 new ChromeRenderViewObserver( |
239 render_view, content_settings, extension_dispatcher_.get(), | 230 render_view, content_settings, extension_dispatcher_.get(), translate); |
240 translate, phishing_classifier); | |
241 | 231 |
242 // Used only for testing/automation. | 232 // Used only for testing/automation. |
243 if (CommandLine::ForCurrentProcess()->HasSwitch( | 233 if (CommandLine::ForCurrentProcess()->HasSwitch( |
244 switches::kDomAutomationController)) { | 234 switches::kDomAutomationController)) { |
245 new AutomationRendererHelper(render_view); | 235 new AutomationRendererHelper(render_view); |
246 } | 236 } |
247 } | 237 } |
248 | 238 |
249 void ChromeContentRendererClient::SetNumberOfViews(int number_of_views) { | 239 void ChromeContentRendererClient::SetNumberOfViews(int number_of_views) { |
250 child_process_logging::SetNumberOfViews(number_of_views); | 240 child_process_logging::SetNumberOfViews(number_of_views); |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 if (old_url == new_url) { | 583 if (old_url == new_url) { |
594 bool is_extension_url = !!extensions->GetByURL(new_url); | 584 bool is_extension_url = !!extensions->GetByURL(new_url); |
595 if (is_extension_url != extension_dispatcher_->is_extension_process()) | 585 if (is_extension_url != extension_dispatcher_->is_extension_process()) |
596 return true; | 586 return true; |
597 } | 587 } |
598 | 588 |
599 return !extensions->InSameExtent(old_url, new_url); | 589 return !extensions->InSameExtent(old_url, new_url); |
600 } | 590 } |
601 | 591 |
602 } // namespace chrome | 592 } // namespace chrome |
OLD | NEW |