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

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

Issue 714003002: Allow changing top controls height (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 6 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
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_widget_host_impl.h" 5 #include "content/browser/renderer_host/render_widget_host_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 if (!screen_info_) { 570 if (!screen_info_) {
571 screen_info_.reset(new blink::WebScreenInfo); 571 screen_info_.reset(new blink::WebScreenInfo);
572 GetWebScreenInfo(screen_info_.get()); 572 GetWebScreenInfo(screen_info_.get());
573 } 573 }
574 resize_params->screen_info = *screen_info_; 574 resize_params->screen_info = *screen_info_;
575 resize_params->resizer_rect = GetRootWindowResizerRect(); 575 resize_params->resizer_rect = GetRootWindowResizerRect();
576 576
577 if (view_) { 577 if (view_) {
578 resize_params->new_size = view_->GetRequestedRendererSize(); 578 resize_params->new_size = view_->GetRequestedRendererSize();
579 resize_params->physical_backing_size = view_->GetPhysicalBackingSize(); 579 resize_params->physical_backing_size = view_->GetPhysicalBackingSize();
580 resize_params->top_controls_layout_height = 580 resize_params->top_controls_height = view_->GetTopControlsHeight();
581 view_->GetTopControlsLayoutHeight(); 581 resize_params->top_controls_shrink_blink_size =
582 view_->DoTopControlsShrinkBlinkSize();
582 resize_params->visible_viewport_size = view_->GetVisibleViewportSize(); 583 resize_params->visible_viewport_size = view_->GetVisibleViewportSize();
583 resize_params->is_fullscreen = IsFullscreen(); 584 resize_params->is_fullscreen = IsFullscreen();
584 } 585 }
585 } 586 }
586 587
587 void RenderWidgetHostImpl::SetInitialRenderSizeParams( 588 void RenderWidgetHostImpl::SetInitialRenderSizeParams(
588 const ViewMsg_Resize_Params& resize_params) { 589 const ViewMsg_Resize_Params& resize_params) {
589 // We don't expect to receive an ACK when the requested size or the physical 590 // We don't expect to receive an ACK when the requested size or the physical
590 // backing size is empty, or when the main viewport size didn't change. 591 // backing size is empty, or when the main viewport size didn't change.
591 if (!resize_params.new_size.IsEmpty() && 592 if (!resize_params.new_size.IsEmpty() &&
(...skipping 18 matching lines...) Expand all
610 scoped_ptr<ViewMsg_Resize_Params> params(new ViewMsg_Resize_Params); 611 scoped_ptr<ViewMsg_Resize_Params> params(new ViewMsg_Resize_Params);
611 612
612 GetResizeParams(params.get()); 613 GetResizeParams(params.get());
613 if (old_resize_params_) { 614 if (old_resize_params_) {
614 size_changed = old_resize_params_->new_size != params->new_size; 615 size_changed = old_resize_params_->new_size != params->new_size;
615 side_payload_changed = 616 side_payload_changed =
616 side_payload_changed || 617 side_payload_changed ||
617 old_resize_params_->physical_backing_size != 618 old_resize_params_->physical_backing_size !=
618 params->physical_backing_size || 619 params->physical_backing_size ||
619 old_resize_params_->is_fullscreen != params->is_fullscreen || 620 old_resize_params_->is_fullscreen != params->is_fullscreen ||
620 old_resize_params_->top_controls_layout_height != 621 old_resize_params_->top_controls_height !=
621 params->top_controls_layout_height || 622 params->top_controls_height ||
623 old_resize_params_->top_controls_shrink_blink_size !=
624 params->top_controls_shrink_blink_size ||
622 old_resize_params_->visible_viewport_size != 625 old_resize_params_->visible_viewport_size !=
623 params->visible_viewport_size; 626 params->visible_viewport_size;
624 } 627 }
625 628
626 if (!size_changed && !side_payload_changed) 629 if (!size_changed && !side_payload_changed)
627 return; 630 return;
628 631
629 // We don't expect to receive an ACK when the requested size or the physical 632 // We don't expect to receive an ACK when the requested size or the physical
630 // backing size is empty, or when the main viewport size didn't change. 633 // backing size is empty, or when the main viewport size didn't change.
631 if (!params->new_size.IsEmpty() && !params->physical_backing_size.IsEmpty() && 634 if (!params->new_size.IsEmpty() && !params->physical_backing_size.IsEmpty() &&
(...skipping 1811 matching lines...) Expand 10 before | Expand all | Expand 10 after
2443 } 2446 }
2444 #endif 2447 #endif
2445 2448
2446 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { 2449 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() {
2447 if (view_) 2450 if (view_)
2448 return view_->PreferredReadbackFormat(); 2451 return view_->PreferredReadbackFormat();
2449 return kN32_SkColorType; 2452 return kN32_SkColorType;
2450 } 2453 }
2451 2454
2452 } // namespace content 2455 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698