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

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

Issue 714003002: Allow changing top controls height (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added more invalidates when setting the height Created 6 years, 1 month 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/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 3082 matching lines...) Expand 10 before | Expand all | Expand 10 after
3093 void RenderViewImpl::OnDisableAutoResize(const gfx::Size& new_size) { 3093 void RenderViewImpl::OnDisableAutoResize(const gfx::Size& new_size) {
3094 DCHECK(disable_scrollbars_size_limit_.IsEmpty()); 3094 DCHECK(disable_scrollbars_size_limit_.IsEmpty());
3095 if (!webview()) 3095 if (!webview())
3096 return; 3096 return;
3097 auto_resize_mode_ = false; 3097 auto_resize_mode_ = false;
3098 webview()->disableAutoResizeMode(); 3098 webview()->disableAutoResizeMode();
3099 3099
3100 if (!new_size.IsEmpty()) { 3100 if (!new_size.IsEmpty()) {
3101 Resize(new_size, 3101 Resize(new_size,
3102 physical_backing_size_, 3102 physical_backing_size_,
3103 top_controls_layout_height_, 3103 top_controls_shrink_blink_size_,
3104 top_controls_height_,
3104 visible_viewport_size_, 3105 visible_viewport_size_,
3105 resizer_rect_, 3106 resizer_rect_,
3106 is_fullscreen_, 3107 is_fullscreen_,
3107 NO_RESIZE_ACK); 3108 NO_RESIZE_ACK);
3108 } 3109 }
3109 } 3110 }
3110 3111
3111 void RenderViewImpl::OnEnablePreferredSizeChangedMode() { 3112 void RenderViewImpl::OnEnablePreferredSizeChangedMode() {
3112 if (send_preferred_size_changes_) 3113 if (send_preferred_size_changes_)
3113 return; 3114 return;
(...skipping 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after
4150 } 4151 }
4151 4152
4152 void RenderViewImpl::SetDeviceScaleFactorForTesting(float factor) { 4153 void RenderViewImpl::SetDeviceScaleFactorForTesting(float factor) {
4153 ViewMsg_Resize_Params params; 4154 ViewMsg_Resize_Params params;
4154 params.screen_info = screen_info_; 4155 params.screen_info = screen_info_;
4155 params.screen_info.deviceScaleFactor = factor; 4156 params.screen_info.deviceScaleFactor = factor;
4156 params.new_size = size(); 4157 params.new_size = size();
4157 params.visible_viewport_size = visible_viewport_size_; 4158 params.visible_viewport_size = visible_viewport_size_;
4158 params.physical_backing_size = 4159 params.physical_backing_size =
4159 gfx::ToCeiledSize(gfx::ScaleSize(size(), factor)); 4160 gfx::ToCeiledSize(gfx::ScaleSize(size(), factor));
4160 params.top_controls_layout_height = 0.f; 4161 params.top_controls_shrink_blink_size = false;
4162 params.top_controls_height = 0.f;
4161 params.resizer_rect = WebRect(); 4163 params.resizer_rect = WebRect();
4162 params.is_fullscreen = is_fullscreen(); 4164 params.is_fullscreen = is_fullscreen();
4163 OnResize(params); 4165 OnResize(params);
4164 } 4166 }
4165 4167
4166 void RenderViewImpl::SetDeviceColorProfileForTesting( 4168 void RenderViewImpl::SetDeviceColorProfileForTesting(
4167 const std::vector<char>& color_profile) { 4169 const std::vector<char>& color_profile) {
4168 SetDeviceColorProfile(color_profile); 4170 SetDeviceColorProfile(color_profile);
4169 } 4171 }
4170 4172
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
4226 std::vector<gfx::Size> sizes; 4228 std::vector<gfx::Size> sizes;
4227 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); 4229 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes);
4228 if (!url.isEmpty()) 4230 if (!url.isEmpty())
4229 urls.push_back( 4231 urls.push_back(
4230 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); 4232 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes));
4231 } 4233 }
4232 SendUpdateFaviconURL(urls); 4234 SendUpdateFaviconURL(urls);
4233 } 4235 }
4234 4236
4235 } // namespace content 4237 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698