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

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

Issue 9701098: MultiMonitor support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix shutdown order 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/single_monitor_manager.h" 7 #include "ui/aura/single_monitor_manager.h"
8 #include "ui/aura/root_window_host.h" 8 #include "ui/aura/root_window_host.h"
9 #include "ui/aura/window.h" 9 #include "ui/aura/window.h"
10 #include "ui/gfx/compositor/compositor.h"
10 11
11 namespace aura { 12 namespace aura {
12 13
13 // static 14 // static
14 Env* Env::instance_ = NULL; 15 Env* Env::instance_ = NULL;
15 16
16 //////////////////////////////////////////////////////////////////////////////// 17 ////////////////////////////////////////////////////////////////////////////////
17 // Env, public: 18 // Env, public:
18 19
19 Env::Env() 20 Env::Env()
20 : mouse_button_flags_(0), 21 : mouse_button_flags_(0),
21 stacking_client_(NULL), 22 stacking_client_(NULL),
22 monitor_manager_(NULL) 23 monitor_manager_(NULL)
23 { 24 {
24 SetMonitorManager(new internal::SingleMonitorManager()); 25 SetMonitorManager(new internal::SingleMonitorManager());
25 #if !defined(OS_MACOSX) 26 #if !defined(OS_MACOSX)
26 dispatcher_.reset(CreateDispatcher()); 27 dispatcher_.reset(CreateDispatcher());
27 #endif 28 #endif
29 ui::Compositor::Initialize(false);
28 } 30 }
29 31
30 Env::~Env() {} 32 Env::~Env() {
33 ui::Compositor::Terminate();
34 }
31 35
32 // static 36 // static
33 Env* Env::GetInstance() { 37 Env* Env::GetInstance() {
34 if (!instance_) 38 if (!instance_)
35 instance_ = new Env; 39 instance_ = new Env;
36 return instance_; 40 return instance_;
37 } 41 }
38 42
39 // static 43 // static
40 void Env::DeleteInstance() { 44 void Env::DeleteInstance() {
(...skipping 20 matching lines...) Expand all
61 #endif 65 #endif
62 66
63 //////////////////////////////////////////////////////////////////////////////// 67 ////////////////////////////////////////////////////////////////////////////////
64 // Env, private: 68 // Env, private:
65 69
66 void Env::NotifyWindowInitialized(Window* window) { 70 void Env::NotifyWindowInitialized(Window* window) {
67 FOR_EACH_OBSERVER(EnvObserver, observers_, OnWindowInitialized(window)); 71 FOR_EACH_OBSERVER(EnvObserver, observers_, OnWindowInitialized(window));
68 } 72 }
69 73
70 } // namespace aura 74 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698