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" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 // standard monitors (which is around 100~120dpi.) The potential return | 48 // standard monitors (which is around 100~120dpi.) The potential return |
49 // values depend on each platforms. | 49 // values depend on each platforms. |
50 float device_scale_factor() const { return device_scale_factor_; } | 50 float device_scale_factor() const { return device_scale_factor_; } |
51 void set_device_scale_factor(float scale) { device_scale_factor_ = scale; } | 51 void set_device_scale_factor(float scale) { device_scale_factor_ = scale; } |
52 | 52 |
53 // Utility functions that just return the size of monitor and | 53 // Utility functions that just return the size of monitor and |
54 // work area. | 54 // work area. |
55 const Size& size() const { return bounds_.size(); } | 55 const Size& size() const { return bounds_.size(); } |
56 const Size& work_area_size() const { return work_area_.size(); } | 56 const Size& work_area_size() const { return work_area_.size(); } |
57 | 57 |
| 58 // Returns the work area insets. |
| 59 Insets GetWorkAreaInsets() const; |
| 60 |
58 // Sets the device scale factor and monitor bounds in pixel. This | 61 // Sets the device scale factor and monitor bounds in pixel. This |
59 // updates the work are using the same insets between old bounds and | 62 // updates the work are using the same insets between old bounds and |
60 // work area. | 63 // work area. |
61 void SetScaleAndBounds(float device_scale_factor, | 64 void SetScaleAndBounds(float device_scale_factor, |
62 const gfx::Rect& bounds_in_pixel); | 65 const gfx::Rect& bounds_in_pixel); |
63 | 66 |
64 // Sets the monitor's size. This updates the work area using the same insets | 67 // Sets the monitor's size. This updates the work area using the same insets |
65 // between old bounds and work area. | 68 // between old bounds and work area. |
66 void SetSize(const gfx::Size& size_in_pixel); | 69 void SetSize(const gfx::Size& size_in_pixel); |
67 | 70 |
(...skipping 21 matching lines...) Expand all Loading... |
89 Rect work_area_; | 92 Rect work_area_; |
90 #if defined(USE_AURA) | 93 #if defined(USE_AURA) |
91 Rect bounds_in_pixel_; | 94 Rect bounds_in_pixel_; |
92 #endif | 95 #endif |
93 float device_scale_factor_; | 96 float device_scale_factor_; |
94 }; | 97 }; |
95 | 98 |
96 } // namespace gfx | 99 } // namespace gfx |
97 | 100 |
98 #endif // UI_GFX_MONITOR_H_ | 101 #endif // UI_GFX_MONITOR_H_ |
OLD | NEW |