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

Side by Side Diff: ui/display/util/display_util.cc

Issue 660173002: Type conversion fixes, ui/ edition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 2 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 | « ui/base/webui/web_ui_util.cc ('k') | ui/events/event.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/display/util/display_util.h" 5 #include "ui/display/util/display_util.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace ui { 9 namespace ui {
10 10
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 } 53 }
54 } 54 }
55 return false; 55 return false;
56 } 56 }
57 57
58 float GetScaleFactor(const gfx::Size& physical_size_in_mm, 58 float GetScaleFactor(const gfx::Size& physical_size_in_mm,
59 const gfx::Size& screen_size_in_pixels) { 59 const gfx::Size& screen_size_in_pixels) {
60 if (IsDisplaySizeBlackListed(physical_size_in_mm)) 60 if (IsDisplaySizeBlackListed(physical_size_in_mm))
61 return 1.0f; 61 return 1.0f;
62 62
63 const unsigned int dpi = (kInchInMm * screen_size_in_pixels.width() / 63 const unsigned int dpi = static_cast<unsigned int>(
64 physical_size_in_mm.width()); 64 kInchInMm * screen_size_in_pixels.width() / physical_size_in_mm.width());
65 const unsigned int threshold = 65 const unsigned int threshold =
66 (physical_size_in_mm.width() >= kLargeDisplayWidthThresholdMM) ? 66 (physical_size_in_mm.width() >= kLargeDisplayWidthThresholdMM) ?
67 kHighDensityDPIThresholdLarge : kHighDensityDPIThresholdSmall; 67 kHighDensityDPIThresholdLarge : kHighDensityDPIThresholdSmall;
68 return (dpi > threshold) ? 2.0f : 1.0f; 68 return (dpi > threshold) ? 2.0f : 1.0f;
69 } 69 }
70 70
71 } // namespace ui 71 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/webui/web_ui_util.cc ('k') | ui/events/event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698