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> | 7 #include <utility> |
8 | 8 |
9 #include "ash/display/display_manager.h" | 9 #include "ash/display/display_manager.h" |
10 #include "ash/screen_util.h" | 10 #include "ash/screen_util.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 UpdateWindow(window_state, | 105 UpdateWindow(window_state, |
106 GetMaximizedOrCenteredWindowType(window_state)); | 106 GetMaximizedOrCenteredWindowType(window_state)); |
107 } | 107 } |
108 } | 108 } |
109 | 109 |
110 void LockWindowState::DetachState(wm::WindowState* window_state) { | 110 void LockWindowState::DetachState(wm::WindowState* window_state) { |
111 } | 111 } |
112 | 112 |
113 // static | 113 // static |
114 wm::WindowState* LockWindowState::SetLockWindowState(aura::Window* window) { | 114 wm::WindowState* LockWindowState::SetLockWindowState(aura::Window* window) { |
115 scoped_ptr<wm::WindowState::State> lock_state(new LockWindowState(window)); | 115 std::unique_ptr<wm::WindowState::State> lock_state( |
116 scoped_ptr<wm::WindowState::State> old_state( | 116 new LockWindowState(window)); |
| 117 std::unique_ptr<wm::WindowState::State> old_state( |
117 wm::GetWindowState(window)->SetStateObject(std::move(lock_state))); | 118 wm::GetWindowState(window)->SetStateObject(std::move(lock_state))); |
118 return wm::GetWindowState(window); | 119 return wm::GetWindowState(window); |
119 } | 120 } |
120 | 121 |
121 void LockWindowState::UpdateWindow(wm::WindowState* window_state, | 122 void LockWindowState::UpdateWindow(wm::WindowState* window_state, |
122 wm::WindowStateType target_state) { | 123 wm::WindowStateType target_state) { |
123 DCHECK(target_state == wm::WINDOW_STATE_TYPE_MINIMIZED || | 124 DCHECK(target_state == wm::WINDOW_STATE_TYPE_MINIMIZED || |
124 target_state == wm::WINDOW_STATE_TYPE_MAXIMIZED || | 125 target_state == wm::WINDOW_STATE_TYPE_MAXIMIZED || |
125 (target_state == wm::WINDOW_STATE_TYPE_NORMAL && | 126 (target_state == wm::WINDOW_STATE_TYPE_NORMAL && |
126 !window_state->CanMaximize()) || | 127 !window_state->CanMaximize()) || |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 gfx::Rect bounds = | 195 gfx::Rect bounds = |
195 ScreenUtil::GetShelfDisplayBoundsInRoot(window_state->window()); | 196 ScreenUtil::GetShelfDisplayBoundsInRoot(window_state->window()); |
196 | 197 |
197 bounds.set_height(bounds.height() - keyboard_bounds.height()); | 198 bounds.set_height(bounds.height() - keyboard_bounds.height()); |
198 | 199 |
199 VLOG(1) << "Updating window bounds to: " << bounds.ToString(); | 200 VLOG(1) << "Updating window bounds to: " << bounds.ToString(); |
200 window_state->SetBoundsDirect(bounds); | 201 window_state->SetBoundsDirect(bounds); |
201 } | 202 } |
202 | 203 |
203 } // namespace ash | 204 } // namespace ash |
OLD | NEW |