OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/wm/core/wm_state.h" | 5 #include "ui/wm/core/wm_state.h" |
6 | 6 |
| 7 #include "ui/events/platform/platform_event_source.h" |
7 #include "ui/wm/core/transient_window_controller.h" | 8 #include "ui/wm/core/transient_window_controller.h" |
8 #include "ui/wm/core/transient_window_stacking_client.h" | 9 #include "ui/wm/core/transient_window_stacking_client.h" |
9 | 10 |
10 namespace wm { | 11 namespace wm { |
11 | 12 |
12 WMState::WMState() | 13 WMState::WMState() |
13 : window_stacking_client_(new TransientWindowStackingClient), | 14 : window_stacking_client_(new TransientWindowStackingClient), |
14 transient_window_client_(new TransientWindowController) { | 15 transient_window_client_(new TransientWindowController) { |
15 aura::client::SetWindowStackingClient(window_stacking_client_.get()); | 16 aura::client::SetWindowStackingClient(window_stacking_client_.get()); |
16 aura::client::SetTransientWindowClient(transient_window_client_.get()); | 17 aura::client::SetTransientWindowClient(transient_window_client_.get()); |
| 18 if (!ui::PlatformEventSource::GetInstance()) |
| 19 event_source_ = ui::PlatformEventSource::CreateDefault(); |
17 } | 20 } |
18 | 21 |
19 WMState::~WMState() { | 22 WMState::~WMState() { |
20 if (aura::client::GetWindowStackingClient() == window_stacking_client_.get()) | 23 if (aura::client::GetWindowStackingClient() == window_stacking_client_.get()) |
21 aura::client::SetWindowStackingClient(NULL); | 24 aura::client::SetWindowStackingClient(NULL); |
22 | 25 |
23 if (aura::client::GetTransientWindowClient() == | 26 if (aura::client::GetTransientWindowClient() == |
24 transient_window_client_.get()) { | 27 transient_window_client_.get()) { |
25 aura::client::SetTransientWindowClient(NULL); | 28 aura::client::SetTransientWindowClient(NULL); |
26 } | 29 } |
27 } | 30 } |
28 | 31 |
29 } // namespace wm | 32 } // namespace wm |
OLD | NEW |