| 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 "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 17 matching lines...) Expand all Loading... |
| 28 #include "content/common/clipboard_messages.h" | 28 #include "content/common/clipboard_messages.h" |
| 29 #include "content/common/database_messages.h" | 29 #include "content/common/database_messages.h" |
| 30 #include "content/common/drag_messages.h" | 30 #include "content/common/drag_messages.h" |
| 31 #include "content/common/file_system/file_system_dispatcher.h" | 31 #include "content/common/file_system/file_system_dispatcher.h" |
| 32 #include "content/common/file_system/webfilesystem_callback_dispatcher.h" | 32 #include "content/common/file_system/webfilesystem_callback_dispatcher.h" |
| 33 #include "content/common/intents_messages.h" | 33 #include "content/common/intents_messages.h" |
| 34 #include "content/common/java_bridge_messages.h" | 34 #include "content/common/java_bridge_messages.h" |
| 35 #include "content/common/pepper_messages.h" | 35 #include "content/common/pepper_messages.h" |
| 36 #include "content/common/pepper_plugin_registry.h" | 36 #include "content/common/pepper_plugin_registry.h" |
| 37 #include "content/common/quota_dispatcher.h" | 37 #include "content/common/quota_dispatcher.h" |
| 38 #include "content/common/renderer_preferences.h" | |
| 39 #include "content/common/request_extra_data.h" | 38 #include "content/common/request_extra_data.h" |
| 40 #include "content/common/view_messages.h" | 39 #include "content/common/view_messages.h" |
| 41 #include "content/public/common/bindings_policy.h" | 40 #include "content/public/common/bindings_policy.h" |
| 42 #include "content/public/common/content_constants.h" | 41 #include "content/public/common/content_constants.h" |
| 43 #include "content/public/common/content_switches.h" | 42 #include "content/public/common/content_switches.h" |
| 44 #include "content/public/common/url_constants.h" | 43 #include "content/public/common/url_constants.h" |
| 45 #include "content/public/renderer/content_renderer_client.h" | 44 #include "content/public/renderer/content_renderer_client.h" |
| 46 #include "content/public/renderer/navigation_state.h" | 45 #include "content/public/renderer/navigation_state.h" |
| 47 #include "content/public/renderer/render_view_observer.h" | 46 #include "content/public/renderer/render_view_observer.h" |
| 48 #include "content/public/renderer/render_view_visitor.h" | 47 #include "content/public/renderer/render_view_visitor.h" |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 struct RenderViewImpl::PendingFileChooser { | 296 struct RenderViewImpl::PendingFileChooser { |
| 298 PendingFileChooser(const ViewHostMsg_RunFileChooser_Params& p, | 297 PendingFileChooser(const ViewHostMsg_RunFileChooser_Params& p, |
| 299 WebFileChooserCompletion* c) | 298 WebFileChooserCompletion* c) |
| 300 : params(p), | 299 : params(p), |
| 301 completion(c) { | 300 completion(c) { |
| 302 } | 301 } |
| 303 ViewHostMsg_RunFileChooser_Params params; | 302 ViewHostMsg_RunFileChooser_Params params; |
| 304 WebFileChooserCompletion* completion; // MAY BE NULL to skip callback. | 303 WebFileChooserCompletion* completion; // MAY BE NULL to skip callback. |
| 305 }; | 304 }; |
| 306 | 305 |
| 307 RenderViewImpl::RenderViewImpl(gfx::NativeViewId parent_hwnd, | 306 RenderViewImpl::RenderViewImpl( |
| 308 int32 opener_id, | 307 gfx::NativeViewId parent_hwnd, |
| 309 const RendererPreferences& renderer_prefs, | 308 int32 opener_id, |
| 310 const WebPreferences& webkit_prefs, | 309 const content::RendererPreferences& renderer_prefs, |
| 311 SharedRenderViewCounter* counter, | 310 const WebPreferences& webkit_prefs, |
| 312 int32 routing_id, | 311 SharedRenderViewCounter* counter, |
| 313 int64 session_storage_namespace_id, | 312 int32 routing_id, |
| 314 const string16& frame_name) | 313 int64 session_storage_namespace_id, |
| 314 const string16& frame_name) |
| 315 : RenderWidget(WebKit::WebPopupTypeNone), | 315 : RenderWidget(WebKit::WebPopupTypeNone), |
| 316 webkit_preferences_(webkit_prefs), | 316 webkit_preferences_(webkit_prefs), |
| 317 send_content_state_immediately_(false), | 317 send_content_state_immediately_(false), |
| 318 enabled_bindings_(0), | 318 enabled_bindings_(0), |
| 319 send_preferred_size_changes_(false), | 319 send_preferred_size_changes_(false), |
| 320 is_loading_(false), | 320 is_loading_(false), |
| 321 navigation_gesture_(NavigationGestureUnknown), | 321 navigation_gesture_(NavigationGestureUnknown), |
| 322 opened_by_user_gesture_(true), | 322 opened_by_user_gesture_(true), |
| 323 opener_suppressed_(false), | 323 opener_suppressed_(false), |
| 324 page_id_(-1), | 324 page_id_(-1), |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 for (ViewMap::iterator it = views->begin(); it != views->end(); ++it) { | 469 for (ViewMap::iterator it = views->begin(); it != views->end(); ++it) { |
| 470 if (!visitor->Visit(it->second)) | 470 if (!visitor->Visit(it->second)) |
| 471 return; | 471 return; |
| 472 } | 472 } |
| 473 } | 473 } |
| 474 | 474 |
| 475 /*static*/ | 475 /*static*/ |
| 476 RenderViewImpl* RenderViewImpl::Create( | 476 RenderViewImpl* RenderViewImpl::Create( |
| 477 gfx::NativeViewId parent_hwnd, | 477 gfx::NativeViewId parent_hwnd, |
| 478 int32 opener_id, | 478 int32 opener_id, |
| 479 const RendererPreferences& renderer_prefs, | 479 const content::RendererPreferences& renderer_prefs, |
| 480 const WebPreferences& webkit_prefs, | 480 const WebPreferences& webkit_prefs, |
| 481 SharedRenderViewCounter* counter, | 481 SharedRenderViewCounter* counter, |
| 482 int32 routing_id, | 482 int32 routing_id, |
| 483 int64 session_storage_namespace_id, | 483 int64 session_storage_namespace_id, |
| 484 const string16& frame_name) { | 484 const string16& frame_name) { |
| 485 DCHECK(routing_id != MSG_ROUTING_NONE); | 485 DCHECK(routing_id != MSG_ROUTING_NONE); |
| 486 return new RenderViewImpl( | 486 return new RenderViewImpl( |
| 487 parent_hwnd, | 487 parent_hwnd, |
| 488 opener_id, | 488 opener_id, |
| 489 renderer_prefs, | 489 renderer_prefs, |
| (...skipping 3277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3767 if (webview()) | 3767 if (webview()) |
| 3768 didUpdateLayout(webview()->mainFrame()); | 3768 didUpdateLayout(webview()->mainFrame()); |
| 3769 } | 3769 } |
| 3770 | 3770 |
| 3771 void RenderViewImpl::OnDisableScrollbarsForSmallWindows( | 3771 void RenderViewImpl::OnDisableScrollbarsForSmallWindows( |
| 3772 const gfx::Size& disable_scrollbar_size_limit) { | 3772 const gfx::Size& disable_scrollbar_size_limit) { |
| 3773 disable_scrollbars_size_limit_ = disable_scrollbar_size_limit; | 3773 disable_scrollbars_size_limit_ = disable_scrollbar_size_limit; |
| 3774 } | 3774 } |
| 3775 | 3775 |
| 3776 void RenderViewImpl::OnSetRendererPrefs( | 3776 void RenderViewImpl::OnSetRendererPrefs( |
| 3777 const RendererPreferences& renderer_prefs) { | 3777 const content::RendererPreferences& renderer_prefs) { |
| 3778 renderer_preferences_ = renderer_prefs; | 3778 renderer_preferences_ = renderer_prefs; |
| 3779 UpdateFontRenderingFromRendererPrefs(); | 3779 UpdateFontRenderingFromRendererPrefs(); |
| 3780 #if defined(TOOLKIT_USES_GTK) | 3780 #if defined(TOOLKIT_USES_GTK) |
| 3781 WebColorName name = WebKit::WebColorWebkitFocusRingColor; | 3781 WebColorName name = WebKit::WebColorWebkitFocusRingColor; |
| 3782 WebKit::setNamedColors(&name, &renderer_prefs.focus_ring_color, 1); | 3782 WebKit::setNamedColors(&name, &renderer_prefs.focus_ring_color, 1); |
| 3783 WebKit::setCaretBlinkInterval(renderer_prefs.caret_blink_interval); | 3783 WebKit::setCaretBlinkInterval(renderer_prefs.caret_blink_interval); |
| 3784 gfx::NativeTheme::instance()->SetScrollbarColors( | 3784 gfx::NativeTheme::instance()->SetScrollbarColors( |
| 3785 renderer_prefs.thumb_inactive_color, | 3785 renderer_prefs.thumb_inactive_color, |
| 3786 renderer_prefs.thumb_active_color, | 3786 renderer_prefs.thumb_active_color, |
| 3787 renderer_prefs.track_color); | 3787 renderer_prefs.track_color); |
| (...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4670 return webview()->settings()->useThreadedCompositor(); | 4670 return webview()->settings()->useThreadedCompositor(); |
| 4671 } | 4671 } |
| 4672 | 4672 |
| 4673 void RenderViewImpl::OnJavaBridgeInit( | 4673 void RenderViewImpl::OnJavaBridgeInit( |
| 4674 const IPC::ChannelHandle& channel_handle) { | 4674 const IPC::ChannelHandle& channel_handle) { |
| 4675 DCHECK(!java_bridge_dispatcher_.get()); | 4675 DCHECK(!java_bridge_dispatcher_.get()); |
| 4676 #if defined(ENABLE_JAVA_BRIDGE) | 4676 #if defined(ENABLE_JAVA_BRIDGE) |
| 4677 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this, channel_handle)); | 4677 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this, channel_handle)); |
| 4678 #endif | 4678 #endif |
| 4679 } | 4679 } |
| OLD | NEW |