| OLD | NEW |
| 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 #include "ui/gfx/compositor/compositor.h" |
| 11 | 11 |
| 12 #if defined(USE_X11) |
| 13 #include "ui/aura/monitor_change_observer_x11.h" |
| 14 #endif |
| 15 |
| 12 namespace aura { | 16 namespace aura { |
| 13 | 17 |
| 14 // static | 18 // static |
| 15 Env* Env::instance_ = NULL; | 19 Env* Env::instance_ = NULL; |
| 16 | 20 |
| 17 //////////////////////////////////////////////////////////////////////////////// | 21 //////////////////////////////////////////////////////////////////////////////// |
| 18 // Env, public: | 22 // Env, public: |
| 19 | 23 |
| 20 Env::Env() | 24 Env::Env() |
| 21 : mouse_button_flags_(0), | 25 : mouse_button_flags_(0), |
| 22 stacking_client_(NULL), | 26 stacking_client_(NULL), |
| 23 monitor_manager_(NULL) | 27 monitor_manager_(new internal::SingleMonitorManager) |
| 28 #if defined(USE_X11) |
| 29 , monitor_change_observer_(new MonitorChangeObserverX11()) |
| 30 #endif |
| 24 { | 31 { |
| 25 SetMonitorManager(new internal::SingleMonitorManager()); | |
| 26 #if !defined(OS_MACOSX) | 32 #if !defined(OS_MACOSX) |
| 27 dispatcher_.reset(CreateDispatcher()); | 33 dispatcher_.reset(CreateDispatcher()); |
| 28 #endif | 34 #endif |
| 29 ui::Compositor::Initialize(false); | 35 ui::Compositor::Initialize(false); |
| 30 } | 36 } |
| 31 | 37 |
| 32 Env::~Env() { | 38 Env::~Env() { |
| 33 ui::Compositor::Terminate(); | 39 ui::Compositor::Terminate(); |
| 34 } | 40 } |
| 35 | 41 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 65 #endif | 71 #endif |
| 66 | 72 |
| 67 //////////////////////////////////////////////////////////////////////////////// | 73 //////////////////////////////////////////////////////////////////////////////// |
| 68 // Env, private: | 74 // Env, private: |
| 69 | 75 |
| 70 void Env::NotifyWindowInitialized(Window* window) { | 76 void Env::NotifyWindowInitialized(Window* window) { |
| 71 FOR_EACH_OBSERVER(EnvObserver, observers_, OnWindowInitialized(window)); | 77 FOR_EACH_OBSERVER(EnvObserver, observers_, OnWindowInitialized(window)); |
| 72 } | 78 } |
| 73 | 79 |
| 74 } // namespace aura | 80 } // namespace aura |
| OLD | NEW |