| 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 #ifndef UI_DISPLAY_DISPLAY_H_ | 5 #ifndef UI_DISPLAY_DISPLAY_H_ |
| 6 #define UI_DISPLAY_DISPLAY_H_ | 6 #define UI_DISPLAY_DISPLAY_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "ui/display/display_export.h" | 11 #include "ui/display/display_export.h" |
| 12 #include "ui/display/types/display_constants.h" |
| 12 #include "ui/gfx/geometry/rect.h" | 13 #include "ui/gfx/geometry/rect.h" |
| 13 #include "ui/gfx/icc_profile.h" | 14 #include "ui/gfx/icc_profile.h" |
| 14 | 15 |
| 15 #if !defined(OS_IOS) | 16 #if !defined(OS_IOS) |
| 16 #include "mojo/public/cpp/bindings/struct_traits.h" // nogncheck | 17 #include "mojo/public/cpp/bindings/struct_traits.h" // nogncheck |
| 17 #endif | 18 #endif |
| 18 | 19 |
| 19 namespace display { | 20 namespace display { |
| 20 | 21 |
| 21 #if !defined(OS_IOS) | 22 #if !defined(OS_IOS) |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 ROTATION_SOURCE_UNKNOWN, | 59 ROTATION_SOURCE_UNKNOWN, |
| 59 }; | 60 }; |
| 60 | 61 |
| 61 // Touch support for the display. | 62 // Touch support for the display. |
| 62 enum TouchSupport { | 63 enum TouchSupport { |
| 63 TOUCH_SUPPORT_UNKNOWN, | 64 TOUCH_SUPPORT_UNKNOWN, |
| 64 TOUCH_SUPPORT_AVAILABLE, | 65 TOUCH_SUPPORT_AVAILABLE, |
| 65 TOUCH_SUPPORT_UNAVAILABLE, | 66 TOUCH_SUPPORT_UNAVAILABLE, |
| 66 }; | 67 }; |
| 67 | 68 |
| 68 enum : int64_t { kInvalidDisplayID = -1 }; | 69 // Use display::kInvalidDisplayId from display_constants.h in new code. |
| 70 // TODO(kylechar): Delete after all references are gone. |
| 71 enum : int64_t { kInvalidDisplayID = display::kInvalidDisplayId }; |
| 69 | 72 |
| 70 // Creates a display with kInvalidDisplayID as default. | 73 // Creates a display with kInvalidDisplayId as default. |
| 71 Display(); | 74 Display(); |
| 72 explicit Display(int64_t id); | 75 explicit Display(int64_t id); |
| 73 Display(int64_t id, const gfx::Rect& bounds); | 76 Display(int64_t id, const gfx::Rect& bounds); |
| 74 Display(const Display& other); | 77 Display(const Display& other); |
| 75 ~Display(); | 78 ~Display(); |
| 76 | 79 |
| 77 // Returns the forced device scale factor, which is given by | 80 // Returns the forced device scale factor, which is given by |
| 78 // "--force-device-scale-factor". | 81 // "--force-device-scale-factor". |
| 79 static float GetForcedDeviceScaleFactor(); | 82 static float GetForcedDeviceScaleFactor(); |
| 80 | 83 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 // |work_area_insets| and the bounds. | 140 // |work_area_insets| and the bounds. |
| 138 void UpdateWorkAreaFromInsets(const gfx::Insets& work_area_insets); | 141 void UpdateWorkAreaFromInsets(const gfx::Insets& work_area_insets); |
| 139 | 142 |
| 140 // Returns the display's size in pixel coordinates. | 143 // Returns the display's size in pixel coordinates. |
| 141 gfx::Size GetSizeInPixel() const; | 144 gfx::Size GetSizeInPixel() const; |
| 142 | 145 |
| 143 // Returns a string representation of the display; | 146 // Returns a string representation of the display; |
| 144 std::string ToString() const; | 147 std::string ToString() const; |
| 145 | 148 |
| 146 // True if the display contains valid display id. | 149 // True if the display contains valid display id. |
| 147 bool is_valid() const { return id_ != kInvalidDisplayID; } | 150 bool is_valid() const { return id_ != kInvalidDisplayId; } |
| 148 | 151 |
| 149 // True if the display corresponds to internal panel. | 152 // True if the display corresponds to internal panel. |
| 150 bool IsInternal() const; | 153 bool IsInternal() const; |
| 151 | 154 |
| 152 // Gets/Sets an id of display corresponding to internal panel. | 155 // Gets/Sets an id of display corresponding to internal panel. |
| 153 static int64_t InternalDisplayId(); | 156 static int64_t InternalDisplayId(); |
| 154 static void SetInternalDisplayId(int64_t internal_display_id); | 157 static void SetInternalDisplayId(int64_t internal_display_id); |
| 155 | 158 |
| 156 // Test if the |id| is for the internal display if any. | 159 // Test if the |id| is for the internal display if any. |
| 157 static bool IsInternalDisplayId(int64_t id); | 160 static bool IsInternalDisplayId(int64_t id); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 | 209 |
| 207 #if !defined(OS_IOS) | 210 #if !defined(OS_IOS) |
| 208 friend struct mojo::StructTraits<display::mojom::DisplayDataView, | 211 friend struct mojo::StructTraits<display::mojom::DisplayDataView, |
| 209 display::Display>; | 212 display::Display>; |
| 210 #endif | 213 #endif |
| 211 }; | 214 }; |
| 212 | 215 |
| 213 } // namespace display | 216 } // namespace display |
| 214 | 217 |
| 215 #endif // UI_DISPLAY_DISPLAY_H_ | 218 #endif // UI_DISPLAY_DISPLAY_H_ |
| OLD | NEW |