OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ash/wm/lock_window_state.h" | 5 #include "ash/wm/lock_window_state.h" |
6 | 6 |
| 7 #include <utility> |
| 8 |
7 #include "ash/display/display_manager.h" | 9 #include "ash/display/display_manager.h" |
8 #include "ash/screen_util.h" | 10 #include "ash/screen_util.h" |
9 #include "ash/shell.h" | 11 #include "ash/shell.h" |
10 #include "ash/wm/lock_layout_manager.h" | 12 #include "ash/wm/lock_layout_manager.h" |
11 #include "ash/wm/window_animations.h" | 13 #include "ash/wm/window_animations.h" |
12 #include "ash/wm/window_state.h" | 14 #include "ash/wm/window_state.h" |
13 #include "ash/wm/window_state_delegate.h" | 15 #include "ash/wm/window_state_delegate.h" |
14 #include "ash/wm/window_state_util.h" | 16 #include "ash/wm/window_state_util.h" |
15 #include "ash/wm/window_util.h" | 17 #include "ash/wm/window_util.h" |
16 #include "ash/wm/wm_event.h" | 18 #include "ash/wm/wm_event.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 } | 107 } |
106 } | 108 } |
107 | 109 |
108 void LockWindowState::DetachState(wm::WindowState* window_state) { | 110 void LockWindowState::DetachState(wm::WindowState* window_state) { |
109 } | 111 } |
110 | 112 |
111 // static | 113 // static |
112 wm::WindowState* LockWindowState::SetLockWindowState(aura::Window* window) { | 114 wm::WindowState* LockWindowState::SetLockWindowState(aura::Window* window) { |
113 scoped_ptr<wm::WindowState::State> lock_state(new LockWindowState(window)); | 115 scoped_ptr<wm::WindowState::State> lock_state(new LockWindowState(window)); |
114 scoped_ptr<wm::WindowState::State> old_state( | 116 scoped_ptr<wm::WindowState::State> old_state( |
115 wm::GetWindowState(window)->SetStateObject(lock_state.Pass())); | 117 wm::GetWindowState(window)->SetStateObject(std::move(lock_state))); |
116 return wm::GetWindowState(window); | 118 return wm::GetWindowState(window); |
117 } | 119 } |
118 | 120 |
119 void LockWindowState::UpdateWindow(wm::WindowState* window_state, | 121 void LockWindowState::UpdateWindow(wm::WindowState* window_state, |
120 wm::WindowStateType target_state) { | 122 wm::WindowStateType target_state) { |
121 DCHECK(target_state == wm::WINDOW_STATE_TYPE_MINIMIZED || | 123 DCHECK(target_state == wm::WINDOW_STATE_TYPE_MINIMIZED || |
122 target_state == wm::WINDOW_STATE_TYPE_MAXIMIZED || | 124 target_state == wm::WINDOW_STATE_TYPE_MAXIMIZED || |
123 (target_state == wm::WINDOW_STATE_TYPE_NORMAL && | 125 (target_state == wm::WINDOW_STATE_TYPE_NORMAL && |
124 !window_state->CanMaximize()) || | 126 !window_state->CanMaximize()) || |
125 target_state == wm::WINDOW_STATE_TYPE_FULLSCREEN); | 127 target_state == wm::WINDOW_STATE_TYPE_FULLSCREEN); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 gfx::Rect bounds = | 194 gfx::Rect bounds = |
193 ScreenUtil::GetShelfDisplayBoundsInRoot(window_state->window()); | 195 ScreenUtil::GetShelfDisplayBoundsInRoot(window_state->window()); |
194 | 196 |
195 bounds.set_height(bounds.height() - keyboard_bounds.height()); | 197 bounds.set_height(bounds.height() - keyboard_bounds.height()); |
196 | 198 |
197 VLOG(1) << "Updating window bounds to: " << bounds.ToString(); | 199 VLOG(1) << "Updating window bounds to: " << bounds.ToString(); |
198 window_state->SetBoundsDirect(bounds); | 200 window_state->SetBoundsDirect(bounds); |
199 } | 201 } |
200 | 202 |
201 } // namespace ash | 203 } // namespace ash |
OLD | NEW |