| 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 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/message_loop/message_pump_dispatcher.h" |
| 8 #include "ui/aura/env_observer.h" | 9 #include "ui/aura/env_observer.h" |
| 9 #include "ui/aura/input_state_lookup.h" | 10 #include "ui/aura/input_state_lookup.h" |
| 10 #include "ui/aura/window.h" | 11 #include "ui/aura/window.h" |
| 11 #include "ui/compositor/compositor.h" | 12 #include "ui/compositor/compositor.h" |
| 12 #include "ui/compositor/compositor_switches.h" | 13 #include "ui/compositor/compositor_switches.h" |
| 13 #include "ui/events/event_target_iterator.h" | 14 #include "ui/events/event_target_iterator.h" |
| 14 | 15 |
| 15 #if defined(USE_X11) | 16 #if defined(USE_X11) |
| 16 #include "base/message_loop/message_pump_x11.h" | 17 #include "base/message_loop/message_pump_x11.h" |
| 17 #endif | 18 #endif |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 69 |
| 69 void Env::RemoveObserver(EnvObserver* observer) { | 70 void Env::RemoveObserver(EnvObserver* observer) { |
| 70 observers_.RemoveObserver(observer); | 71 observers_.RemoveObserver(observer); |
| 71 } | 72 } |
| 72 | 73 |
| 73 bool Env::IsMouseButtonDown() const { | 74 bool Env::IsMouseButtonDown() const { |
| 74 return input_state_lookup_.get() ? input_state_lookup_->IsMouseButtonDown() : | 75 return input_state_lookup_.get() ? input_state_lookup_->IsMouseButtonDown() : |
| 75 mouse_button_flags_ != 0; | 76 mouse_button_flags_ != 0; |
| 76 } | 77 } |
| 77 | 78 |
| 78 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) && \ | |
| 79 !defined(USE_GTK_MESSAGE_PUMP) | |
| 80 base::MessageLoop::Dispatcher* Env::GetDispatcher() { | 79 base::MessageLoop::Dispatcher* Env::GetDispatcher() { |
| 81 #if defined(USE_X11) | 80 #if defined(USE_X11) |
| 82 return base::MessagePumpX11::Current(); | 81 return base::MessagePumpX11::Current(); |
| 83 #else | 82 #else |
| 84 return dispatcher_.get(); | 83 return dispatcher_.get(); |
| 85 #endif | 84 #endif |
| 86 } | 85 } |
| 87 #endif | |
| 88 | 86 |
| 89 void Env::RootWindowActivated(RootWindow* root_window) { | 87 void Env::RootWindowActivated(RootWindow* root_window) { |
| 90 FOR_EACH_OBSERVER(EnvObserver, observers_, | 88 FOR_EACH_OBSERVER(EnvObserver, observers_, |
| 91 OnRootWindowActivated(root_window)); | 89 OnRootWindowActivated(root_window)); |
| 92 } | 90 } |
| 93 | 91 |
| 94 //////////////////////////////////////////////////////////////////////////////// | 92 //////////////////////////////////////////////////////////////////////////////// |
| 95 // Env, private: | 93 // Env, private: |
| 96 | 94 |
| 97 void Env::Init() { | 95 void Env::Init() { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 scoped_ptr<ui::EventTargetIterator> Env::GetChildIterator() const { | 130 scoped_ptr<ui::EventTargetIterator> Env::GetChildIterator() const { |
| 133 return scoped_ptr<ui::EventTargetIterator>(); | 131 return scoped_ptr<ui::EventTargetIterator>(); |
| 134 } | 132 } |
| 135 | 133 |
| 136 ui::EventTargeter* Env::GetEventTargeter() { | 134 ui::EventTargeter* Env::GetEventTargeter() { |
| 137 NOTREACHED(); | 135 NOTREACHED(); |
| 138 return NULL; | 136 return NULL; |
| 139 } | 137 } |
| 140 | 138 |
| 141 } // namespace aura | 139 } // namespace aura |
| OLD | NEW |