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_GFX_MONITOR_H_ | 5 #ifndef UI_GFX_MONITOR_H_ |
6 #define UI_GFX_MONITOR_H_ | 6 #define UI_GFX_MONITOR_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "ui/base/ui_export.h" | 11 #include "ui/base/ui_export.h" |
12 #include "ui/gfx/rect.h" | 12 #include "ui/gfx/rect.h" |
13 | 13 |
14 namespace gfx { | 14 namespace gfx { |
15 | 15 |
16 // Note: The screen and monitor currently uses pixel coordinate | 16 // Note: The screen and monitor currently uses pixel coordinate |
17 // system. With ENABLE_DIP macro (which is enabled with enable_dip=1 | 17 // system. With ENABLE_DIP macro (which is enabled with enable_dip=1 |
18 // gyp flag), |bounds()| and |work_area| will return values in DIP | 18 // gyp flag), |bounds()| and |work_area| will return values in DIP |
19 // coordinate system, not in backing pixels. | 19 // coordinate system, not in backing pixels. |
20 // TODO(oshima): Update the comment when ENABLE_DIP macro is removed. | 20 // TODO(oshima): Update the comment when ENABLE_DIP macro is removed. |
21 class UI_EXPORT Monitor { | 21 class UI_EXPORT Monitor { |
22 public: | 22 public: |
| 23 // Returns the default value for the device scale factor, which is |
| 24 // given by "--default-device-scale-factor". |
| 25 static float GetDefaultDeviceScaleFactor(); |
| 26 |
23 // Creates a monitor with invalid id(-1) as default. | 27 // Creates a monitor with invalid id(-1) as default. |
24 Monitor(); | 28 Monitor(); |
25 explicit Monitor(int id); | 29 explicit Monitor(int id); |
26 Monitor(int id, const Rect& bounds); | 30 Monitor(int id, const Rect& bounds); |
27 ~Monitor(); | 31 ~Monitor(); |
28 | 32 |
29 // Sets/Gets unique identifier associated with the monitor. | 33 // Sets/Gets unique identifier associated with the monitor. |
30 int id() const { return id_; } | 34 int id() const { return id_; } |
31 void set_id(int id) { id_ = id; } | 35 void set_id(int id) { id_ = id; } |
32 | 36 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 Rect work_area_; | 86 Rect work_area_; |
83 #if defined(USE_ASH) | 87 #if defined(USE_ASH) |
84 Rect bounds_in_pixel_; | 88 Rect bounds_in_pixel_; |
85 #endif | 89 #endif |
86 float device_scale_factor_; | 90 float device_scale_factor_; |
87 }; | 91 }; |
88 | 92 |
89 } // namespace gfx | 93 } // namespace gfx |
90 | 94 |
91 #endif // UI_GFX_MONITOR_H_ | 95 #endif // UI_GFX_MONITOR_H_ |
OLD | NEW |