Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(244)

Side by Side Diff: ui/aura/monitor.h

Issue 9960042: Refactor screen/monitor so that gfx::Screen returns monitor object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef UI_AURA_MONITOR_H_
6 #define UI_AURA_MONITOR_H_
7 #pragma once
8
9 #include "base/basictypes.h"
10 #include "ui/aura/aura_export.h"
11 #include "ui/gfx/insets.h"
12 #include "ui/gfx/rect.h"
13
14 namespace aura {
15
16 class AURA_EXPORT Monitor {
17 public:
18 Monitor();
19 ~Monitor();
20
21 // Sets/gets monitor's bounds in |gfx::screen|'s coordinates,
22 // which is relative to the primary screen's origin.
23 void set_bounds(const gfx::Rect& bounds) { bounds_ = bounds;}
24 const gfx::Rect& bounds() const { return bounds_; };
25
26 // Sets/gets monitor's size.
27 void set_size(const gfx::Size& size) { bounds_.set_size(size); }
28 const gfx::Size& size() const { return bounds_.size(); }
29
30 // Sets/gets monitor's workarea insets.
31 void set_work_area_insets(const gfx::Insets& insets) {
32 work_area_insets_ = insets;
33 }
34 const gfx::Insets& work_area_insets() const { return work_area_insets_; }
35
36 // Output device's pixel scale factor. This specifies how much the
37 // UI should be scaled when the actual output has more pixels than
38 // standard monitors (which is around 100~120dpi.) For aura, this
39 // value is either 1.0 or 2.0, but may return different values on
40 // other platforms.
41 float GetDeviceScaleFactor() const {
42 return device_scale_factor_;
43 }
44
45 // Returns the monitor's work area.
46 gfx::Rect GetWorkAreaBounds() const;
47
48 private:
49 // Insets for the work area.
50 gfx::Insets work_area_insets_;
51
52 gfx::Rect bounds_;
53
54 float device_scale_factor_;
55
56 DISALLOW_COPY_AND_ASSIGN(Monitor);
57 };
58
59 } // namespace aura
60
61 #endif // UI_AURA_MONITOR_H_
OLDNEW
« no previous file with comments | « ui/aura/aura.gyp ('k') | ui/aura/monitor.cc » ('j') | ui/gfx/screen_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698