| 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 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 | 591 |
| 592 if (view_) { | 592 if (view_) { |
| 593 resize_params->new_size = view_->GetRequestedRendererSize(); | 593 resize_params->new_size = view_->GetRequestedRendererSize(); |
| 594 // TODO(wjmaclean): Can we just get rid of physical_backing_size and just | 594 // TODO(wjmaclean): Can we just get rid of physical_backing_size and just |
| 595 // deal with it on the renderer side? It seems to always be | 595 // deal with it on the renderer side? It seems to always be |
| 596 // ScaleToCeiledSize(new_size, device_scale_factor) ?? | 596 // ScaleToCeiledSize(new_size, device_scale_factor) ?? |
| 597 resize_params->physical_backing_size = view_->GetPhysicalBackingSize(); | 597 resize_params->physical_backing_size = view_->GetPhysicalBackingSize(); |
| 598 resize_params->top_controls_height = view_->GetTopControlsHeight(); | 598 resize_params->top_controls_height = view_->GetTopControlsHeight(); |
| 599 resize_params->top_controls_shrink_blink_size = | 599 resize_params->top_controls_shrink_blink_size = |
| 600 view_->DoTopControlsShrinkBlinkSize(); | 600 view_->DoTopControlsShrinkBlinkSize(); |
| 601 resize_params->bottom_controls_height = view_->GetBottomControlsHeight(); |
| 601 resize_params->visible_viewport_size = view_->GetVisibleViewportSize(); | 602 resize_params->visible_viewport_size = view_->GetVisibleViewportSize(); |
| 602 } | 603 } |
| 603 | 604 |
| 604 const bool size_changed = | 605 const bool size_changed = |
| 605 !old_resize_params_ || | 606 !old_resize_params_ || |
| 606 old_resize_params_->new_size != resize_params->new_size || | 607 old_resize_params_->new_size != resize_params->new_size || |
| 607 (old_resize_params_->physical_backing_size.IsEmpty() && | 608 (old_resize_params_->physical_backing_size.IsEmpty() && |
| 608 !resize_params->physical_backing_size.IsEmpty()); | 609 !resize_params->physical_backing_size.IsEmpty()); |
| 609 bool dirty = size_changed || | 610 bool dirty = size_changed || |
| 610 old_resize_params_->screen_info != resize_params->screen_info || | 611 old_resize_params_->screen_info != resize_params->screen_info || |
| 611 old_resize_params_->physical_backing_size != | 612 old_resize_params_->physical_backing_size != |
| 612 resize_params->physical_backing_size || | 613 resize_params->physical_backing_size || |
| 613 old_resize_params_->is_fullscreen_granted != | 614 old_resize_params_->is_fullscreen_granted != |
| 614 resize_params->is_fullscreen_granted || | 615 resize_params->is_fullscreen_granted || |
| 615 old_resize_params_->display_mode != resize_params->display_mode || | 616 old_resize_params_->display_mode != resize_params->display_mode || |
| 616 old_resize_params_->top_controls_height != | 617 old_resize_params_->top_controls_height != |
| 617 resize_params->top_controls_height || | 618 resize_params->top_controls_height || |
| 618 old_resize_params_->top_controls_shrink_blink_size != | 619 old_resize_params_->top_controls_shrink_blink_size != |
| 619 resize_params->top_controls_shrink_blink_size || | 620 resize_params->top_controls_shrink_blink_size || |
| 621 old_resize_params_->bottom_controls_height != |
| 622 resize_params->bottom_controls_height || |
| 620 old_resize_params_->visible_viewport_size != | 623 old_resize_params_->visible_viewport_size != |
| 621 resize_params->visible_viewport_size; | 624 resize_params->visible_viewport_size; |
| 622 | 625 |
| 623 // We don't expect to receive an ACK when the requested size or the physical | 626 // We don't expect to receive an ACK when the requested size or the physical |
| 624 // backing size is empty, or when the main viewport size didn't change. | 627 // backing size is empty, or when the main viewport size didn't change. |
| 625 resize_params->needs_resize_ack = | 628 resize_params->needs_resize_ack = |
| 626 g_check_for_pending_resize_ack && !resize_params->new_size.IsEmpty() && | 629 g_check_for_pending_resize_ack && !resize_params->new_size.IsEmpty() && |
| 627 !resize_params->physical_backing_size.IsEmpty() && size_changed; | 630 !resize_params->physical_backing_size.IsEmpty() && size_changed; |
| 628 | 631 |
| 629 return dirty; | 632 return dirty; |
| (...skipping 1544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2174 return delegate_ ? delegate_->GetRootBrowserAccessibilityManager() : NULL; | 2177 return delegate_ ? delegate_->GetRootBrowserAccessibilityManager() : NULL; |
| 2175 } | 2178 } |
| 2176 | 2179 |
| 2177 BrowserAccessibilityManager* | 2180 BrowserAccessibilityManager* |
| 2178 RenderWidgetHostImpl::GetOrCreateRootBrowserAccessibilityManager() { | 2181 RenderWidgetHostImpl::GetOrCreateRootBrowserAccessibilityManager() { |
| 2179 return delegate_ ? | 2182 return delegate_ ? |
| 2180 delegate_->GetOrCreateRootBrowserAccessibilityManager() : NULL; | 2183 delegate_->GetOrCreateRootBrowserAccessibilityManager() : NULL; |
| 2181 } | 2184 } |
| 2182 | 2185 |
| 2183 } // namespace content | 2186 } // namespace content |
| OLD | NEW |