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

Side by Side Diff: services/ui/display/viewport_metrics.cc

Issue 2736943003: Start to decouple display::Display from ws::PlatformDisplay. (Closed)
Patch Set: Fix comments. Created 3 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
« no previous file with comments | « services/ui/display/viewport_metrics.h ('k') | services/ui/service.h » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "services/ui/display/viewport_metrics.h" 5 #include "services/ui/display/viewport_metrics.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 8
9 namespace display { 9 namespace display {
10 10
11 namespace {
12
13 std::string TouchSupportString(Display::TouchSupport touch_support) {
14 switch (touch_support) {
15 case Display::TOUCH_SUPPORT_UNKNOWN:
16 return "unknown";
17 case Display::TOUCH_SUPPORT_AVAILABLE:
18 return "available";
19 case Display::TOUCH_SUPPORT_UNAVAILABLE:
20 return "unavailable";
21 }
22 NOTREACHED();
23 return "Invalid TouchSupport";
24 }
25
26 std::string RotationString(Display::Rotation rotation) {
27 switch (rotation) {
28 case Display::ROTATE_0:
29 return "0";
30 case Display::ROTATE_90:
31 return "90";
32 case Display::ROTATE_180:
33 return "180";
34 case Display::ROTATE_270:
35 return "270";
36 }
37 NOTREACHED();
38 return "Invalid Rotation";
39 }
40
41 } // namespace
42
43 std::string ViewportMetrics::ToString() const { 11 std::string ViewportMetrics::ToString() const {
44 return base::StringPrintf( 12 return base::StringPrintf(
45 "ViewportMetrics(bounds=%s, work_area=%s, pixel_size=%s, " 13 "ViewportMetrics(bounds_in_pixels=%s, device_scale_factor=%g, "
46 "rotation=%s, touch_support=%s, " 14 "ui_scale_factor=%g)",
47 "device_scale_factor=%g, ui_scale_factor=%g)", 15 bounds_in_pixels.ToString().c_str(), device_scale_factor,
48 bounds.ToString().c_str(), work_area.ToString().c_str(),
49 pixel_size.ToString().c_str(), RotationString(rotation).c_str(),
50 TouchSupportString(touch_support).c_str(), device_scale_factor,
51 ui_scale_factor); 16 ui_scale_factor);
52 } 17 }
53 18
54 } // namespace display 19 } // namespace display
OLDNEW
« no previous file with comments | « services/ui/display/viewport_metrics.h ('k') | services/ui/service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698