[Android] Implement 3-way sensor fallback for Device Orientation.
[chromium-blink-merge.git] / ui / wm / core / wm_state.cc
blob6d580863394b0c4b0c4639647d778c071ae44796
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
3 // found in the LICENSE file.
5 #include "ui/wm/core/wm_state.h"
7 #include "ui/events/platform/platform_event_source.h"
8 #include "ui/wm/core/transient_window_controller.h"
9 #include "ui/wm/core/transient_window_stacking_client.h"
11 namespace wm {
13 WMState::WMState()
14 : window_stacking_client_(new TransientWindowStackingClient),
15 transient_window_client_(new TransientWindowController) {
16 aura::client::SetWindowStackingClient(window_stacking_client_.get());
17 aura::client::SetTransientWindowClient(transient_window_client_.get());
20 WMState::~WMState() {
21 if (aura::client::GetWindowStackingClient() == window_stacking_client_.get())
22 aura::client::SetWindowStackingClient(NULL);
24 if (aura::client::GetTransientWindowClient() ==
25 transient_window_client_.get()) {
26 aura::client::SetTransientWindowClient(NULL);
30 } // namespace wm