Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(329)

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 8704005: Add autoresize capability to chromium. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: latest update Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 IPC_MESSAGE_HANDLER(ViewMsg_SwapOut, OnSwapOut) 647 IPC_MESSAGE_HANDLER(ViewMsg_SwapOut, OnSwapOut)
648 IPC_MESSAGE_HANDLER(ViewMsg_ClosePage, OnClosePage) 648 IPC_MESSAGE_HANDLER(ViewMsg_ClosePage, OnClosePage)
649 IPC_MESSAGE_HANDLER(ViewMsg_ThemeChanged, OnThemeChanged) 649 IPC_MESSAGE_HANDLER(ViewMsg_ThemeChanged, OnThemeChanged)
650 IPC_MESSAGE_HANDLER(ViewMsg_DisassociateFromPopupCount, 650 IPC_MESSAGE_HANDLER(ViewMsg_DisassociateFromPopupCount,
651 OnDisassociateFromPopupCount) 651 OnDisassociateFromPopupCount)
652 IPC_MESSAGE_HANDLER(ViewMsg_MoveOrResizeStarted, OnMoveOrResizeStarted) 652 IPC_MESSAGE_HANDLER(ViewMsg_MoveOrResizeStarted, OnMoveOrResizeStarted)
653 IPC_MESSAGE_HANDLER(ViewMsg_ClearFocusedNode, OnClearFocusedNode) 653 IPC_MESSAGE_HANDLER(ViewMsg_ClearFocusedNode, OnClearFocusedNode)
654 IPC_MESSAGE_HANDLER(ViewMsg_SetBackground, OnSetBackground) 654 IPC_MESSAGE_HANDLER(ViewMsg_SetBackground, OnSetBackground)
655 IPC_MESSAGE_HANDLER(ViewMsg_EnablePreferredSizeChangedMode, 655 IPC_MESSAGE_HANDLER(ViewMsg_EnablePreferredSizeChangedMode,
656 OnEnablePreferredSizeChangedMode) 656 OnEnablePreferredSizeChangedMode)
657 IPC_MESSAGE_HANDLER(ViewMsg_EnableAutoResize, OnEnableAutoResize)
657 IPC_MESSAGE_HANDLER(ViewMsg_DisableScrollbarsForSmallWindows, 658 IPC_MESSAGE_HANDLER(ViewMsg_DisableScrollbarsForSmallWindows,
658 OnDisableScrollbarsForSmallWindows) 659 OnDisableScrollbarsForSmallWindows)
659 IPC_MESSAGE_HANDLER(ViewMsg_SetRendererPrefs, OnSetRendererPrefs) 660 IPC_MESSAGE_HANDLER(ViewMsg_SetRendererPrefs, OnSetRendererPrefs)
660 IPC_MESSAGE_HANDLER(ViewMsg_MediaPlayerActionAt, OnMediaPlayerActionAt) 661 IPC_MESSAGE_HANDLER(ViewMsg_MediaPlayerActionAt, OnMediaPlayerActionAt)
661 IPC_MESSAGE_HANDLER(ViewMsg_SetActive, OnSetActive) 662 IPC_MESSAGE_HANDLER(ViewMsg_SetActive, OnSetActive)
662 #if defined(OS_MACOSX) 663 #if defined(OS_MACOSX)
663 IPC_MESSAGE_HANDLER(ViewMsg_SetWindowVisibility, OnSetWindowVisibility) 664 IPC_MESSAGE_HANDLER(ViewMsg_SetWindowVisibility, OnSetWindowVisibility)
664 IPC_MESSAGE_HANDLER(ViewMsg_WindowFrameChanged, OnWindowFrameChanged) 665 IPC_MESSAGE_HANDLER(ViewMsg_WindowFrameChanged, OnWindowFrameChanged)
665 IPC_MESSAGE_HANDLER(ViewMsg_PluginImeCompositionCompleted, 666 IPC_MESSAGE_HANDLER(ViewMsg_PluginImeCompositionCompleted,
666 OnPluginImeCompositionCompleted) 667 OnPluginImeCompositionCompleted)
(...skipping 3194 matching lines...) Expand 10 before | Expand all | Expand 10 after
3861 file_chooser_completions_.front()->completion->didChooseFile(ws_file_names); 3862 file_chooser_completions_.front()->completion->didChooseFile(ws_file_names);
3862 file_chooser_completions_.pop_front(); 3863 file_chooser_completions_.pop_front();
3863 3864
3864 // If there are more pending file chooser requests, schedule one now. 3865 // If there are more pending file chooser requests, schedule one now.
3865 if (!file_chooser_completions_.empty()) { 3866 if (!file_chooser_completions_.empty()) {
3866 Send(new ViewHostMsg_RunFileChooser(routing_id_, 3867 Send(new ViewHostMsg_RunFileChooser(routing_id_,
3867 file_chooser_completions_.front()->params)); 3868 file_chooser_completions_.front()->params));
3868 } 3869 }
3869 } 3870 }
3870 3871
3872 void RenderViewImpl::OnEnableAutoResize(const gfx::Size& min_size,
3873 const gfx::Size& max_size) {
3874 DCHECK(!send_preferred_size_changes_);
3875 DCHECK(disable_scrollbars_size_limit_.IsEmpty());
3876 if (!webview())
3877 return;
3878 webview()->enableAutoSizeMode(true, min_size, max_size);
3879 }
3880
3871 void RenderViewImpl::OnEnablePreferredSizeChangedMode() { 3881 void RenderViewImpl::OnEnablePreferredSizeChangedMode() {
3872 if (send_preferred_size_changes_) 3882 if (send_preferred_size_changes_)
3873 return; 3883 return;
3874 send_preferred_size_changes_ = true; 3884 send_preferred_size_changes_ = true;
3875 3885
3876 // Start off with an initial preferred size notification (in case 3886 // Start off with an initial preferred size notification (in case
3877 // |didUpdateLayout| was already called). 3887 // |didUpdateLayout| was already called).
3878 didUpdateLayout(); 3888 didUpdateLayout();
3879 } 3889 }
3880 3890
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after
4752 return !!RenderThreadImpl::current()->compositor_thread(); 4762 return !!RenderThreadImpl::current()->compositor_thread();
4753 } 4763 }
4754 4764
4755 void RenderViewImpl::OnJavaBridgeInit( 4765 void RenderViewImpl::OnJavaBridgeInit(
4756 const IPC::ChannelHandle& channel_handle) { 4766 const IPC::ChannelHandle& channel_handle) {
4757 DCHECK(!java_bridge_dispatcher_.get()); 4767 DCHECK(!java_bridge_dispatcher_.get());
4758 #if defined(ENABLE_JAVA_BRIDGE) 4768 #if defined(ENABLE_JAVA_BRIDGE)
4759 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this, channel_handle)); 4769 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this, channel_handle));
4760 #endif 4770 #endif
4761 } 4771 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698