OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_MANAGER_MANAGED_DISPLAY_INFO_H_ | 5 #ifndef UI_DISPLAY_MANAGER_MANAGED_DISPLAY_INFO_H_ |
6 #define UI_DISPLAY_MANAGER_MANAGED_DISPLAY_INFO_H_ | 6 #define UI_DISPLAY_MANAGER_MANAGED_DISPLAY_INFO_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 // Returns true if |other| has same size and scale factors. | 46 // Returns true if |other| has same size and scale factors. |
47 bool IsEquivalent(const scoped_refptr<ManagedDisplayMode>& other) const; | 47 bool IsEquivalent(const scoped_refptr<ManagedDisplayMode>& other) const; |
48 | 48 |
49 const gfx::Size& size() const { return size_; } | 49 const gfx::Size& size() const { return size_; } |
50 bool is_interlaced() const { return is_interlaced_; } | 50 bool is_interlaced() const { return is_interlaced_; } |
51 float refresh_rate() const { return refresh_rate_; } | 51 float refresh_rate() const { return refresh_rate_; } |
52 | 52 |
53 bool native() const { return native_; } | 53 bool native() const { return native_; } |
54 | 54 |
| 55 bool is_default() const { return is_default_; } |
| 56 void set_is_default(bool is_default) { is_default_ = is_default; } |
| 57 |
55 // Missing from ui::ManagedDisplayMode | 58 // Missing from ui::ManagedDisplayMode |
56 float ui_scale() const { return ui_scale_; } | 59 float ui_scale() const { return ui_scale_; } |
57 float device_scale_factor() const { return device_scale_factor_; } | 60 float device_scale_factor() const { return device_scale_factor_; } |
58 | 61 |
59 private: | 62 private: |
60 ~ManagedDisplayMode(); | 63 ~ManagedDisplayMode(); |
61 friend class base::RefCounted<ManagedDisplayMode>; | 64 friend class base::RefCounted<ManagedDisplayMode>; |
62 | 65 |
63 gfx::Size size_; // Physical pixel size of the display. | 66 gfx::Size size_; // Physical pixel size of the display. |
64 float refresh_rate_; // Refresh rate of the display, in Hz. | 67 float refresh_rate_; // Refresh rate of the display, in Hz. |
65 bool is_interlaced_; // True if mode is interlaced. | 68 bool is_interlaced_; // True if mode is interlaced. |
66 bool native_; // True if mode is native mode of the display. | 69 bool native_; // True if mode is native mode of the display. |
| 70 bool is_default_ = false; // True if mode is one with default UI scale. |
67 float ui_scale_; // The UI scale factor of the mode. | 71 float ui_scale_; // The UI scale factor of the mode. |
68 float device_scale_factor_; // The device scale factor of the mode. | 72 float device_scale_factor_; // The device scale factor of the mode. |
69 | 73 |
70 DISALLOW_COPY_AND_ASSIGN(ManagedDisplayMode); | 74 DISALLOW_COPY_AND_ASSIGN(ManagedDisplayMode); |
71 }; | 75 }; |
72 | 76 |
73 // ManagedDisplayInfo contains metadata for each display. This is used to | 77 // ManagedDisplayInfo contains metadata for each display. This is used to |
74 // create |display::Display| as well as to maintain extra infomation | 78 // create |display::Display| as well as to maintain extra infomation |
75 // to manage displays in ash environment. | 79 // to manage displays in ash environment. |
76 // This class is intentionally made copiable. | 80 // This class is intentionally made copiable. |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 // If you add a new member, you need to update Copy(). | 363 // If you add a new member, you need to update Copy(). |
360 }; | 364 }; |
361 | 365 |
362 // Resets the synthesized display id for testing. This | 366 // Resets the synthesized display id for testing. This |
363 // is necessary to avoid overflowing the output index. | 367 // is necessary to avoid overflowing the output index. |
364 void DISPLAY_EXPORT ResetDisplayIdForTest(); | 368 void DISPLAY_EXPORT ResetDisplayIdForTest(); |
365 | 369 |
366 } // namespace display | 370 } // namespace display |
367 | 371 |
368 #endif // UI_DISPLAY_MANAGER_MANAGED_DISPLAY_INFO_H_ | 372 #endif // UI_DISPLAY_MANAGER_MANAGED_DISPLAY_INFO_H_ |
OLD | NEW |