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

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: Build fix after rebase Created 4 years, 7 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
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | content/renderer/render_widget.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include <memory> 9 #include <memory>
10 10
(...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 1928 matching lines...) Expand 10 before | Expand all | Expand 10 after
2568 // TODO(port): we don't support theming on non-Windows platforms yet 2570 // TODO(port): we don't support theming on non-Windows platforms yet
2569 NOTIMPLEMENTED(); 2571 NOTIMPLEMENTED();
2570 #endif 2572 #endif
2571 } 2573 }
2572 2574
2573 void RenderViewImpl::OnMoveOrResizeStarted() { 2575 void RenderViewImpl::OnMoveOrResizeStarted() {
2574 if (webview()) 2576 if (webview())
2575 webview()->hidePopups(); 2577 webview()->hidePopups();
2576 } 2578 }
2577 2579
2580 void RenderViewImpl::ResizeWebWidget() {
2581 webview()->resizeWithTopControls(GetSizeForWebWidget(),
2582 top_controls_height_,
2583 top_controls_shrink_blink_size_);
2584 }
2585
2578 void RenderViewImpl::OnResize(const ResizeParams& params) { 2586 void RenderViewImpl::OnResize(const ResizeParams& params) {
2579 TRACE_EVENT0("renderer", "RenderViewImpl::OnResize"); 2587 TRACE_EVENT0("renderer", "RenderViewImpl::OnResize");
2580 if (webview()) { 2588 if (webview()) {
2581 webview()->hidePopups(); 2589 webview()->hidePopups();
2582 if (send_preferred_size_changes_) { 2590 if (send_preferred_size_changes_) {
2583 webview()->mainFrame()->setCanHaveScrollbars( 2591 webview()->mainFrame()->setCanHaveScrollbars(
2584 ShouldDisplayScrollbars(params.new_size.width(), 2592 ShouldDisplayScrollbars(params.new_size.width(),
2585 params.new_size.height())); 2593 params.new_size.height()));
2586 } 2594 }
2587 if (display_mode_ != params.display_mode) { 2595 if (display_mode_ != params.display_mode) {
2588 display_mode_ = params.display_mode; 2596 display_mode_ = params.display_mode;
2589 webview()->setDisplayMode(display_mode_); 2597 webview()->setDisplayMode(display_mode_);
2590 } 2598 }
2591 } 2599 }
2592 2600
2593 gfx::Size old_visible_viewport_size = visible_viewport_size_; 2601 gfx::Size old_visible_viewport_size = visible_viewport_size_;
2594 2602
2603 top_controls_shrink_blink_size_ = params.top_controls_shrink_blink_size;
2604 top_controls_height_ = params.top_controls_height;
2605
2595 RenderWidget::OnResize(params); 2606 RenderWidget::OnResize(params);
2596 2607
2597 if (old_visible_viewport_size != visible_viewport_size_) 2608 if (old_visible_viewport_size != visible_viewport_size_)
2598 has_scrolled_focused_editable_node_into_rect_ = false; 2609 has_scrolled_focused_editable_node_into_rect_ = false;
2599 } 2610 }
2600 2611
2601 void RenderViewImpl::RenderWidgetDidCommitAndDrawCompositorFrame() { 2612 void RenderViewImpl::RenderWidgetDidCommitAndDrawCompositorFrame() {
2602 #if defined(ENABLE_PLUGINS) 2613 #if defined(ENABLE_PLUGINS)
2603 // Notify all instances that we painted. The same caveats apply as for 2614 // Notify all instances that we painted. The same caveats apply as for
2604 // ViewFlushedPaint regarding instances closing themselves, so we take 2615 // ViewFlushedPaint regarding instances closing themselves, so we take
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
3298 if (IsUseZoomForDSFEnabled()) { 3309 if (IsUseZoomForDSFEnabled()) {
3299 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); 3310 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_);
3300 } else { 3311 } else {
3301 webview()->setDeviceScaleFactor(device_scale_factor_); 3312 webview()->setDeviceScaleFactor(device_scale_factor_);
3302 } 3313 }
3303 webview()->settings()->setPreferCompositingToLCDTextEnabled( 3314 webview()->settings()->setPreferCompositingToLCDTextEnabled(
3304 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); 3315 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_));
3305 } 3316 }
3306 3317
3307 } // namespace content 3318 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | content/renderer/render_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698