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

Side by Side Diff: ui/aura/monitor_aura.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: fix command line 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
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_AURA_MONITOR_H_ 5 #ifndef UI_AURA_MONITOR_H_
6 #define UI_AURA_MONITOR_H_ 6 #define UI_AURA_MONITOR_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "ui/aura/aura_export.h" 10 #include "ui/aura/aura_export.h"
11 #include "ui/gfx/insets.h" 11 #include "ui/gfx/insets.h"
12 #include "ui/gfx/monitor.h"
12 #include "ui/gfx/rect.h" 13 #include "ui/gfx/rect.h"
13 14
14 namespace aura { 15 namespace aura {
15 16
16 class AURA_EXPORT Monitor { 17 class AURA_EXPORT MonitorAura : public gfx::Monitor {
17 public: 18 public:
18 Monitor(); 19 MonitorAura();
19 ~Monitor(); 20 virtual ~MonitorAura();
20 21
21 // Sets/gets monitor's bounds in |gfx::screen|'s coordinates, 22 // Sets/gets monitor's bounds in |gfx::screen|'s coordinates,
22 // which is relative to the primary screen's origin. 23 // which is relative to the primary screen's origin.
23 void set_bounds(const gfx::Rect& bounds) { bounds_ = bounds;} 24 void set_bounds(const gfx::Rect& bounds) { bounds_ = bounds;}
24 const gfx::Rect& bounds() const { return bounds_; }; 25 const gfx::Rect& bounds() const { return bounds_; };
25 26
26 // Sets/gets monitor's size. 27 // Sets/gets monitor's size.
27 void set_size(const gfx::Size& size) { bounds_.set_size(size); } 28 void set_size(const gfx::Size& size) { bounds_.set_size(size); }
28 const gfx::Size& size() const { return bounds_.size(); } 29 const gfx::Size& size() const { return bounds_.size(); }
29 30
30 // Sets/gets monitor's workarea insets. 31 // Sets/gets monitor's workarea insets.
31 void set_work_area_insets(const gfx::Insets& insets) { 32 void set_work_area_insets(const gfx::Insets& insets) {
32 work_area_insets_ = insets; 33 work_area_insets_ = insets;
33 } 34 }
34 const gfx::Insets& work_area_insets() const { return work_area_insets_; } 35 const gfx::Insets& work_area_insets() const { return work_area_insets_; }
35 36
36 // Returns the monitor's work area. 37 // Sets the device scale factor.
37 gfx::Rect GetWorkAreaBounds() const; 38 void set_device_scale_factor(float scale) {
39 device_scale_factor_ = scale;
40 }
41
42 // gfx::Monitor overrides:
43 virtual gfx::Rect GetBounds() const OVERRIDE;
44 virtual gfx::Rect GetWorkArea() const OVERRIDE;
45 virtual float GetDeviceScaleFactor() const OVERRIDE;
38 46
39 private: 47 private:
40 // Insets for the work area. 48 // Insets for the work area.
41 gfx::Insets work_area_insets_; 49 gfx::Insets work_area_insets_;
42 50
43 gfx::Rect bounds_; 51 gfx::Rect bounds_;
44 52
45 DISALLOW_COPY_AND_ASSIGN(Monitor); 53 float device_scale_factor_;
54
55 DISALLOW_COPY_AND_ASSIGN(MonitorAura);
46 }; 56 };
47 57
48 } // namespace aura 58 } // namespace gfx
49 59
50 #endif // UI_AURA_MONITOR_H_ 60 #endif // UI_GFX_MONITOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698