| 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" | 
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   59     ROTATION_SOURCE_UNKNOWN, |   59     ROTATION_SOURCE_UNKNOWN, | 
|   60   }; |   60   }; | 
|   61  |   61  | 
|   62   // Touch support for the display. |   62   // Touch support for the display. | 
|   63   enum TouchSupport { |   63   enum TouchSupport { | 
|   64     TOUCH_SUPPORT_UNKNOWN, |   64     TOUCH_SUPPORT_UNKNOWN, | 
|   65     TOUCH_SUPPORT_AVAILABLE, |   65     TOUCH_SUPPORT_AVAILABLE, | 
|   66     TOUCH_SUPPORT_UNAVAILABLE, |   66     TOUCH_SUPPORT_UNAVAILABLE, | 
|   67   }; |   67   }; | 
|   68  |   68  | 
 |   69   // Accelerometer support for the display. | 
 |   70   enum AccelerometerSupport { | 
 |   71     ACCELEROMETER_SUPPORT_UNKNOWN, | 
 |   72     ACCELEROMETER_SUPPORT_AVAILABLE, | 
 |   73     ACCELEROMETER_SUPPORT_UNAVAILABLE, | 
 |   74   }; | 
 |   75  | 
|   69   // Creates a display with kInvalidDisplayId as default. |   76   // Creates a display with kInvalidDisplayId as default. | 
|   70   Display(); |   77   Display(); | 
|   71   explicit Display(int64_t id); |   78   explicit Display(int64_t id); | 
|   72   Display(int64_t id, const gfx::Rect& bounds); |   79   Display(int64_t id, const gfx::Rect& bounds); | 
|   73   Display(const Display& other); |   80   Display(const Display& other); | 
|   74   ~Display(); |   81   ~Display(); | 
|   75  |   82  | 
|   76   // Returns the forced device scale factor, which is given by |   83   // Returns the forced device scale factor, which is given by | 
|   77   // "--force-device-scale-factor". |   84   // "--force-device-scale-factor". | 
|   78   static float GetForcedDeviceScaleFactor(); |   85   static float GetForcedDeviceScaleFactor(); | 
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  110   void set_device_scale_factor(float scale) { device_scale_factor_ = scale; } |  117   void set_device_scale_factor(float scale) { device_scale_factor_ = scale; } | 
|  111  |  118  | 
|  112   Rotation rotation() const { return rotation_; } |  119   Rotation rotation() const { return rotation_; } | 
|  113   void set_rotation(Rotation rotation) { rotation_ = rotation; } |  120   void set_rotation(Rotation rotation) { rotation_ = rotation; } | 
|  114   int RotationAsDegree() const; |  121   int RotationAsDegree() const; | 
|  115   void SetRotationAsDegree(int rotation); |  122   void SetRotationAsDegree(int rotation); | 
|  116  |  123  | 
|  117   TouchSupport touch_support() const { return touch_support_; } |  124   TouchSupport touch_support() const { return touch_support_; } | 
|  118   void set_touch_support(TouchSupport support) { touch_support_ = support; } |  125   void set_touch_support(TouchSupport support) { touch_support_ = support; } | 
|  119  |  126  | 
 |  127   AccelerometerSupport accelerometer_support() const { | 
 |  128     return accelerometer_support_; | 
 |  129   } | 
 |  130   void set_accelerometer_support(AccelerometerSupport support) { | 
 |  131     accelerometer_support_ = support; | 
 |  132   } | 
 |  133  | 
|  120   // Utility functions that just return the size of display and |  134   // Utility functions that just return the size of display and | 
|  121   // work area. |  135   // work area. | 
|  122   const gfx::Size& size() const { return bounds_.size(); } |  136   const gfx::Size& size() const { return bounds_.size(); } | 
|  123   const gfx::Size& work_area_size() const { return work_area_.size(); } |  137   const gfx::Size& work_area_size() const { return work_area_.size(); } | 
|  124  |  138  | 
|  125   // Returns the work area insets. |  139   // Returns the work area insets. | 
|  126   gfx::Insets GetWorkAreaInsets() const; |  140   gfx::Insets GetWorkAreaInsets() const; | 
|  127  |  141  | 
|  128   // Sets the device scale factor and display bounds in pixel. This |  142   // Sets the device scale factor and display bounds in pixel. This | 
|  129   // updates the work are using the same insets between old bounds and |  143   // updates the work are using the same insets between old bounds and | 
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  201  |  215  | 
|  202   int64_t id_; |  216   int64_t id_; | 
|  203   gfx::Rect bounds_; |  217   gfx::Rect bounds_; | 
|  204   // If non-empty, then should be same size as |bounds_|. Used to avoid rounding |  218   // If non-empty, then should be same size as |bounds_|. Used to avoid rounding | 
|  205   // errors. |  219   // errors. | 
|  206   gfx::Size size_in_pixels_; |  220   gfx::Size size_in_pixels_; | 
|  207   gfx::Rect work_area_; |  221   gfx::Rect work_area_; | 
|  208   float device_scale_factor_; |  222   float device_scale_factor_; | 
|  209   Rotation rotation_ = ROTATE_0; |  223   Rotation rotation_ = ROTATE_0; | 
|  210   TouchSupport touch_support_ = TOUCH_SUPPORT_UNKNOWN; |  224   TouchSupport touch_support_ = TOUCH_SUPPORT_UNKNOWN; | 
 |  225   AccelerometerSupport accelerometer_support_ = ACCELEROMETER_SUPPORT_UNKNOWN; | 
|  211   gfx::Size maximum_cursor_size_; |  226   gfx::Size maximum_cursor_size_; | 
|  212   // NOTE: this is not currently written to the mojom as it is not used in |  227   // NOTE: this is not currently written to the mojom as it is not used in | 
|  213   // aura. |  228   // aura. | 
|  214   gfx::ICCProfile icc_profile_; |  229   gfx::ICCProfile icc_profile_; | 
|  215   int color_depth_; |  230   int color_depth_; | 
|  216   int depth_per_component_; |  231   int depth_per_component_; | 
|  217   bool is_monochrome_ = false; |  232   bool is_monochrome_ = false; | 
|  218 }; |  233 }; | 
|  219  |  234  | 
|  220 }  // namespace display |  235 }  // namespace display | 
|  221  |  236  | 
|  222 #endif  // UI_DISPLAY_DISPLAY_H_ |  237 #endif  // UI_DISPLAY_DISPLAY_H_ | 
| OLD | NEW |