| 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 ASH_DISPLAY_DISPLAY_MANAGER_H_ | 5 #ifndef ASH_DISPLAY_DISPLAY_MANAGER_H_ |
| 6 #define ASH_DISPLAY_DISPLAY_MANAGER_H_ | 6 #define ASH_DISPLAY_DISPLAY_MANAGER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 // TODO(oshima): gfx::Screen needs to return translated coordinates | 36 // TODO(oshima): gfx::Screen needs to return translated coordinates |
| 37 // if the root window is translated. crbug.com/119268. | 37 // if the root window is translated. crbug.com/119268. |
| 38 class ASH_EXPORT DisplayManager : public aura::RootWindowObserver { | 38 class ASH_EXPORT DisplayManager : public aura::RootWindowObserver { |
| 39 public: | 39 public: |
| 40 DisplayManager(); | 40 DisplayManager(); |
| 41 virtual ~DisplayManager(); | 41 virtual ~DisplayManager(); |
| 42 | 42 |
| 43 // Used to emulate display change when run in a desktop environment instead | 43 // Used to emulate display change when run in a desktop environment instead |
| 44 // of on a device. | 44 // of on a device. |
| 45 static void CycleDisplay(); | 45 static void CycleDisplay(); |
| 46 static void ToggleDisplayScale(); | 46 static void ToggleDisplayScaleFactor(); |
| 47 | 47 |
| 48 // When set to true, the MonitorManager calls OnDisplayBoundsChanged | 48 // When set to true, the MonitorManager calls OnDisplayBoundsChanged |
| 49 // even if the display's bounds didn't change. Used to swap primary | 49 // even if the display's bounds didn't change. Used to swap primary |
| 50 // display. | 50 // display. |
| 51 void set_force_bounds_changed(bool force_bounds_changed) { | 51 void set_force_bounds_changed(bool force_bounds_changed) { |
| 52 force_bounds_changed_ = force_bounds_changed; | 52 force_bounds_changed_ = force_bounds_changed; |
| 53 } | 53 } |
| 54 | 54 |
| 55 // Returns the display id of the first display in the outupt list. | 55 // Returns the display id of the first display in the outupt list. |
| 56 int64 first_display_id() const { return first_display_id_; } | 56 int64 first_display_id() const { return first_display_id_; } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 79 // that the insets size should be specified in DIP size. It also triggers the | 79 // that the insets size should be specified in DIP size. It also triggers the |
| 80 // display's bounds change. | 80 // display's bounds change. |
| 81 void SetOverscanInsets(int64 display_id, const gfx::Insets& insets_in_dip); | 81 void SetOverscanInsets(int64 display_id, const gfx::Insets& insets_in_dip); |
| 82 | 82 |
| 83 // Clears the overscan insets | 83 // Clears the overscan insets |
| 84 void ClearCustomOverscanInsets(int64 display_id); | 84 void ClearCustomOverscanInsets(int64 display_id); |
| 85 | 85 |
| 86 // Sets the display's rotation. | 86 // Sets the display's rotation. |
| 87 void SetDisplayRotation(int64 display_id, gfx::Display::Rotation rotation); | 87 void SetDisplayRotation(int64 display_id, gfx::Display::Rotation rotation); |
| 88 | 88 |
| 89 // Sets the display's ui scale. |
| 90 void SetDisplayUIScale(int64 display_id, float ui_scale); |
| 91 |
| 92 // Tells if display rotation/ui scaling features are enabled. |
| 93 bool IsDisplayRotationEnabled() const; |
| 94 bool IsDisplayUIScalingEnabled() const; |
| 95 |
| 89 // Returns the current overscan insets for the specified |display_id|. | 96 // Returns the current overscan insets for the specified |display_id|. |
| 90 // Returns an empty insets (0, 0, 0, 0) if no insets are specified for | 97 // Returns an empty insets (0, 0, 0, 0) if no insets are specified for |
| 91 // the display. | 98 // the display. |
| 92 gfx::Insets GetOverscanInsets(int64 display_id) const; | 99 gfx::Insets GetOverscanInsets(int64 display_id) const; |
| 93 | 100 |
| 94 // Called when display configuration has changed. The new display | 101 // Called when display configuration has changed. The new display |
| 95 // configurations is passed as a vector of Display object, which | 102 // configurations is passed as a vector of Display object, which |
| 96 // contains each display's new infomration. | 103 // contains each display's new infomration. |
| 97 void OnNativeDisplaysChanged( | 104 void OnNativeDisplaysChanged( |
| 98 const std::vector<DisplayInfo>& display_info_list); | 105 const std::vector<DisplayInfo>& display_info_list); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 | 214 |
| 208 DISALLOW_COPY_AND_ASSIGN(DisplayManager); | 215 DISALLOW_COPY_AND_ASSIGN(DisplayManager); |
| 209 }; | 216 }; |
| 210 | 217 |
| 211 extern const aura::WindowProperty<int64>* const kDisplayIdKey; | 218 extern const aura::WindowProperty<int64>* const kDisplayIdKey; |
| 212 | 219 |
| 213 } // namespace internal | 220 } // namespace internal |
| 214 } // namespace ash | 221 } // namespace ash |
| 215 | 222 |
| 216 #endif // ASH_DISPLAY_DISPLAY_MANAGER_H_ | 223 #endif // ASH_DISPLAY_DISPLAY_MANAGER_H_ |
| OLD | NEW |