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 3363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4156 Send(new ViewHostMsg_RunFileChooser(routing_id_, | 4157 Send(new ViewHostMsg_RunFileChooser(routing_id_, |
4157 file_chooser_completions_.front()->params)); | 4158 file_chooser_completions_.front()->params)); |
4158 } | 4159 } |
4159 } | 4160 } |
4160 | 4161 |
4161 void RenderViewImpl::OnEnableAutoResize(const gfx::Size& min_size, | 4162 void RenderViewImpl::OnEnableAutoResize(const gfx::Size& min_size, |
4162 const gfx::Size& max_size) { | 4163 const gfx::Size& max_size) { |
4163 DCHECK(disable_scrollbars_size_limit_.IsEmpty()); | 4164 DCHECK(disable_scrollbars_size_limit_.IsEmpty()); |
4164 if (!webview()) | 4165 if (!webview()) |
4165 return; | 4166 return; |
4166 webview()->enableAutoResizeMode(true, min_size, max_size); | 4167 webview()->enableAutoResizeMode(min_size, max_size); |
| 4168 } |
| 4169 |
| 4170 void RenderViewImpl::OnDisableAutoResize(const gfx::Size& new_size) { |
| 4171 DCHECK(disable_scrollbars_size_limit_.IsEmpty()); |
| 4172 if (!webview()) |
| 4173 return; |
| 4174 webview()->disableAutoResizeMode(); |
| 4175 |
| 4176 Resize(new_size, resizer_rect_, is_fullscreen_, NO_RESIZE_ACK); |
4167 } | 4177 } |
4168 | 4178 |
4169 void RenderViewImpl::OnEnablePreferredSizeChangedMode() { | 4179 void RenderViewImpl::OnEnablePreferredSizeChangedMode() { |
4170 if (send_preferred_size_changes_) | 4180 if (send_preferred_size_changes_) |
4171 return; | 4181 return; |
4172 send_preferred_size_changes_ = true; | 4182 send_preferred_size_changes_ = true; |
4173 | 4183 |
4174 // Start off with an initial preferred size notification (in case | 4184 // Start off with an initial preferred size notification (in case |
4175 // |didUpdateLayout| was already called). | 4185 // |didUpdateLayout| was already called). |
4176 didUpdateLayout(); | 4186 didUpdateLayout(); |
(...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5100 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 5110 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
5101 return !!RenderThreadImpl::current()->compositor_thread(); | 5111 return !!RenderThreadImpl::current()->compositor_thread(); |
5102 } | 5112 } |
5103 | 5113 |
5104 void RenderViewImpl::OnJavaBridgeInit() { | 5114 void RenderViewImpl::OnJavaBridgeInit() { |
5105 DCHECK(!java_bridge_dispatcher_.get()); | 5115 DCHECK(!java_bridge_dispatcher_.get()); |
5106 #if defined(ENABLE_JAVA_BRIDGE) | 5116 #if defined(ENABLE_JAVA_BRIDGE) |
5107 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); | 5117 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); |
5108 #endif | 5118 #endif |
5109 } | 5119 } |
OLD | NEW |