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

Side by Side Diff: ui/aura/single_monitor_manager.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: cleanup 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_SINGLE_MONITOR_MANAGER_H_ 5 #ifndef UI_AURA_SINGLE_MONITOR_MANAGER_H_
6 #define UI_AURA_SINGLE_MONITOR_MANAGER_H_ 6 #define UI_AURA_SINGLE_MONITOR_MANAGER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "ui/aura/aura_export.h" 11 #include "ui/aura/aura_export.h"
12 #include "ui/aura/monitor_manager.h" 12 #include "ui/aura/monitor_manager.h"
13 #include "ui/aura/window_observer.h" 13 #include "ui/aura/window_observer.h"
14 14
15 namespace gfx { 15 namespace gfx {
16 class Monitor;
16 class Rect; 17 class Rect;
17 } 18 }
18 19
19 namespace aura { 20 namespace aura {
20 21
21 // A monitor manager assuming there is one monitor. 22 // A monitor manager assuming there is one monitor.
22 class AURA_EXPORT SingleMonitorManager : public MonitorManager, 23 class AURA_EXPORT SingleMonitorManager : public MonitorManager,
23 public WindowObserver { 24 public WindowObserver {
24 public: 25 public:
25 SingleMonitorManager(); 26 SingleMonitorManager();
26 virtual ~SingleMonitorManager(); 27 virtual ~SingleMonitorManager();
27 28
28 // MonitorManager overrides: 29 // MonitorManager overrides:
29 virtual void OnNativeMonitorsChanged( 30 virtual void OnNativeMonitorsChanged(
30 const std::vector<const Monitor*>& monitors) OVERRIDE; 31 const std::vector<const gfx::Monitor*>& monitors) OVERRIDE;
31 virtual RootWindow* CreateRootWindowForMonitor( 32 virtual RootWindow* CreateRootWindowForMonitor(
32 Monitor* monitor) OVERRIDE; 33 gfx::Monitor* monitor) OVERRIDE;
33 virtual const Monitor* GetMonitorNearestWindow( 34 virtual gfx::Monitor* GetMonitorAt(size_t index) OVERRIDE;
35
36 virtual size_t GetNumMonitors() const OVERRIDE;
37
38 virtual const gfx::Monitor* GetMonitorNearestWindow(
34 const Window* window) const OVERRIDE; 39 const Window* window) const OVERRIDE;
35 virtual const Monitor* GetMonitorNearestPoint( 40 virtual gfx::Monitor* GetMonitorNearestWindow(const Window* window) OVERRIDE;
41 virtual const gfx::Monitor* GetMonitorNearestPoint(
36 const gfx::Point& point) const OVERRIDE; 42 const gfx::Point& point) const OVERRIDE;
37 virtual Monitor* GetMonitorAt(size_t index) OVERRIDE;
38 virtual size_t GetNumMonitors() const OVERRIDE;
39 virtual Monitor* GetMonitorNearestWindow(const Window* window) OVERRIDE;
40 43
41 // WindowObserver overrides: 44 // WindowObserver overrides:
42 virtual void OnWindowBoundsChanged(Window* window, 45 virtual void OnWindowBoundsChanged(Window* window,
43 const gfx::Rect& bounds) OVERRIDE; 46 const gfx::Rect& bounds) OVERRIDE;
44 virtual void OnWindowDestroying(Window* window) OVERRIDE; 47 virtual void OnWindowDestroying(Window* window) OVERRIDE;
45 48
46 private: 49 private:
47 void Init(); 50 void Init();
48 void Update(const gfx::Size size); 51 void Update(const gfx::Size size);
49 52
50 RootWindow* root_window_; 53 RootWindow* root_window_;
51 scoped_ptr<Monitor> monitor_; 54 scoped_ptr<gfx::Monitor> monitor_;
52 55
53 DISALLOW_COPY_AND_ASSIGN(SingleMonitorManager); 56 DISALLOW_COPY_AND_ASSIGN(SingleMonitorManager);
54 }; 57 };
55 58
56 } // namespace aura 59 } // namespace aura
57 60
58 #endif // UI_AURA_SINGLE_MONITOR_MANAGER_H_ 61 #endif // UI_AURA_SINGLE_MONITOR_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698