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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 2122023002: Cross-process frames should be notified of device scale factor changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simpler access to device_scale_factor. Created 4 years, 5 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/browser/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 1706 matching lines...) Expand 10 before | Expand all | Expand 10 after
1717 void RenderWidgetHostViewAura::OnPaint(const ui::PaintContext& context) { 1717 void RenderWidgetHostViewAura::OnPaint(const ui::PaintContext& context) {
1718 NOTREACHED(); 1718 NOTREACHED();
1719 } 1719 }
1720 1720
1721 void RenderWidgetHostViewAura::OnDeviceScaleFactorChanged( 1721 void RenderWidgetHostViewAura::OnDeviceScaleFactorChanged(
1722 float device_scale_factor) { 1722 float device_scale_factor) {
1723 // TODO(wjmaclean): can host_ ever be null? 1723 // TODO(wjmaclean): can host_ ever be null?
1724 if (!host_ || !window_->GetRootWindow()) 1724 if (!host_ || !window_->GetRootWindow())
1725 return; 1725 return;
1726 1726
1727 UpdateScreenInfo(window_); 1727 RenderWidgetHostImpl* host =
1728 RenderWidgetHostImpl::From(GetRenderWidgetHost());
1729 if (host && host->delegate())
1730 host->delegate()->UpdateDeviceScaleFactor(device_scale_factor);
1728 1731
1729 device_scale_factor_ = device_scale_factor; 1732 device_scale_factor_ = device_scale_factor;
1730 const display::Display display = 1733 const display::Display display =
1731 display::Screen::GetScreen()->GetDisplayNearestWindow(window_); 1734 display::Screen::GetScreen()->GetDisplayNearestWindow(window_);
1732 DCHECK_EQ(device_scale_factor, display.device_scale_factor()); 1735 DCHECK_EQ(device_scale_factor, display.device_scale_factor());
1733 current_cursor_.SetDisplayInfo(display); 1736 current_cursor_.SetDisplayInfo(display);
1734 SnapToPhysicalPixelBoundary(); 1737 SnapToPhysicalPixelBoundary();
1735 } 1738 }
1736 1739
1737 void RenderWidgetHostViewAura::OnWindowDestroying(aura::Window* window) { 1740 void RenderWidgetHostViewAura::OnWindowDestroying(aura::Window* window) {
(...skipping 1263 matching lines...) Expand 10 before | Expand all | Expand 10 after
3001 3004
3002 //////////////////////////////////////////////////////////////////////////////// 3005 ////////////////////////////////////////////////////////////////////////////////
3003 // RenderWidgetHostViewBase, public: 3006 // RenderWidgetHostViewBase, public:
3004 3007
3005 // static 3008 // static
3006 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { 3009 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) {
3007 GetScreenInfoForWindow(results, NULL); 3010 GetScreenInfoForWindow(results, NULL);
3008 } 3011 }
3009 3012
3010 } // namespace content 3013 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698