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

Side by Side Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 2914013004: Propagate auto-resize viewport values to OOPIF processes (Closed)
Patch Set: alexmos review comments addressed Created 3 years, 6 months 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
OLDNEW
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/browser/renderer_host/render_view_host_impl.h" 5 #include "content/browser/renderer_host/render_view_host_impl.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after
926 const gfx::Size& max_size) { 926 const gfx::Size& max_size) {
927 GetWidget()->SetAutoResize(true, min_size, max_size); 927 GetWidget()->SetAutoResize(true, min_size, max_size);
928 Send(new ViewMsg_EnableAutoResize(GetRoutingID(), min_size, max_size)); 928 Send(new ViewMsg_EnableAutoResize(GetRoutingID(), min_size, max_size));
929 } 929 }
930 930
931 void RenderViewHostImpl::DisableAutoResize(const gfx::Size& new_size) { 931 void RenderViewHostImpl::DisableAutoResize(const gfx::Size& new_size) {
932 GetWidget()->SetAutoResize(false, gfx::Size(), gfx::Size()); 932 GetWidget()->SetAutoResize(false, gfx::Size(), gfx::Size());
933 Send(new ViewMsg_DisableAutoResize(GetRoutingID(), new_size)); 933 Send(new ViewMsg_DisableAutoResize(GetRoutingID(), new_size));
934 if (!new_size.IsEmpty()) 934 if (!new_size.IsEmpty())
935 GetWidget()->GetView()->SetSize(new_size); 935 GetWidget()->GetView()->SetSize(new_size);
936 // This clears the cached value in the WebContents, so that OOPIFs will
937 // stop using it.
938 if (GetWidget()->delegate()) {
939 GetWidget()->delegate()->ResizeDueToAutoResize(GetWidget(),
940 gfx::Size(0, 0));
alexmos 2017/06/02 17:03:18 optional: can just use "gfx::Size()" here
kenrb 2017/06/02 17:23:27 Yes, but I had to remove this call anyway because
941 }
936 } 942 }
937 943
938 void RenderViewHostImpl::ExecuteMediaPlayerActionAtLocation( 944 void RenderViewHostImpl::ExecuteMediaPlayerActionAtLocation(
939 const gfx::Point& location, const blink::WebMediaPlayerAction& action) { 945 const gfx::Point& location, const blink::WebMediaPlayerAction& action) {
940 Send(new ViewMsg_MediaPlayerActionAt(GetRoutingID(), location, action)); 946 Send(new ViewMsg_MediaPlayerActionAt(GetRoutingID(), location, action));
941 } 947 }
942 948
943 void RenderViewHostImpl::ExecutePluginActionAtLocation( 949 void RenderViewHostImpl::ExecutePluginActionAtLocation(
944 const gfx::Point& location, const blink::WebPluginAction& action) { 950 const gfx::Point& location, const blink::WebPluginAction& action) {
945 Send(new ViewMsg_PluginActionAt(GetRoutingID(), location, action)); 951 Send(new ViewMsg_PluginActionAt(GetRoutingID(), location, action));
(...skipping 18 matching lines...) Expand all
964 } 970 }
965 971
966 void RenderViewHostImpl::ClosePageTimeout() { 972 void RenderViewHostImpl::ClosePageTimeout() {
967 if (delegate_->ShouldIgnoreUnresponsiveRenderer()) 973 if (delegate_->ShouldIgnoreUnresponsiveRenderer())
968 return; 974 return;
969 975
970 ClosePageIgnoringUnloadEvents(); 976 ClosePageIgnoringUnloadEvents();
971 } 977 }
972 978
973 } // namespace content 979 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698