OLD | NEW |
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 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <tuple> | 10 #include <tuple> |
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
609 resize_params->display_mode = blink::WebDisplayModeBrowser; | 609 resize_params->display_mode = blink::WebDisplayModeBrowser; |
610 } | 610 } |
611 | 611 |
612 if (view_) { | 612 if (view_) { |
613 resize_params->new_size = view_->GetRequestedRendererSize(); | 613 resize_params->new_size = view_->GetRequestedRendererSize(); |
614 // TODO(wjmaclean): Can we just get rid of physical_backing_size and just | 614 // TODO(wjmaclean): Can we just get rid of physical_backing_size and just |
615 // deal with it on the renderer side? It seems to always be | 615 // deal with it on the renderer side? It seems to always be |
616 // ScaleToCeiledSize(new_size, device_scale_factor) ?? | 616 // ScaleToCeiledSize(new_size, device_scale_factor) ?? |
617 resize_params->physical_backing_size = view_->GetPhysicalBackingSize(); | 617 resize_params->physical_backing_size = view_->GetPhysicalBackingSize(); |
618 resize_params->top_controls_height = view_->GetTopControlsHeight(); | 618 resize_params->top_controls_height = view_->GetTopControlsHeight(); |
619 resize_params->top_controls_shrink_blink_size = | 619 resize_params->browser_controls_shrink_blink_size = |
620 view_->DoTopControlsShrinkBlinkSize(); | 620 view_->DoBrowserControlsShrinkBlinkSize(); |
621 resize_params->bottom_controls_height = view_->GetBottomControlsHeight(); | 621 resize_params->bottom_controls_height = view_->GetBottomControlsHeight(); |
622 resize_params->visible_viewport_size = view_->GetVisibleViewportSize(); | 622 resize_params->visible_viewport_size = view_->GetVisibleViewportSize(); |
623 } | 623 } |
624 | 624 |
625 const bool size_changed = | 625 const bool size_changed = |
626 !old_resize_params_ || | 626 !old_resize_params_ || |
627 old_resize_params_->new_size != resize_params->new_size || | 627 old_resize_params_->new_size != resize_params->new_size || |
628 (old_resize_params_->physical_backing_size.IsEmpty() && | 628 (old_resize_params_->physical_backing_size.IsEmpty() && |
629 !resize_params->physical_backing_size.IsEmpty()); | 629 !resize_params->physical_backing_size.IsEmpty()); |
630 bool dirty = size_changed || | 630 bool dirty = |
| 631 size_changed || |
631 old_resize_params_->screen_info != resize_params->screen_info || | 632 old_resize_params_->screen_info != resize_params->screen_info || |
632 old_resize_params_->physical_backing_size != | 633 old_resize_params_->physical_backing_size != |
633 resize_params->physical_backing_size || | 634 resize_params->physical_backing_size || |
634 old_resize_params_->is_fullscreen_granted != | 635 old_resize_params_->is_fullscreen_granted != |
635 resize_params->is_fullscreen_granted || | 636 resize_params->is_fullscreen_granted || |
636 old_resize_params_->display_mode != resize_params->display_mode || | 637 old_resize_params_->display_mode != resize_params->display_mode || |
637 old_resize_params_->top_controls_height != | 638 old_resize_params_->top_controls_height != |
638 resize_params->top_controls_height || | 639 resize_params->top_controls_height || |
639 old_resize_params_->top_controls_shrink_blink_size != | 640 old_resize_params_->browser_controls_shrink_blink_size != |
640 resize_params->top_controls_shrink_blink_size || | 641 resize_params->browser_controls_shrink_blink_size || |
641 old_resize_params_->bottom_controls_height != | 642 old_resize_params_->bottom_controls_height != |
642 resize_params->bottom_controls_height || | 643 resize_params->bottom_controls_height || |
643 old_resize_params_->visible_viewport_size != | 644 old_resize_params_->visible_viewport_size != |
644 resize_params->visible_viewport_size; | 645 resize_params->visible_viewport_size; |
645 | 646 |
646 // We don't expect to receive an ACK when the requested size or the physical | 647 // We don't expect to receive an ACK when the requested size or the physical |
647 // backing size is empty, or when the main viewport size didn't change. | 648 // backing size is empty, or when the main viewport size didn't change. |
648 resize_params->needs_resize_ack = | 649 resize_params->needs_resize_ack = |
649 g_check_for_pending_resize_ack && !resize_params->new_size.IsEmpty() && | 650 g_check_for_pending_resize_ack && !resize_params->new_size.IsEmpty() && |
650 !resize_params->physical_backing_size.IsEmpty() && size_changed; | 651 !resize_params->physical_backing_size.IsEmpty() && size_changed; |
(...skipping 1571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2222 return delegate_ ? delegate_->GetRootBrowserAccessibilityManager() : NULL; | 2223 return delegate_ ? delegate_->GetRootBrowserAccessibilityManager() : NULL; |
2223 } | 2224 } |
2224 | 2225 |
2225 BrowserAccessibilityManager* | 2226 BrowserAccessibilityManager* |
2226 RenderWidgetHostImpl::GetOrCreateRootBrowserAccessibilityManager() { | 2227 RenderWidgetHostImpl::GetOrCreateRootBrowserAccessibilityManager() { |
2227 return delegate_ ? | 2228 return delegate_ ? |
2228 delegate_->GetOrCreateRootBrowserAccessibilityManager() : NULL; | 2229 delegate_->GetOrCreateRootBrowserAccessibilityManager() : NULL; |
2229 } | 2230 } |
2230 | 2231 |
2231 } // namespace content | 2232 } // namespace content |
OLD | NEW |