| 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 #else | 108 #else |
| 109 return dispatcher_.get(); | 109 return dispatcher_.get(); |
| 110 #endif | 110 #endif |
| 111 } | 111 } |
| 112 #endif | 112 #endif |
| 113 | 113 |
| 114 //////////////////////////////////////////////////////////////////////////////// | 114 //////////////////////////////////////////////////////////////////////////////// |
| 115 // Env, private: | 115 // Env, private: |
| 116 | 116 |
| 117 void Env::Init() { | 117 void Env::Init() { |
| 118 #if defined(OS_WIN) | 118 #if !defined(USE_X11) |
| 119 dispatcher_.reset(CreateDispatcher()); | 119 dispatcher_.reset(CreateDispatcher()); |
| 120 #endif | 120 #endif |
| 121 #if defined(USE_X11) | 121 #if defined(USE_X11) |
| 122 display_change_observer_.reset(new internal::DisplayChangeObserverX11); | 122 display_change_observer_.reset(new internal::DisplayChangeObserverX11); |
| 123 | 123 |
| 124 // We can't do this with a root window listener because XI_HierarchyChanged | 124 // We can't do this with a root window listener because XI_HierarchyChanged |
| 125 // messages don't have a target window. | 125 // messages don't have a target window. |
| 126 base::MessagePumpAuraX11::Current()->AddObserver( | 126 base::MessagePumpAuraX11::Current()->AddObserver( |
| 127 &device_list_updater_aurax11_); | 127 &device_list_updater_aurax11_); |
| 128 #endif | 128 #endif |
| 129 ui::Compositor::Initialize( | 129 ui::Compositor::Initialize( |
| 130 CommandLine::ForCurrentProcess()->HasSwitch( | 130 CommandLine::ForCurrentProcess()->HasSwitch( |
| 131 switches::kUIEnableThreadedCompositing)); | 131 switches::kUIEnableThreadedCompositing)); |
| 132 } | 132 } |
| 133 | 133 |
| 134 void Env::NotifyWindowInitialized(Window* window) { | 134 void Env::NotifyWindowInitialized(Window* window) { |
| 135 FOR_EACH_OBSERVER(EnvObserver, observers_, OnWindowInitialized(window)); | 135 FOR_EACH_OBSERVER(EnvObserver, observers_, OnWindowInitialized(window)); |
| 136 } | 136 } |
| 137 | 137 |
| 138 } // namespace aura | 138 } // namespace aura |
| OLD | NEW |