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 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
773 IPC_MESSAGE_HANDLER(ViewMsg_ClosePage, OnClosePage) | 773 IPC_MESSAGE_HANDLER(ViewMsg_ClosePage, OnClosePage) |
774 IPC_MESSAGE_HANDLER(ViewMsg_ThemeChanged, OnThemeChanged) | 774 IPC_MESSAGE_HANDLER(ViewMsg_ThemeChanged, OnThemeChanged) |
775 IPC_MESSAGE_HANDLER(ViewMsg_DisassociateFromPopupCount, | 775 IPC_MESSAGE_HANDLER(ViewMsg_DisassociateFromPopupCount, |
776 OnDisassociateFromPopupCount) | 776 OnDisassociateFromPopupCount) |
777 IPC_MESSAGE_HANDLER(ViewMsg_MoveOrResizeStarted, OnMoveOrResizeStarted) | 777 IPC_MESSAGE_HANDLER(ViewMsg_MoveOrResizeStarted, OnMoveOrResizeStarted) |
778 IPC_MESSAGE_HANDLER(ViewMsg_ClearFocusedNode, OnClearFocusedNode) | 778 IPC_MESSAGE_HANDLER(ViewMsg_ClearFocusedNode, OnClearFocusedNode) |
779 IPC_MESSAGE_HANDLER(ViewMsg_SetBackground, OnSetBackground) | 779 IPC_MESSAGE_HANDLER(ViewMsg_SetBackground, OnSetBackground) |
780 IPC_MESSAGE_HANDLER(ViewMsg_EnablePreferredSizeChangedMode, | 780 IPC_MESSAGE_HANDLER(ViewMsg_EnablePreferredSizeChangedMode, |
781 OnEnablePreferredSizeChangedMode) | 781 OnEnablePreferredSizeChangedMode) |
782 IPC_MESSAGE_HANDLER(ViewMsg_EnableAutoResize, OnEnableAutoResize) | 782 IPC_MESSAGE_HANDLER(ViewMsg_EnableAutoResize, OnEnableAutoResize) |
783 IPC_MESSAGE_HANDLER(ViewMsg_DisableAutoResize, OnDisableAutoResize) | |
783 IPC_MESSAGE_HANDLER(ViewMsg_DisableScrollbarsForSmallWindows, | 784 IPC_MESSAGE_HANDLER(ViewMsg_DisableScrollbarsForSmallWindows, |
784 OnDisableScrollbarsForSmallWindows) | 785 OnDisableScrollbarsForSmallWindows) |
785 IPC_MESSAGE_HANDLER(ViewMsg_SetRendererPrefs, OnSetRendererPrefs) | 786 IPC_MESSAGE_HANDLER(ViewMsg_SetRendererPrefs, OnSetRendererPrefs) |
786 IPC_MESSAGE_HANDLER(ViewMsg_MediaPlayerActionAt, OnMediaPlayerActionAt) | 787 IPC_MESSAGE_HANDLER(ViewMsg_MediaPlayerActionAt, OnMediaPlayerActionAt) |
787 IPC_MESSAGE_HANDLER(ViewMsg_PluginActionAt, OnPluginActionAt) | 788 IPC_MESSAGE_HANDLER(ViewMsg_PluginActionAt, OnPluginActionAt) |
788 IPC_MESSAGE_HANDLER(ViewMsg_SetActive, OnSetActive) | 789 IPC_MESSAGE_HANDLER(ViewMsg_SetActive, OnSetActive) |
789 #if defined(OS_MACOSX) | 790 #if defined(OS_MACOSX) |
790 IPC_MESSAGE_HANDLER(ViewMsg_SetWindowVisibility, OnSetWindowVisibility) | 791 IPC_MESSAGE_HANDLER(ViewMsg_SetWindowVisibility, OnSetWindowVisibility) |
791 IPC_MESSAGE_HANDLER(ViewMsg_WindowFrameChanged, OnWindowFrameChanged) | 792 IPC_MESSAGE_HANDLER(ViewMsg_WindowFrameChanged, OnWindowFrameChanged) |
792 IPC_MESSAGE_HANDLER(ViewMsg_PluginImeCompositionCompleted, | 793 IPC_MESSAGE_HANDLER(ViewMsg_PluginImeCompositionCompleted, |
(...skipping 3356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4149 Send(new ViewHostMsg_RunFileChooser(routing_id_, | 4150 Send(new ViewHostMsg_RunFileChooser(routing_id_, |
4150 file_chooser_completions_.front()->params)); | 4151 file_chooser_completions_.front()->params)); |
4151 } | 4152 } |
4152 } | 4153 } |
4153 | 4154 |
4154 void RenderViewImpl::OnEnableAutoResize(const gfx::Size& min_size, | 4155 void RenderViewImpl::OnEnableAutoResize(const gfx::Size& min_size, |
4155 const gfx::Size& max_size) { | 4156 const gfx::Size& max_size) { |
4156 DCHECK(disable_scrollbars_size_limit_.IsEmpty()); | 4157 DCHECK(disable_scrollbars_size_limit_.IsEmpty()); |
4157 if (!webview()) | 4158 if (!webview()) |
4158 return; | 4159 return; |
4159 webview()->enableAutoResizeMode(true, min_size, max_size); | 4160 webview()->enableAutoResizeMode(min_size, max_size); |
4161 } | |
4162 | |
4163 void RenderViewImpl::OnDisableAutoResize(const gfx::Size& new_size) { | |
4164 DCHECK(disable_scrollbars_size_limit_.IsEmpty()); | |
4165 if (!webview()) | |
4166 return; | |
4167 webview()->disableAutoResizeMode(); | |
4168 | |
4169 paint_aggregator_.ClearPendingUpdate(); | |
4170 webview()->resize(new_size); | |
darin (slow to review)
2012/03/01 00:30:49
do you need to assign to size_? should some code
levin
2012/03/01 01:56:19
Good idea. Done.
(There was a problem with OnResi
| |
4160 } | 4171 } |
4161 | 4172 |
4162 void RenderViewImpl::OnEnablePreferredSizeChangedMode() { | 4173 void RenderViewImpl::OnEnablePreferredSizeChangedMode() { |
4163 if (send_preferred_size_changes_) | 4174 if (send_preferred_size_changes_) |
4164 return; | 4175 return; |
4165 send_preferred_size_changes_ = true; | 4176 send_preferred_size_changes_ = true; |
4166 | 4177 |
4167 // Start off with an initial preferred size notification (in case | 4178 // Start off with an initial preferred size notification (in case |
4168 // |didUpdateLayout| was already called). | 4179 // |didUpdateLayout| was already called). |
4169 didUpdateLayout(); | 4180 didUpdateLayout(); |
(...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5093 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 5104 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
5094 return !!RenderThreadImpl::current()->compositor_thread(); | 5105 return !!RenderThreadImpl::current()->compositor_thread(); |
5095 } | 5106 } |
5096 | 5107 |
5097 void RenderViewImpl::OnJavaBridgeInit() { | 5108 void RenderViewImpl::OnJavaBridgeInit() { |
5098 DCHECK(!java_bridge_dispatcher_.get()); | 5109 DCHECK(!java_bridge_dispatcher_.get()); |
5099 #if defined(ENABLE_JAVA_BRIDGE) | 5110 #if defined(ENABLE_JAVA_BRIDGE) |
5100 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); | 5111 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); |
5101 #endif | 5112 #endif |
5102 } | 5113 } |
OLD | NEW |