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/env_observer.h" | 8 #include "ui/aura/env_observer.h" |
9 #include "ui/aura/root_window_host.h" | 9 #include "ui/aura/root_window_host.h" |
10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 void Env::Init() { | 84 void Env::Init() { |
85 #if !defined(USE_X11) && !defined(USE_MESSAGEPUMP_LINUX) | 85 #if !defined(USE_X11) && !defined(USE_MESSAGEPUMP_LINUX) |
86 dispatcher_.reset(CreateDispatcher()); | 86 dispatcher_.reset(CreateDispatcher()); |
87 #endif | 87 #endif |
88 #if defined(USE_X11) | 88 #if defined(USE_X11) |
89 // We can't do this with a root window listener because XI_HierarchyChanged | 89 // We can't do this with a root window listener because XI_HierarchyChanged |
90 // messages don't have a target window. | 90 // messages don't have a target window. |
91 base::MessagePumpAuraX11::Current()->AddObserver( | 91 base::MessagePumpAuraX11::Current()->AddObserver( |
92 &device_list_updater_aurax11_); | 92 &device_list_updater_aurax11_); |
93 #endif | 93 #endif |
94 ui::Compositor::Initialize( | 94 ui::Compositor::Initialize(); |
95 CommandLine::ForCurrentProcess()->HasSwitch( | |
96 switches::kUIEnableThreadedCompositing)); | |
97 } | 95 } |
98 | 96 |
99 void Env::NotifyWindowInitialized(Window* window) { | 97 void Env::NotifyWindowInitialized(Window* window) { |
100 FOR_EACH_OBSERVER(EnvObserver, observers_, OnWindowInitialized(window)); | 98 FOR_EACH_OBSERVER(EnvObserver, observers_, OnWindowInitialized(window)); |
101 } | 99 } |
102 | 100 |
103 void Env::NotifyRootWindowInitialized(RootWindow* root_window) { | 101 void Env::NotifyRootWindowInitialized(RootWindow* root_window) { |
104 FOR_EACH_OBSERVER(EnvObserver, | 102 FOR_EACH_OBSERVER(EnvObserver, |
105 observers_, | 103 observers_, |
106 OnRootWindowInitialized(root_window)); | 104 OnRootWindowInitialized(root_window)); |
107 } | 105 } |
108 | 106 |
109 //////////////////////////////////////////////////////////////////////////////// | 107 //////////////////////////////////////////////////////////////////////////////// |
110 // Env, ui::EventTarget implementation: | 108 // Env, ui::EventTarget implementation: |
111 | 109 |
112 bool Env::CanAcceptEvent(const ui::Event& event) { | 110 bool Env::CanAcceptEvent(const ui::Event& event) { |
113 return true; | 111 return true; |
114 } | 112 } |
115 | 113 |
116 ui::EventTarget* Env::GetParentTarget() { | 114 ui::EventTarget* Env::GetParentTarget() { |
117 return NULL; | 115 return NULL; |
118 } | 116 } |
119 | 117 |
120 } // namespace aura | 118 } // namespace aura |
OLD | NEW |