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

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

Issue 417923003: Fix DCHECK with force-device-scale-factor switch enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_combobox_popup_positioning
Patch Set: Created 6 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
« no previous file with comments | « no previous file | no next file » | 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/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 "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 1592 matching lines...) Expand 10 before | Expand all | Expand 10 after
1603 void RenderWidgetHostViewAura::OnPaint(gfx::Canvas* canvas) { 1603 void RenderWidgetHostViewAura::OnPaint(gfx::Canvas* canvas) {
1604 // For non-opaque windows, we don't draw anything, since we depend on the 1604 // For non-opaque windows, we don't draw anything, since we depend on the
1605 // canvas coming from the compositor to already be initialized as 1605 // canvas coming from the compositor to already be initialized as
1606 // transparent. 1606 // transparent.
1607 if (window_->layer()->fills_bounds_opaquely()) 1607 if (window_->layer()->fills_bounds_opaquely())
1608 canvas->DrawColor(SK_ColorWHITE); 1608 canvas->DrawColor(SK_ColorWHITE);
1609 } 1609 }
1610 1610
1611 void RenderWidgetHostViewAura::OnDeviceScaleFactorChanged( 1611 void RenderWidgetHostViewAura::OnDeviceScaleFactorChanged(
1612 float device_scale_factor) { 1612 float device_scale_factor) {
1613 if (!host_) 1613 if (!host_ || !window_->GetRootWindow())
1614 return; 1614 return;
1615 1615
1616 UpdateScreenInfo(window_); 1616 UpdateScreenInfo(window_);
1617 1617
1618 const gfx::Display display = gfx::Screen::GetScreenFor(window_)-> 1618 const gfx::Display display = gfx::Screen::GetScreenFor(window_)->
1619 GetDisplayNearestWindow(window_); 1619 GetDisplayNearestWindow(window_);
1620 DCHECK_EQ(device_scale_factor, display.device_scale_factor()); 1620 DCHECK_EQ(device_scale_factor, display.device_scale_factor());
1621 current_cursor_.SetDisplayInfo(display); 1621 current_cursor_.SetDisplayInfo(display);
1622 SnapToPhysicalPixelBoundary(); 1622 SnapToPhysicalPixelBoundary();
1623 } 1623 }
(...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after
2486 2486
2487 //////////////////////////////////////////////////////////////////////////////// 2487 ////////////////////////////////////////////////////////////////////////////////
2488 // RenderWidgetHostViewBase, public: 2488 // RenderWidgetHostViewBase, public:
2489 2489
2490 // static 2490 // static
2491 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { 2491 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) {
2492 GetScreenInfoForWindow(results, NULL); 2492 GetScreenInfoForWindow(results, NULL);
2493 } 2493 }
2494 2494
2495 } // namespace content 2495 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698