Christopher Cameron | fb701e10 | 2018-02-13 19:32:23 | [diff] [blame] | 1 | // Copyright 2018 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 | #ifndef CONTENT_BROWSER_RENDERER_HOST_DISPLAY_UTIL_H_ |
| 6 | #define CONTENT_BROWSER_RENDERER_HOST_DISPLAY_UTIL_H_ |
| 7 | |
| 8 | #include "content/common/content_export.h" |
| 9 | #include "content/public/common/screen_info.h" |
| 10 | #include "ui/display/display.h" |
| 11 | #include "ui/gfx/native_widget_types.h" |
| 12 | |
| 13 | namespace content { |
| 14 | |
| 15 | class CONTENT_EXPORT DisplayUtil { |
| 16 | public: |
| 17 | static void DisplayToScreenInfo(ScreenInfo* screen_info, |
| 18 | const display::Display& display); |
| 19 | |
| 20 | static void GetNativeViewScreenInfo(ScreenInfo* screen_info, |
| 21 | gfx::NativeView native_view); |
| 22 | |
| 23 | static void GetDefaultScreenInfo(ScreenInfo* screen_info); |
| 24 | |
| 25 | // Compute the orientation type of the display assuming it is a mobile device. |
| 26 | static ScreenOrientationValues GetOrientationTypeForMobile( |
| 27 | const display::Display& display); |
| 28 | |
| 29 | // Compute the orientation type of the display assuming it is a desktop. |
| 30 | static ScreenOrientationValues GetOrientationTypeForDesktop( |
| 31 | const display::Display& display); |
| 32 | }; |
| 33 | |
| 34 | } // namespace content |
| 35 | |
| 36 | #endif // CONTENT_BROWSER_RENDERER_HOST_DISPLAY_UTIL_H_ |