OLD | NEW |
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/display/screen.h" | 5 #include "ui/display/screen.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "ui/display/display.h" | 9 #include "ui/display/display.h" |
10 #include "ui/gfx/android/device_display_info.h" | 10 #include "ui/gfx/android/device_display_info.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 Display display(0, bounds_in_dip); | 46 Display display(0, bounds_in_dip); |
47 if (!Display::HasForceDeviceScaleFactor()) | 47 if (!Display::HasForceDeviceScaleFactor()) |
48 display.set_device_scale_factor(device_scale_factor); | 48 display.set_device_scale_factor(device_scale_factor); |
49 display.SetRotationAsDegree(device_info.GetRotationDegrees()); | 49 display.SetRotationAsDegree(device_info.GetRotationDegrees()); |
50 display.set_color_depth(device_info.GetBitsPerPixel()); | 50 display.set_color_depth(device_info.GetBitsPerPixel()); |
51 display.set_depth_per_component(device_info.GetBitsPerComponent()); | 51 display.set_depth_per_component(device_info.GetBitsPerComponent()); |
52 display.set_is_monochrome(device_info.GetBitsPerComponent() == 0); | 52 display.set_is_monochrome(device_info.GetBitsPerComponent() == 0); |
53 return display; | 53 return display; |
54 } | 54 } |
55 | 55 |
56 Display GetDisplayNearestWindow(gfx::NativeView view) const override { | 56 Display GetDisplayNearestWindow(const gfx::NativeView view) const override { |
57 return GetPrimaryDisplay(); | 57 return GetPrimaryDisplay(); |
58 } | 58 } |
59 | 59 |
60 Display GetDisplayNearestPoint(const gfx::Point& point) const override { | 60 Display GetDisplayNearestPoint(const gfx::Point& point) const override { |
61 return GetPrimaryDisplay(); | 61 return GetPrimaryDisplay(); |
62 } | 62 } |
63 | 63 |
64 int GetNumDisplays() const override { return 1; } | 64 int GetNumDisplays() const override { return 1; } |
65 | 65 |
66 std::vector<Display> GetAllDisplays() const override { | 66 std::vector<Display> GetAllDisplays() const override { |
(...skipping 14 matching lines...) Expand all Loading... |
81 | 81 |
82 private: | 82 private: |
83 DISALLOW_COPY_AND_ASSIGN(ScreenAndroid); | 83 DISALLOW_COPY_AND_ASSIGN(ScreenAndroid); |
84 }; | 84 }; |
85 | 85 |
86 Screen* CreateNativeScreen() { | 86 Screen* CreateNativeScreen() { |
87 return new ScreenAndroid; | 87 return new ScreenAndroid; |
88 } | 88 } |
89 | 89 |
90 } // namespace display | 90 } // namespace display |
OLD | NEW |