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

Side by Side Diff: ui/aura/env.cc

Issue 9699013: MonitorManager to manage multiple monitors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 9 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 #include "ui/aura/env.h" 5 #include "ui/aura/env.h"
6 #include "ui/aura/env_observer.h" 6 #include "ui/aura/env_observer.h"
7 #include "ui/aura/monitor_manager.h"
7 #include "ui/aura/root_window_host.h" 8 #include "ui/aura/root_window_host.h"
8 #include "ui/aura/window.h" 9 #include "ui/aura/window.h"
9 10
10 namespace aura { 11 namespace aura {
11 12
12 // static 13 // static
13 Env* Env::instance_ = NULL; 14 Env* Env::instance_ = NULL;
14 15
15 //////////////////////////////////////////////////////////////////////////////// 16 ////////////////////////////////////////////////////////////////////////////////
16 // Env, public: 17 // Env, public:
17 18
18 Env::Env() : mouse_button_flags_(0), stacking_client_(NULL) { 19 Env::Env()
20 : mouse_button_flags_(0),
21 stacking_client_(NULL),
22 monitor_manager_(NULL)
23 {
19 #if !defined(OS_MACOSX) 24 #if !defined(OS_MACOSX)
20 dispatcher_.reset(CreateDispatcher()); 25 dispatcher_.reset(CreateDispatcher());
21 #endif 26 #endif
22 } 27 }
23 28
24 Env::~Env() {} 29 Env::~Env() {}
25 30
26 // static 31 // static
27 Env* Env::GetInstance() { 32 Env* Env::GetInstance() {
28 if (!instance_) 33 if (!instance_)
29 instance_ = new Env; 34 instance_ = new Env;
30 return instance_; 35 return instance_;
31 } 36 }
32 37
33 // static 38 // static
34 void Env::DeleteInstance() { 39 void Env::DeleteInstance() {
35 delete instance_; 40 delete instance_;
36 instance_ = NULL; 41 instance_ = NULL;
37 } 42 }
38 43
39 void Env::AddObserver(EnvObserver* observer) { 44 void Env::AddObserver(EnvObserver* observer) {
40 observers_.AddObserver(observer); 45 observers_.AddObserver(observer);
41 } 46 }
42 47
43 void Env::RemoveObserver(EnvObserver* observer) { 48 void Env::RemoveObserver(EnvObserver* observer) {
44 observers_.RemoveObserver(observer); 49 observers_.RemoveObserver(observer);
45 } 50 }
46 51
52 void Env::SetMonitorManager(MonitorManager* monitor_manager) {
53 monitor_manager_.reset(monitor_manager);
54 }
55
47 #if !defined(OS_MACOSX) 56 #if !defined(OS_MACOSX)
48 MessageLoop::Dispatcher* Env::GetDispatcher() { 57 MessageLoop::Dispatcher* Env::GetDispatcher() {
49 return dispatcher_.get(); 58 return dispatcher_.get();
50 } 59 }
51 #endif 60 #endif
52 61
53 //////////////////////////////////////////////////////////////////////////////// 62 ////////////////////////////////////////////////////////////////////////////////
54 // Env, private: 63 // Env, private:
55 64
56 void Env::NotifyWindowInitialized(Window* window) { 65 void Env::NotifyWindowInitialized(Window* window) {
57 FOR_EACH_OBSERVER(EnvObserver, observers_, OnWindowInitialized(window)); 66 FOR_EACH_OBSERVER(EnvObserver, observers_, OnWindowInitialized(window));
58 } 67 }
59 68
60 } // namespace aura 69 } // namespace aura
OLDNEW
« ash/wm/shelf_layout_manager_unittest.cc ('K') | « ui/aura/env.h ('k') | ui/aura/monitor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698