| 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 "ui/aura/client/screen_position_client.h" | 8 #include "ui/aura/client/screen_position_client.h" |
| 9 #include "ui/aura/env_observer.h" | 9 #include "ui/aura/env_observer.h" |
| 10 #include "ui/aura/event_filter.h" | 10 #include "ui/aura/event_filter.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 } | 90 } |
| 91 | 91 |
| 92 void Env::SetDisplayManager(DisplayManager* display_manager) { | 92 void Env::SetDisplayManager(DisplayManager* display_manager) { |
| 93 display_manager_.reset(display_manager); | 93 display_manager_.reset(display_manager); |
| 94 #if defined(USE_X11) | 94 #if defined(USE_X11) |
| 95 // Update the display manager with latest info. | 95 // Update the display manager with latest info. |
| 96 display_change_observer_->NotifyDisplayChange(); | 96 display_change_observer_->NotifyDisplayChange(); |
| 97 #endif | 97 #endif |
| 98 } | 98 } |
| 99 | 99 |
| 100 void Env::SetEventFilter(EventFilter* event_filter) { | |
| 101 event_filter_.reset(event_filter); | |
| 102 } | |
| 103 | |
| 104 #if !defined(OS_MACOSX) | 100 #if !defined(OS_MACOSX) |
| 105 MessageLoop::Dispatcher* Env::GetDispatcher() { | 101 MessageLoop::Dispatcher* Env::GetDispatcher() { |
| 106 #if defined(USE_X11) | 102 #if defined(USE_X11) |
| 107 return base::MessagePumpAuraX11::Current(); | 103 return base::MessagePumpAuraX11::Current(); |
| 108 #else | 104 #else |
| 109 return dispatcher_.get(); | 105 return dispatcher_.get(); |
| 110 #endif | 106 #endif |
| 111 } | 107 } |
| 112 #endif | 108 #endif |
| 113 | 109 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 128 #endif | 124 #endif |
| 129 ui::Compositor::Initialize( | 125 ui::Compositor::Initialize( |
| 130 CommandLine::ForCurrentProcess()->HasSwitch( | 126 CommandLine::ForCurrentProcess()->HasSwitch( |
| 131 switches::kUIEnableThreadedCompositing)); | 127 switches::kUIEnableThreadedCompositing)); |
| 132 } | 128 } |
| 133 | 129 |
| 134 void Env::NotifyWindowInitialized(Window* window) { | 130 void Env::NotifyWindowInitialized(Window* window) { |
| 135 FOR_EACH_OBSERVER(EnvObserver, observers_, OnWindowInitialized(window)); | 131 FOR_EACH_OBSERVER(EnvObserver, observers_, OnWindowInitialized(window)); |
| 136 } | 132 } |
| 137 | 133 |
| 134 //////////////////////////////////////////////////////////////////////////////// |
| 135 // Env, ui::EventTarget implementation: |
| 136 |
| 137 bool Env::CanAcceptEvents() { |
| 138 return true; |
| 139 } |
| 140 |
| 141 ui::EventTarget* Env::GetParentTarget() { |
| 142 return NULL; |
| 143 } |
| 144 |
| 138 } // namespace aura | 145 } // namespace aura |
| OLD | NEW |