| 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 "content/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 #include "content/public/common/content_switches.h" | 47 #include "content/public/common/content_switches.h" |
| 48 #include "content/public/common/context_menu_params.h" | 48 #include "content/public/common/context_menu_params.h" |
| 49 #include "content/public/common/file_chooser_params.h" | 49 #include "content/public/common/file_chooser_params.h" |
| 50 #include "content/public/common/selected_file_info.h" | 50 #include "content/public/common/selected_file_info.h" |
| 51 #include "content/public/common/url_constants.h" | 51 #include "content/public/common/url_constants.h" |
| 52 #include "content/public/renderer/content_renderer_client.h" | 52 #include "content/public/renderer/content_renderer_client.h" |
| 53 #include "content/public/renderer/document_state.h" | 53 #include "content/public/renderer/document_state.h" |
| 54 #include "content/public/renderer/navigation_state.h" | 54 #include "content/public/renderer/navigation_state.h" |
| 55 #include "content/public/renderer/render_view_observer.h" | 55 #include "content/public/renderer/render_view_observer.h" |
| 56 #include "content/public/renderer/render_view_visitor.h" | 56 #include "content/public/renderer/render_view_visitor.h" |
| 57 #include "content/renderer/browser_plugin/browser_plugin_constants.h" | |
| 58 #include "content/renderer/browser_plugin/browser_plugin_placeholder.h" | |
| 59 #include "content/renderer/device_orientation_dispatcher.h" | 57 #include "content/renderer/device_orientation_dispatcher.h" |
| 60 #include "content/renderer/devtools_agent.h" | 58 #include "content/renderer/devtools_agent.h" |
| 61 #include "content/renderer/dom_automation_controller.h" | 59 #include "content/renderer/dom_automation_controller.h" |
| 62 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" | 60 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" |
| 63 #include "content/renderer/external_popup_menu.h" | 61 #include "content/renderer/external_popup_menu.h" |
| 64 #include "content/renderer/geolocation_dispatcher.h" | 62 #include "content/renderer/geolocation_dispatcher.h" |
| 65 #include "content/renderer/gpu/compositor_thread.h" | 63 #include "content/renderer/gpu/compositor_thread.h" |
| 66 #include "content/renderer/idle_user_detector.h" | 64 #include "content/renderer/idle_user_detector.h" |
| 67 #include "content/renderer/input_tag_speech_dispatcher.h" | 65 #include "content/renderer/input_tag_speech_dispatcher.h" |
| 68 #include "content/renderer/java/java_bridge_dispatcher.h" | 66 #include "content/renderer/java/java_bridge_dispatcher.h" |
| 69 #include "content/renderer/load_progress_tracker.h" | 67 #include "content/renderer/load_progress_tracker.h" |
| 70 #include "content/renderer/media/audio_message_filter.h" | 68 #include "content/renderer/media/audio_message_filter.h" |
| 71 #include "content/renderer/media/media_stream_dependency_factory.h" | 69 #include "content/renderer/media/media_stream_dependency_factory.h" |
| 72 #include "content/renderer/media/media_stream_dispatcher.h" | 70 #include "content/renderer/media/media_stream_dispatcher.h" |
| 73 #include "content/renderer/media/media_stream_impl.h" | 71 #include "content/renderer/media/media_stream_impl.h" |
| 74 #include "content/renderer/media/render_audiosourceprovider.h" | 72 #include "content/renderer/media/render_audiosourceprovider.h" |
| 75 #include "content/renderer/media/render_media_log.h" | 73 #include "content/renderer/media/render_media_log.h" |
| 76 #include "content/renderer/media/renderer_gpu_video_decoder_factories.h" | 74 #include "content/renderer/media/renderer_gpu_video_decoder_factories.h" |
| 77 #include "content/renderer/mhtml_generator.h" | 75 #include "content/renderer/mhtml_generator.h" |
| 78 #include "content/renderer/mouse_lock_dispatcher.h" | 76 #include "content/renderer/mouse_lock_dispatcher.h" |
| 79 #include "content/renderer/notification_provider.h" | 77 #include "content/renderer/notification_provider.h" |
| 80 #include "content/renderer/p2p/socket_dispatcher.h" | 78 #include "content/renderer/p2p/socket_dispatcher.h" |
| 81 #include "content/renderer/plugin_channel_host.h" | 79 #include "content/renderer/plugin_channel_host.h" |
| 80 #include "content/renderer/browser_plugin/browser_plugin_constants.h" |
| 81 #include "content/renderer/browser_plugin/browser_plugin_placeholder.h" |
| 82 #include "content/renderer/render_process.h" | 82 #include "content/renderer/render_process.h" |
| 83 #include "content/renderer/render_thread_impl.h" | 83 #include "content/renderer/render_thread_impl.h" |
| 84 #include "content/renderer/render_widget_fullscreen_pepper.h" | 84 #include "content/renderer/render_widget_fullscreen_pepper.h" |
| 85 #include "content/renderer/renderer_accessibility.h" | 85 #include "content/renderer/renderer_accessibility.h" |
| 86 #include "content/renderer/renderer_webapplicationcachehost_impl.h" | 86 #include "content/renderer/renderer_webapplicationcachehost_impl.h" |
| 87 #include "content/renderer/renderer_webcolorchooser_impl.h" | 87 #include "content/renderer/renderer_webcolorchooser_impl.h" |
| 88 #include "content/renderer/text_input_client_observer.h" | 88 #include "content/renderer/text_input_client_observer.h" |
| 89 #include "content/renderer/v8_value_converter_impl.h" | 89 #include "content/renderer/v8_value_converter_impl.h" |
| 90 #include "content/renderer/web_intents_host.h" | 90 #include "content/renderer/web_intents_host.h" |
| 91 #include "content/renderer/web_ui_bindings.h" | 91 #include "content/renderer/web_ui_bindings.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 #include "webkit/plugins/npapi/webplugin_delegate.h" | 176 #include "webkit/plugins/npapi/webplugin_delegate.h" |
| 177 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" | 177 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" |
| 178 #include "webkit/plugins/npapi/webplugin_impl.h" | 178 #include "webkit/plugins/npapi/webplugin_impl.h" |
| 179 #include "webkit/plugins/ppapi/ppapi_webplugin_impl.h" | 179 #include "webkit/plugins/ppapi/ppapi_webplugin_impl.h" |
| 180 | 180 |
| 181 #if defined(OS_ANDROID) | 181 #if defined(OS_ANDROID) |
| 182 #include "webkit/media/android/webmediaplayer_android.h" | 182 #include "webkit/media/android/webmediaplayer_android.h" |
| 183 #elif defined(OS_WIN) | 183 #elif defined(OS_WIN) |
| 184 // TODO(port): these files are currently Windows only because they concern: | 184 // TODO(port): these files are currently Windows only because they concern: |
| 185 // * theming | 185 // * theming |
| 186 #include "ui/base/native_theme/native_theme_win.h" | 186 #include "ui/gfx/native_theme_win.h" |
| 187 #elif defined(USE_X11) | 187 #elif defined(USE_X11) |
| 188 #include "third_party/WebKit/Source/WebKit/chromium/public/linux/WebRenderTheme.
h" | 188 #include "third_party/WebKit/Source/WebKit/chromium/public/linux/WebRenderTheme.
h" |
| 189 #include "ui/base/native_theme/native_theme.h" | 189 #include "ui/gfx/native_theme.h" |
| 190 #elif defined(OS_MACOSX) | 190 #elif defined(OS_MACOSX) |
| 191 #include "skia/ext/skia_utils_mac.h" | 191 #include "skia/ext/skia_utils_mac.h" |
| 192 #endif | 192 #endif |
| 193 | 193 |
| 194 using WebKit::WebAccessibilityNotification; | 194 using WebKit::WebAccessibilityNotification; |
| 195 using WebKit::WebAccessibilityObject; | 195 using WebKit::WebAccessibilityObject; |
| 196 using WebKit::WebApplicationCacheHost; | 196 using WebKit::WebApplicationCacheHost; |
| 197 using WebKit::WebApplicationCacheHostClient; | 197 using WebKit::WebApplicationCacheHostClient; |
| 198 using WebKit::WebCString; | 198 using WebKit::WebCString; |
| 199 using WebKit::WebColor; | 199 using WebKit::WebColor; |
| (...skipping 4166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4366 | 4366 |
| 4367 void RenderViewImpl::OnSetRendererPrefs( | 4367 void RenderViewImpl::OnSetRendererPrefs( |
| 4368 const content::RendererPreferences& renderer_prefs) { | 4368 const content::RendererPreferences& renderer_prefs) { |
| 4369 double old_zoom_level = renderer_preferences_.default_zoom_level; | 4369 double old_zoom_level = renderer_preferences_.default_zoom_level; |
| 4370 renderer_preferences_ = renderer_prefs; | 4370 renderer_preferences_ = renderer_prefs; |
| 4371 UpdateFontRenderingFromRendererPrefs(); | 4371 UpdateFontRenderingFromRendererPrefs(); |
| 4372 #if defined(TOOLKIT_GTK) | 4372 #if defined(TOOLKIT_GTK) |
| 4373 WebColorName name = WebKit::WebColorWebkitFocusRingColor; | 4373 WebColorName name = WebKit::WebColorWebkitFocusRingColor; |
| 4374 WebKit::setNamedColors(&name, &renderer_prefs.focus_ring_color, 1); | 4374 WebKit::setNamedColors(&name, &renderer_prefs.focus_ring_color, 1); |
| 4375 WebKit::setCaretBlinkInterval(renderer_prefs.caret_blink_interval); | 4375 WebKit::setCaretBlinkInterval(renderer_prefs.caret_blink_interval); |
| 4376 ui::NativeTheme::instance()->SetScrollbarColors( | 4376 gfx::NativeTheme::instance()->SetScrollbarColors( |
| 4377 renderer_prefs.thumb_inactive_color, | 4377 renderer_prefs.thumb_inactive_color, |
| 4378 renderer_prefs.thumb_active_color, | 4378 renderer_prefs.thumb_active_color, |
| 4379 renderer_prefs.track_color); | 4379 renderer_prefs.track_color); |
| 4380 #endif | 4380 #endif |
| 4381 | 4381 |
| 4382 #if defined(USE_ASH) || defined(TOOLKIT_GTK) | 4382 #if defined(USE_ASH) || defined(TOOLKIT_GTK) |
| 4383 if (webview()) { | 4383 if (webview()) { |
| 4384 #if defined(TOOLKIT_GTK) | 4384 #if defined(TOOLKIT_GTK) |
| 4385 webview()->setScrollbarColors( | 4385 webview()->setScrollbarColors( |
| 4386 renderer_prefs.thumb_inactive_color, | 4386 renderer_prefs.thumb_inactive_color, |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4537 // http://b/issue?id=753080. | 4537 // http://b/issue?id=753080. |
| 4538 webview()->dispatchUnloadEvent(); | 4538 webview()->dispatchUnloadEvent(); |
| 4539 | 4539 |
| 4540 Send(new ViewHostMsg_ClosePage_ACK(routing_id_)); | 4540 Send(new ViewHostMsg_ClosePage_ACK(routing_id_)); |
| 4541 } | 4541 } |
| 4542 | 4542 |
| 4543 void RenderViewImpl::OnThemeChanged() { | 4543 void RenderViewImpl::OnThemeChanged() { |
| 4544 #if defined(USE_AURA) | 4544 #if defined(USE_AURA) |
| 4545 // Aura doesn't care if we switch themes. | 4545 // Aura doesn't care if we switch themes. |
| 4546 #elif defined(OS_WIN) | 4546 #elif defined(OS_WIN) |
| 4547 ui::NativeThemeWin::instance()->CloseHandles(); | 4547 gfx::NativeThemeWin::instance()->CloseHandles(); |
| 4548 if (webview()) | 4548 if (webview()) |
| 4549 webview()->themeChanged(); | 4549 webview()->themeChanged(); |
| 4550 #else // defined(OS_WIN) | 4550 #else // defined(OS_WIN) |
| 4551 // TODO(port): we don't support theming on non-Windows platforms yet | 4551 // TODO(port): we don't support theming on non-Windows platforms yet |
| 4552 NOTIMPLEMENTED(); | 4552 NOTIMPLEMENTED(); |
| 4553 #endif | 4553 #endif |
| 4554 } | 4554 } |
| 4555 | 4555 |
| 4556 void RenderViewImpl::OnDisassociateFromPopupCount() { | 4556 void RenderViewImpl::OnDisassociateFromPopupCount() { |
| 4557 if (decrement_shared_popup_at_destruction_) | 4557 if (decrement_shared_popup_at_destruction_) |
| (...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5313 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 5313 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
| 5314 return !!RenderThreadImpl::current()->compositor_thread(); | 5314 return !!RenderThreadImpl::current()->compositor_thread(); |
| 5315 } | 5315 } |
| 5316 | 5316 |
| 5317 void RenderViewImpl::OnJavaBridgeInit() { | 5317 void RenderViewImpl::OnJavaBridgeInit() { |
| 5318 DCHECK(!java_bridge_dispatcher_); | 5318 DCHECK(!java_bridge_dispatcher_); |
| 5319 #if defined(ENABLE_JAVA_BRIDGE) | 5319 #if defined(ENABLE_JAVA_BRIDGE) |
| 5320 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); | 5320 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); |
| 5321 #endif | 5321 #endif |
| 5322 } | 5322 } |
| OLD | NEW |