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

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

Issue 12328080: Plumb physical backing size from RWHV to renderer CC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fetch device scale directly in RWVHBase Created 7 years, 9 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 5397 matching lines...) Expand 10 before | Expand all | Expand 10 after
5408 return; 5408 return;
5409 webview()->enableAutoResizeMode(min_size, max_size); 5409 webview()->enableAutoResizeMode(min_size, max_size);
5410 } 5410 }
5411 5411
5412 void RenderViewImpl::OnDisableAutoResize(const gfx::Size& new_size) { 5412 void RenderViewImpl::OnDisableAutoResize(const gfx::Size& new_size) {
5413 DCHECK(disable_scrollbars_size_limit_.IsEmpty()); 5413 DCHECK(disable_scrollbars_size_limit_.IsEmpty());
5414 if (!webview()) 5414 if (!webview())
5415 return; 5415 return;
5416 webview()->disableAutoResizeMode(); 5416 webview()->disableAutoResizeMode();
5417 5417
5418 Resize(new_size, resizer_rect_, is_fullscreen_, NO_RESIZE_ACK); 5418 Resize(new_size, physical_backing_size_, resizer_rect_, is_fullscreen_,
5419 NO_RESIZE_ACK);
5419 } 5420 }
5420 5421
5421 void RenderViewImpl::OnEnablePreferredSizeChangedMode() { 5422 void RenderViewImpl::OnEnablePreferredSizeChangedMode() {
5422 if (send_preferred_size_changes_) 5423 if (send_preferred_size_changes_)
5423 return; 5424 return;
5424 send_preferred_size_changes_ = true; 5425 send_preferred_size_changes_ = true;
5425 5426
5426 // Start off with an initial preferred size notification (in case 5427 // Start off with an initial preferred size notification (in case
5427 // |didUpdateLayout| was already called). 5428 // |didUpdateLayout| was already called).
5428 didUpdateLayout(); 5429 didUpdateLayout();
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
5703 // will simply display a default error page. 5704 // will simply display a default error page.
5704 LoadNavigationErrorPage(frame, WebURLRequest(), original_error, html, true); 5705 LoadNavigationErrorPage(frame, WebURLRequest(), original_error, html, true);
5705 } 5706 }
5706 5707
5707 void RenderViewImpl::OnMoveOrResizeStarted() { 5708 void RenderViewImpl::OnMoveOrResizeStarted() {
5708 if (webview()) 5709 if (webview())
5709 webview()->hidePopups(); 5710 webview()->hidePopups();
5710 } 5711 }
5711 5712
5712 void RenderViewImpl::OnResize(const gfx::Size& new_size, 5713 void RenderViewImpl::OnResize(const gfx::Size& new_size,
5714 const gfx::Size& physical_backing_size,
5713 const gfx::Rect& resizer_rect, 5715 const gfx::Rect& resizer_rect,
5714 bool is_fullscreen) { 5716 bool is_fullscreen) {
5715 if (webview()) { 5717 if (webview()) {
5716 webview()->hidePopups(); 5718 webview()->hidePopups();
5717 if (send_preferred_size_changes_) { 5719 if (send_preferred_size_changes_) {
5718 webview()->mainFrame()->setCanHaveScrollbars( 5720 webview()->mainFrame()->setCanHaveScrollbars(
5719 ShouldDisplayScrollbars(new_size.width(), new_size.height())); 5721 ShouldDisplayScrollbars(new_size.width(), new_size.height()));
5720 } 5722 }
5721 UpdateScrollState(webview()->mainFrame()); 5723 UpdateScrollState(webview()->mainFrame());
5722 } 5724 }
5723 5725
5724 RenderWidget::OnResize(new_size, resizer_rect, is_fullscreen); 5726 RenderWidget::OnResize(new_size, physical_backing_size, resizer_rect,
5727 is_fullscreen);
5725 } 5728 }
5726 5729
5727 void RenderViewImpl::WillInitiatePaint() { 5730 void RenderViewImpl::WillInitiatePaint() {
5728 // Notify the pepper plugins that we're about to paint. 5731 // Notify the pepper plugins that we're about to paint.
5729 pepper_helper_->ViewWillInitiatePaint(); 5732 pepper_helper_->ViewWillInitiatePaint();
5730 } 5733 }
5731 5734
5732 void RenderViewImpl::DidInitiatePaint() { 5735 void RenderViewImpl::DidInitiatePaint() {
5733 // Notify the pepper plugins that we've painted, and are waiting to flush. 5736 // Notify the pepper plugins that we've painted, and are waiting to flush.
5734 pepper_helper_->ViewInitiatedPaint(); 5737 pepper_helper_->ViewInitiatedPaint();
(...skipping 969 matching lines...) Expand 10 before | Expand all | Expand 10 after
6704 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); 6707 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle);
6705 RenderProcess::current()->ReleaseTransportDIB(dib); 6708 RenderProcess::current()->ReleaseTransportDIB(dib);
6706 } 6709 }
6707 6710
6708 void RenderViewImpl::DidCommitCompositorFrame() { 6711 void RenderViewImpl::DidCommitCompositorFrame() {
6709 RenderWidget::DidCommitCompositorFrame(); 6712 RenderWidget::DidCommitCompositorFrame();
6710 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidCommitCompositorFrame()); 6713 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidCommitCompositorFrame());
6711 } 6714 }
6712 6715
6713 } // namespace content 6716 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698