| 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/monitor_manager.h" | 7 #include "ui/aura/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/compositor/compositor.h" | 10 #include "ui/compositor/compositor.h" |
| 11 | 11 |
| 12 #if defined(USE_X11) | 12 #if defined(USE_X11) |
| 13 #include "ui/aura/monitor_change_observer_x11.h" | 13 #include "ui/aura/monitor_change_observer_x11.h" |
| 14 #endif | 14 #endif |
| 15 | 15 |
| 16 namespace aura { | 16 namespace aura { |
| 17 | 17 |
| 18 // static | 18 // static |
| 19 Env* Env::instance_ = NULL; | 19 Env* Env::instance_ = NULL; |
| 20 | 20 |
| 21 //////////////////////////////////////////////////////////////////////////////// | 21 //////////////////////////////////////////////////////////////////////////////// |
| 22 // Env, public: | 22 // Env, public: |
| 23 | 23 |
| 24 Env::Env() | 24 Env::Env() |
| 25 : mouse_button_flags_(0), | 25 : mouse_button_flags_(0), |
| 26 is_touch_down_(false), |
| 26 stacking_client_(NULL) { | 27 stacking_client_(NULL) { |
| 27 } | 28 } |
| 28 | 29 |
| 29 Env::~Env() { | 30 Env::~Env() { |
| 30 ui::Compositor::Terminate(); | 31 ui::Compositor::Terminate(); |
| 31 } | 32 } |
| 32 | 33 |
| 33 // static | 34 // static |
| 34 Env* Env::GetInstance() { | 35 Env* Env::GetInstance() { |
| 35 if (!instance_) { | 36 if (!instance_) { |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 monitor_change_observer_.reset(new internal::MonitorChangeObserverX11); | 79 monitor_change_observer_.reset(new internal::MonitorChangeObserverX11); |
| 79 #endif | 80 #endif |
| 80 ui::Compositor::Initialize(false); | 81 ui::Compositor::Initialize(false); |
| 81 } | 82 } |
| 82 | 83 |
| 83 void Env::NotifyWindowInitialized(Window* window) { | 84 void Env::NotifyWindowInitialized(Window* window) { |
| 84 FOR_EACH_OBSERVER(EnvObserver, observers_, OnWindowInitialized(window)); | 85 FOR_EACH_OBSERVER(EnvObserver, observers_, OnWindowInitialized(window)); |
| 85 } | 86 } |
| 86 | 87 |
| 87 } // namespace aura | 88 } // namespace aura |
| OLD | NEW |