| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/debug/crash_logging.h" | 8 #include "base/debug/crash_logging.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 #include "components/autofill/content/renderer/password_autofill_agent.h" | 71 #include "components/autofill/content/renderer/password_autofill_agent.h" |
| 72 #include "components/autofill/content/renderer/password_generation_agent.h" | 72 #include "components/autofill/content/renderer/password_generation_agent.h" |
| 73 #include "components/content_settings/core/common/content_settings_pattern.h" | 73 #include "components/content_settings/core/common/content_settings_pattern.h" |
| 74 #include "components/dom_distiller/core/url_constants.h" | 74 #include "components/dom_distiller/core/url_constants.h" |
| 75 #include "components/nacl/renderer/ppb_nacl_private_impl.h" | 75 #include "components/nacl/renderer/ppb_nacl_private_impl.h" |
| 76 #include "components/password_manager/content/renderer/credential_manager_client
.h" | 76 #include "components/password_manager/content/renderer/credential_manager_client
.h" |
| 77 #include "components/pdf/renderer/ppb_pdf_impl.h" | 77 #include "components/pdf/renderer/ppb_pdf_impl.h" |
| 78 #include "components/plugins/renderer/mobile_youtube_plugin.h" | 78 #include "components/plugins/renderer/mobile_youtube_plugin.h" |
| 79 #include "components/signin/core/common/profile_management_switches.h" | 79 #include "components/signin/core/common/profile_management_switches.h" |
| 80 #include "components/visitedlink/renderer/visitedlink_slave.h" | 80 #include "components/visitedlink/renderer/visitedlink_slave.h" |
| 81 #include "components/web_cache/renderer/web_cache_render_process_observer.h" |
| 81 #include "content/public/common/content_constants.h" | 82 #include "content/public/common/content_constants.h" |
| 82 #include "content/public/renderer/render_frame.h" | 83 #include "content/public/renderer/render_frame.h" |
| 83 #include "content/public/renderer/render_thread.h" | 84 #include "content/public/renderer/render_thread.h" |
| 84 #include "content/public/renderer/render_view.h" | 85 #include "content/public/renderer/render_view.h" |
| 85 #include "content/public/renderer/render_view_visitor.h" | 86 #include "content/public/renderer/render_view_visitor.h" |
| 86 #include "extensions/common/constants.h" | 87 #include "extensions/common/constants.h" |
| 87 #include "extensions/common/extension.h" | 88 #include "extensions/common/extension.h" |
| 88 #include "extensions/common/extension_set.h" | 89 #include "extensions/common/extension_set.h" |
| 89 #include "extensions/common/extension_urls.h" | 90 #include "extensions/common/extension_urls.h" |
| 90 #include "extensions/common/switches.h" | 91 #include "extensions/common/switches.h" |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 } | 280 } |
| 280 | 281 |
| 281 ChromeContentRendererClient::~ChromeContentRendererClient() { | 282 ChromeContentRendererClient::~ChromeContentRendererClient() { |
| 282 g_current_client = NULL; | 283 g_current_client = NULL; |
| 283 } | 284 } |
| 284 | 285 |
| 285 void ChromeContentRendererClient::RenderThreadStarted() { | 286 void ChromeContentRendererClient::RenderThreadStarted() { |
| 286 RenderThread* thread = RenderThread::Get(); | 287 RenderThread* thread = RenderThread::Get(); |
| 287 | 288 |
| 288 chrome_observer_.reset(new ChromeRenderProcessObserver(this)); | 289 chrome_observer_.reset(new ChromeRenderProcessObserver(this)); |
| 290 web_cache_observer_.reset(new web_cache::WebCacheRenderProcessObserver()); |
| 289 | 291 |
| 290 extension_dispatcher_delegate_.reset( | 292 extension_dispatcher_delegate_.reset( |
| 291 new ChromeExtensionsDispatcherDelegate()); | 293 new ChromeExtensionsDispatcherDelegate()); |
| 292 // ChromeRenderViewTest::SetUp() creates its own ExtensionDispatcher and | 294 // ChromeRenderViewTest::SetUp() creates its own ExtensionDispatcher and |
| 293 // injects it using SetExtensionDispatcher(). Don't overwrite it. | 295 // injects it using SetExtensionDispatcher(). Don't overwrite it. |
| 294 if (!extension_dispatcher_) { | 296 if (!extension_dispatcher_) { |
| 295 extension_dispatcher_.reset( | 297 extension_dispatcher_.reset( |
| 296 new extensions::Dispatcher(extension_dispatcher_delegate_.get())); | 298 new extensions::Dispatcher(extension_dispatcher_delegate_.get())); |
| 297 } | 299 } |
| 298 permissions_policy_delegate_.reset( | 300 permissions_policy_delegate_.reset( |
| (...skipping 14 matching lines...) Expand all Loading... |
| 313 phishing_classifier_.reset(safe_browsing::PhishingClassifierFilter::Create()); | 315 phishing_classifier_.reset(safe_browsing::PhishingClassifierFilter::Create()); |
| 314 #endif | 316 #endif |
| 315 prerender_dispatcher_.reset(new prerender::PrerenderDispatcher()); | 317 prerender_dispatcher_.reset(new prerender::PrerenderDispatcher()); |
| 316 #if defined(ENABLE_WEBRTC) | 318 #if defined(ENABLE_WEBRTC) |
| 317 webrtc_logging_message_filter_ = new WebRtcLoggingMessageFilter( | 319 webrtc_logging_message_filter_ = new WebRtcLoggingMessageFilter( |
| 318 content::RenderThread::Get()->GetIOMessageLoopProxy()); | 320 content::RenderThread::Get()->GetIOMessageLoopProxy()); |
| 319 #endif | 321 #endif |
| 320 search_bouncer_.reset(new SearchBouncer()); | 322 search_bouncer_.reset(new SearchBouncer()); |
| 321 | 323 |
| 322 thread->AddObserver(chrome_observer_.get()); | 324 thread->AddObserver(chrome_observer_.get()); |
| 325 thread->AddObserver(web_cache_observer_.get()); |
| 323 thread->AddObserver(extension_dispatcher_.get()); | 326 thread->AddObserver(extension_dispatcher_.get()); |
| 324 #if defined(FULL_SAFE_BROWSING) | 327 #if defined(FULL_SAFE_BROWSING) |
| 325 thread->AddObserver(phishing_classifier_.get()); | 328 thread->AddObserver(phishing_classifier_.get()); |
| 326 #endif | 329 #endif |
| 327 thread->AddObserver(visited_link_slave_.get()); | 330 thread->AddObserver(visited_link_slave_.get()); |
| 328 thread->AddObserver(prerender_dispatcher_.get()); | 331 thread->AddObserver(prerender_dispatcher_.get()); |
| 329 thread->AddObserver(search_bouncer_.get()); | 332 thread->AddObserver(search_bouncer_.get()); |
| 330 | 333 |
| 331 #if defined(ENABLE_WEBRTC) | 334 #if defined(ENABLE_WEBRTC) |
| 332 thread->AddFilter(webrtc_logging_message_filter_.get()); | 335 thread->AddFilter(webrtc_logging_message_filter_.get()); |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 PasswordAutofillAgent* password_autofill_agent = | 497 PasswordAutofillAgent* password_autofill_agent = |
| 495 new PasswordAutofillAgent(render_view); | 498 new PasswordAutofillAgent(render_view); |
| 496 new AutofillAgent(render_view, | 499 new AutofillAgent(render_view, |
| 497 password_autofill_agent, | 500 password_autofill_agent, |
| 498 password_generation_agent); | 501 password_generation_agent); |
| 499 | 502 |
| 500 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 503 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 501 if (command_line->HasSwitch(switches::kInstantProcess)) | 504 if (command_line->HasSwitch(switches::kInstantProcess)) |
| 502 new SearchBox(render_view); | 505 new SearchBox(render_view); |
| 503 | 506 |
| 504 new ChromeRenderViewObserver(render_view, chrome_observer_.get()); | 507 new ChromeRenderViewObserver(render_view, web_cache_observer_.get()); |
| 505 | 508 |
| 506 new password_manager::CredentialManagerClient(render_view); | 509 new password_manager::CredentialManagerClient(render_view); |
| 507 } | 510 } |
| 508 | 511 |
| 509 void ChromeContentRendererClient::SetNumberOfViews(int number_of_views) { | 512 void ChromeContentRendererClient::SetNumberOfViews(int number_of_views) { |
| 510 base::debug::SetCrashKeyValue(crash_keys::kNumberOfViews, | 513 base::debug::SetCrashKeyValue(crash_keys::kNumberOfViews, |
| 511 base::IntToString(number_of_views)); | 514 base::IntToString(number_of_views)); |
| 512 } | 515 } |
| 513 | 516 |
| 514 SkBitmap* ChromeContentRendererClient::GetSadPluginBitmap() { | 517 SkBitmap* ChromeContentRendererClient::GetSadPluginBitmap() { |
| (...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1517 | 1520 |
| 1518 if (IsExtensionOrSharedModuleWhitelisted(url, allowed_video_decode_origins_)) | 1521 if (IsExtensionOrSharedModuleWhitelisted(url, allowed_video_decode_origins_)) |
| 1519 return true; | 1522 return true; |
| 1520 | 1523 |
| 1521 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); | 1524 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); |
| 1522 return channel <= chrome::VersionInfo::CHANNEL_DEV; | 1525 return channel <= chrome::VersionInfo::CHANNEL_DEV; |
| 1523 #else | 1526 #else |
| 1524 return false; | 1527 return false; |
| 1525 #endif | 1528 #endif |
| 1526 } | 1529 } |
| OLD | NEW |