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

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

Issue 894193003: ResizeSynchronously should resize the visible viewport as well. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed variable names Created 5 years, 10 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
« no previous file with comments | « no previous file | content/renderer/render_widget.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 1996 matching lines...) Expand 10 before | Expand all | Expand 10 after
2007 // When supports_multiple_windows is disabled, popups are reusing 2007 // When supports_multiple_windows is disabled, popups are reusing
2008 // the same view. In some scenarios, this makes WebKit to call show() twice. 2008 // the same view. In some scenarios, this makes WebKit to call show() twice.
2009 if (webkit_preferences_.supports_multiple_windows) 2009 if (webkit_preferences_.supports_multiple_windows)
2010 NOTREACHED() << "received extraneous Show call"; 2010 NOTREACHED() << "received extraneous Show call";
2011 return; 2011 return;
2012 } 2012 }
2013 did_show_ = true; 2013 did_show_ = true;
2014 2014
2015 DCHECK(opener_id_ != MSG_ROUTING_NONE); 2015 DCHECK(opener_id_ != MSG_ROUTING_NONE);
2016 2016
2017 // NOTE: initial_pos_ may still have its default values at this point, but 2017 // NOTE: initial_rect_ may still have its default values at this point, but
2018 // that's okay. It'll be ignored if disposition is not NEW_POPUP, or the 2018 // that's okay. It'll be ignored if disposition is not NEW_POPUP, or the
2019 // browser process will impose a default position otherwise. 2019 // browser process will impose a default position otherwise.
2020 Send(new ViewHostMsg_ShowView(opener_id_, routing_id_, 2020 Send(new ViewHostMsg_ShowView(opener_id_, routing_id_,
2021 NavigationPolicyToDisposition(policy), initial_pos_, 2021 NavigationPolicyToDisposition(policy), initial_rect_,
2022 opened_by_user_gesture_)); 2022 opened_by_user_gesture_));
2023 SetPendingWindowRect(initial_pos_); 2023 SetPendingWindowRect(initial_rect_);
2024 } 2024 }
2025 2025
2026 void RenderViewImpl::runModal() { 2026 void RenderViewImpl::runModal() {
2027 DCHECK(did_show_) << "should already have shown the view"; 2027 DCHECK(did_show_) << "should already have shown the view";
2028 2028
2029 // Don't allow further dialogs if we are waiting to swap out, since the 2029 // Don't allow further dialogs if we are waiting to swap out, since the
2030 // PageGroupLoadDeferrer in our stack prevents it. 2030 // PageGroupLoadDeferrer in our stack prevents it.
2031 if (suppress_dialogs_until_swap_out_) 2031 if (suppress_dialogs_until_swap_out_)
2032 return; 2032 return;
2033 2033
(...skipping 1993 matching lines...) Expand 10 before | Expand all | Expand 10 after
4027 params.is_fullscreen = is_fullscreen(); 4027 params.is_fullscreen = is_fullscreen();
4028 OnResize(params); 4028 OnResize(params);
4029 } 4029 }
4030 4030
4031 void RenderViewImpl::SetDeviceColorProfileForTesting( 4031 void RenderViewImpl::SetDeviceColorProfileForTesting(
4032 const std::vector<char>& color_profile) { 4032 const std::vector<char>& color_profile) {
4033 SetDeviceColorProfile(color_profile); 4033 SetDeviceColorProfile(color_profile);
4034 } 4034 }
4035 4035
4036 void RenderViewImpl::ForceResizeForTesting(const gfx::Size& new_size) { 4036 void RenderViewImpl::ForceResizeForTesting(const gfx::Size& new_size) {
4037 gfx::Rect new_position(rootWindowRect().x, 4037 gfx::Rect new_window_rect(rootWindowRect().x,
4038 rootWindowRect().y, 4038 rootWindowRect().y,
4039 new_size.width(), 4039 new_size.width(),
4040 new_size.height()); 4040 new_size.height());
4041 ResizeSynchronously(new_position, new_size); 4041 SetWindowRectSynchronously(new_window_rect);
4042 } 4042 }
4043 4043
4044 void RenderViewImpl::UseSynchronousResizeModeForTesting(bool enable) { 4044 void RenderViewImpl::UseSynchronousResizeModeForTesting(bool enable) {
4045 resizing_mode_selector_->set_is_synchronous_mode(enable); 4045 resizing_mode_selector_->set_is_synchronous_mode(enable);
4046 } 4046 }
4047 4047
4048 void RenderViewImpl::EnableAutoResizeForTesting(const gfx::Size& min_size, 4048 void RenderViewImpl::EnableAutoResizeForTesting(const gfx::Size& min_size,
4049 const gfx::Size& max_size) { 4049 const gfx::Size& max_size) {
4050 OnEnableAutoResize(min_size, max_size); 4050 OnEnableAutoResize(min_size, max_size);
4051 } 4051 }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
4093 std::vector<gfx::Size> sizes; 4093 std::vector<gfx::Size> sizes;
4094 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); 4094 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes);
4095 if (!url.isEmpty()) 4095 if (!url.isEmpty())
4096 urls.push_back( 4096 urls.push_back(
4097 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); 4097 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes));
4098 } 4098 }
4099 SendUpdateFaviconURL(urls); 4099 SendUpdateFaviconURL(urls);
4100 } 4100 }
4101 4101
4102 } // namespace content 4102 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/render_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698