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

Side by Side Diff: ui/gfx/display.cc

Issue 817653003: Update from https://crrev.com/309717 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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/events/x/touch_factory_x11.cc ('k') | ui/gfx/font_render_params_linux.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 (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 "ui/gfx/display.h" 5 #include "ui/gfx/display.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/strings/string_number_conversions.h" 11 #include "base/strings/string_number_conversions.h"
12 #include "base/strings/stringprintf.h" 12 #include "base/strings/stringprintf.h"
13 #include "ui/gfx/insets.h" 13 #include "ui/gfx/insets.h"
14 #include "ui/gfx/point_conversions.h" 14 #include "ui/gfx/point_conversions.h"
15 #include "ui/gfx/point_f.h" 15 #include "ui/gfx/point_f.h"
16 #include "ui/gfx/size_conversions.h" 16 #include "ui/gfx/size_conversions.h"
17 #include "ui/gfx/switches.h" 17 #include "ui/gfx/switches.h"
18 18
19 namespace gfx { 19 namespace gfx {
20 namespace { 20 namespace {
21 21
22 bool HasForceDeviceScaleFactorImpl() { 22 bool HasForceDeviceScaleFactorImpl() {
23 return CommandLine::ForCurrentProcess()->HasSwitch( 23 return base::CommandLine::ForCurrentProcess()->HasSwitch(
24 switches::kForceDeviceScaleFactor); 24 switches::kForceDeviceScaleFactor);
25 } 25 }
26 26
27 float GetForcedDeviceScaleFactorImpl() { 27 float GetForcedDeviceScaleFactorImpl() {
28 double scale_in_double = 1.0; 28 double scale_in_double = 1.0;
29 if (HasForceDeviceScaleFactorImpl()) { 29 if (HasForceDeviceScaleFactorImpl()) {
30 std::string value = CommandLine::ForCurrentProcess()-> 30 std::string value = base::CommandLine::ForCurrentProcess()->
31 GetSwitchValueASCII(switches::kForceDeviceScaleFactor); 31 GetSwitchValueASCII(switches::kForceDeviceScaleFactor);
32 if (!base::StringToDouble(value, &scale_in_double)) 32 if (!base::StringToDouble(value, &scale_in_double))
33 LOG(ERROR) << "Failed to parse the default device scale factor:" << value; 33 LOG(ERROR) << "Failed to parse the default device scale factor:" << value;
34 } 34 }
35 return static_cast<float>(scale_in_double); 35 return static_cast<float>(scale_in_double);
36 } 36 }
37 37
38 int64 internal_display_id_ = -1; 38 int64 internal_display_id_ = -1;
39 39
40 } // namespace 40 } // namespace
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 183
184 int64 Display::InternalDisplayId() { 184 int64 Display::InternalDisplayId() {
185 return internal_display_id_; 185 return internal_display_id_;
186 } 186 }
187 187
188 void Display::SetInternalDisplayId(int64 internal_display_id) { 188 void Display::SetInternalDisplayId(int64 internal_display_id) {
189 internal_display_id_ = internal_display_id; 189 internal_display_id_ = internal_display_id;
190 } 190 }
191 191
192 } // namespace gfx 192 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/events/x/touch_factory_x11.cc ('k') | ui/gfx/font_render_params_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698