OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "services/ui/display/viewport_metrics.h" |
| 6 |
| 7 #include "base/strings/stringprintf.h" |
| 8 |
| 9 namespace display { |
| 10 |
| 11 namespace { |
| 12 |
| 13 std::string RotationString(Display::Rotation rotation) { |
| 14 switch (rotation) { |
| 15 case Display::ROTATE_0: |
| 16 return "0"; |
| 17 case Display::ROTATE_90: |
| 18 return "90"; |
| 19 case Display::ROTATE_180: |
| 20 return "180"; |
| 21 case Display::ROTATE_270: |
| 22 return "270"; |
| 23 } |
| 24 NOTREACHED(); |
| 25 return "Invalid Rotation"; |
| 26 } |
| 27 |
| 28 } // namespace |
| 29 |
| 30 std::string ViewportMetrics::ToString() const { |
| 31 return base::StringPrintf( |
| 32 "ViewportMetrics(bounds=%s, work_area=%s, pixel_size=%s, " |
| 33 "rotation=%s, device_scale_factor=%g)", |
| 34 bounds.ToString().c_str(), work_area.ToString().c_str(), |
| 35 pixel_size.ToString().c_str(), RotationString(rotation).c_str(), |
| 36 device_scale_factor); |
| 37 } |
| 38 |
| 39 } // namespace display |
OLD | NEW |