OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "ash/wm/window_state.h" | 5 #include "ash/wm/window_state.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
9 #include "ash/screen_ash.h" | 9 #include "ash/screen_util.h" |
10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
11 #include "ash/wm/window_properties.h" | 11 #include "ash/wm/window_properties.h" |
12 #include "ash/wm/window_state_delegate.h" | 12 #include "ash/wm/window_state_delegate.h" |
13 #include "ash/wm/window_state_observer.h" | 13 #include "ash/wm/window_state_observer.h" |
14 #include "ash/wm/window_util.h" | 14 #include "ash/wm/window_util.h" |
15 #include "ash/wm/wm_types.h" | 15 #include "ash/wm/wm_types.h" |
16 #include "base/auto_reset.h" | 16 #include "base/auto_reset.h" |
17 #include "base/command_line.h" | 17 #include "base/command_line.h" |
18 #include "ui/aura/client/aura_constants.h" | 18 #include "ui/aura/client/aura_constants.h" |
19 #include "ui/aura/window.h" | 19 #include "ui/aura/window.h" |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 Restore(); | 197 Restore(); |
198 } else { | 198 } else { |
199 window_->SetProperty(aura::client::kShowStateKey, | 199 window_->SetProperty(aura::client::kShowStateKey, |
200 ui::SHOW_STATE_FULLSCREEN); | 200 ui::SHOW_STATE_FULLSCREEN); |
201 } | 201 } |
202 } | 202 } |
203 | 203 |
204 void WindowState::SetBoundsInScreen( | 204 void WindowState::SetBoundsInScreen( |
205 const gfx::Rect& bounds_in_screen) { | 205 const gfx::Rect& bounds_in_screen) { |
206 gfx::Rect bounds_in_parent = | 206 gfx::Rect bounds_in_parent = |
207 ScreenAsh::ConvertRectFromScreen(window_->parent(), | 207 ScreenUtil::ConvertRectFromScreen(window_->parent(), |
208 bounds_in_screen); | 208 bounds_in_screen); |
209 window_->SetBounds(bounds_in_parent); | 209 window_->SetBounds(bounds_in_parent); |
210 } | 210 } |
211 | 211 |
212 void WindowState::SaveCurrentBoundsForRestore() { | 212 void WindowState::SaveCurrentBoundsForRestore() { |
213 gfx::Rect bounds_in_screen = | 213 gfx::Rect bounds_in_screen = |
214 ScreenAsh::ConvertRectToScreen(window_->parent(), | 214 ScreenUtil::ConvertRectToScreen(window_->parent(), |
215 window_->bounds()); | 215 window_->bounds()); |
216 SetRestoreBoundsInScreen(bounds_in_screen); | 216 SetRestoreBoundsInScreen(bounds_in_screen); |
217 } | 217 } |
218 | 218 |
219 gfx::Rect WindowState::GetRestoreBoundsInScreen() const { | 219 gfx::Rect WindowState::GetRestoreBoundsInScreen() const { |
220 return *window_->GetProperty(aura::client::kRestoreBoundsKey); | 220 return *window_->GetProperty(aura::client::kRestoreBoundsKey); |
221 } | 221 } |
222 | 222 |
223 gfx::Rect WindowState::GetRestoreBoundsInParent() const { | 223 gfx::Rect WindowState::GetRestoreBoundsInParent() const { |
224 return ScreenAsh::ConvertRectFromScreen(window_->parent(), | 224 return ScreenUtil::ConvertRectFromScreen(window_->parent(), |
225 GetRestoreBoundsInScreen()); | 225 GetRestoreBoundsInScreen()); |
226 } | 226 } |
227 | 227 |
228 void WindowState::SetRestoreBoundsInScreen(const gfx::Rect& bounds) { | 228 void WindowState::SetRestoreBoundsInScreen(const gfx::Rect& bounds) { |
229 window_->SetProperty(aura::client::kRestoreBoundsKey, new gfx::Rect(bounds)); | 229 window_->SetProperty(aura::client::kRestoreBoundsKey, new gfx::Rect(bounds)); |
230 } | 230 } |
231 | 231 |
232 void WindowState::SetRestoreBoundsInParent(const gfx::Rect& bounds) { | 232 void WindowState::SetRestoreBoundsInParent(const gfx::Rect& bounds) { |
233 SetRestoreBoundsInScreen( | 233 SetRestoreBoundsInScreen( |
234 ScreenAsh::ConvertRectToScreen(window_->parent(), bounds)); | 234 ScreenUtil::ConvertRectToScreen(window_->parent(), bounds)); |
235 } | 235 } |
236 | 236 |
237 void WindowState::ClearRestoreBounds() { | 237 void WindowState::ClearRestoreBounds() { |
238 window_->ClearProperty(aura::client::kRestoreBoundsKey); | 238 window_->ClearProperty(aura::client::kRestoreBoundsKey); |
239 } | 239 } |
240 | 240 |
241 void WindowState::SetPreAutoManageWindowBounds( | 241 void WindowState::SetPreAutoManageWindowBounds( |
242 const gfx::Rect& bounds) { | 242 const gfx::Rect& bounds) { |
243 pre_auto_manage_window_bounds_.reset(new gfx::Rect(bounds)); | 243 pre_auto_manage_window_bounds_.reset(new gfx::Rect(bounds)); |
244 } | 244 } |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 } | 338 } |
339 return settings; | 339 return settings; |
340 } | 340 } |
341 | 341 |
342 const WindowState* GetWindowState(const aura::Window* window) { | 342 const WindowState* GetWindowState(const aura::Window* window) { |
343 return GetWindowState(const_cast<aura::Window*>(window)); | 343 return GetWindowState(const_cast<aura::Window*>(window)); |
344 } | 344 } |
345 | 345 |
346 } // namespace wm | 346 } // namespace wm |
347 } // namespace ash | 347 } // namespace ash |
OLD | NEW |