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

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

Issue 1844013002: Fix main thread top controls scrolling to mirror CC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@propertyTreesBoundsDelta
Patch Set: sievers@ review Created 4 years, 8 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
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 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 page_id_(-1), 620 page_id_(-1),
621 next_page_id_(params.next_page_id), 621 next_page_id_(params.next_page_id),
622 history_list_offset_(-1), 622 history_list_offset_(-1),
623 history_list_length_(0), 623 history_list_length_(0),
624 frames_in_progress_(0), 624 frames_in_progress_(0),
625 target_url_status_(TARGET_NONE), 625 target_url_status_(TARGET_NONE),
626 uses_temporary_zoom_level_(false), 626 uses_temporary_zoom_level_(false),
627 #if defined(OS_ANDROID) 627 #if defined(OS_ANDROID)
628 top_controls_constraints_(TOP_CONTROLS_STATE_BOTH), 628 top_controls_constraints_(TOP_CONTROLS_STATE_BOTH),
629 #endif 629 #endif
630 top_controls_shrink_blink_size_(false),
631 top_controls_height_(0.f),
630 has_focus_(false), 632 has_focus_(false),
631 has_scrolled_focused_editable_node_into_rect_(false), 633 has_scrolled_focused_editable_node_into_rect_(false),
632 main_render_frame_(nullptr), 634 main_render_frame_(nullptr),
633 frame_widget_(nullptr), 635 frame_widget_(nullptr),
634 speech_recognition_dispatcher_(NULL), 636 speech_recognition_dispatcher_(NULL),
635 mouse_lock_dispatcher_(NULL), 637 mouse_lock_dispatcher_(NULL),
636 #if defined(OS_ANDROID) 638 #if defined(OS_ANDROID)
637 expected_content_intent_id_(0), 639 expected_content_intent_id_(0),
638 #endif 640 #endif
639 #if defined(ENABLE_PLUGINS) 641 #if defined(ENABLE_PLUGINS)
(...skipping 1951 matching lines...) Expand 10 before | Expand all | Expand 10 after
2591 // TODO(port): we don't support theming on non-Windows platforms yet 2593 // TODO(port): we don't support theming on non-Windows platforms yet
2592 NOTIMPLEMENTED(); 2594 NOTIMPLEMENTED();
2593 #endif 2595 #endif
2594 } 2596 }
2595 2597
2596 void RenderViewImpl::OnMoveOrResizeStarted() { 2598 void RenderViewImpl::OnMoveOrResizeStarted() {
2597 if (webview()) 2599 if (webview())
2598 webview()->hidePopups(); 2600 webview()->hidePopups();
2599 } 2601 }
2600 2602
2603 void RenderViewImpl::ResizeWebWidget(const gfx::Size& new_size, bool) {
2604 webview()->resizeWithTopControls(new_size,
bokan 2016/04/11 19:54:15 This method will early out if the parameters are u
2605 top_controls_height_,
2606 top_controls_shrink_blink_size_);
2607 }
2608
2601 void RenderViewImpl::OnResize(const ResizeParams& params) { 2609 void RenderViewImpl::OnResize(const ResizeParams& params) {
2602 TRACE_EVENT0("renderer", "RenderViewImpl::OnResize"); 2610 TRACE_EVENT0("renderer", "RenderViewImpl::OnResize");
2603 if (webview()) { 2611 if (webview()) {
2604 webview()->hidePopups(); 2612 webview()->hidePopups();
2605 if (send_preferred_size_changes_) { 2613 if (send_preferred_size_changes_) {
2606 webview()->mainFrame()->setCanHaveScrollbars( 2614 webview()->mainFrame()->setCanHaveScrollbars(
2607 ShouldDisplayScrollbars(params.new_size.width(), 2615 ShouldDisplayScrollbars(params.new_size.width(),
2608 params.new_size.height())); 2616 params.new_size.height()));
2609 } 2617 }
2610 if (display_mode_ != params.display_mode) { 2618 if (display_mode_ != params.display_mode) {
2611 display_mode_ = params.display_mode; 2619 display_mode_ = params.display_mode;
2612 webview()->setDisplayMode(display_mode_); 2620 webview()->setDisplayMode(display_mode_);
2613 } 2621 }
2614 } 2622 }
2615 2623
2616 gfx::Size old_visible_viewport_size = visible_viewport_size_; 2624 gfx::Size old_visible_viewport_size = visible_viewport_size_;
2617 2625
2626 top_controls_shrink_blink_size_ = params.top_controls_shrink_blink_size;
2627 top_controls_height_ = params.top_controls_height;
2628
2618 RenderWidget::OnResize(params); 2629 RenderWidget::OnResize(params);
2619 2630
2620 if (old_visible_viewport_size != visible_viewport_size_) 2631 if (old_visible_viewport_size != visible_viewport_size_)
2621 has_scrolled_focused_editable_node_into_rect_ = false; 2632 has_scrolled_focused_editable_node_into_rect_ = false;
2622 } 2633 }
2623 2634
2624 void RenderViewImpl::RenderWidgetDidCommitAndDrawCompositorFrame() { 2635 void RenderViewImpl::RenderWidgetDidCommitAndDrawCompositorFrame() {
2625 #if defined(ENABLE_PLUGINS) 2636 #if defined(ENABLE_PLUGINS)
2626 // Notify all instances that we painted. The same caveats apply as for 2637 // Notify all instances that we painted. The same caveats apply as for
2627 // ViewFlushedPaint regarding instances closing themselves, so we take 2638 // ViewFlushedPaint regarding instances closing themselves, so we take
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after
3323 if (IsUseZoomForDSFEnabled()) { 3334 if (IsUseZoomForDSFEnabled()) {
3324 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); 3335 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_);
3325 } else { 3336 } else {
3326 webview()->setDeviceScaleFactor(device_scale_factor_); 3337 webview()->setDeviceScaleFactor(device_scale_factor_);
3327 } 3338 }
3328 webview()->settings()->setPreferCompositingToLCDTextEnabled( 3339 webview()->settings()->setPreferCompositingToLCDTextEnabled(
3329 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); 3340 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_));
3330 } 3341 }
3331 3342
3332 } // namespace content 3343 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698