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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 Restore(); | 196 Restore(); |
197 } else { | 197 } else { |
198 window_->SetProperty(aura::client::kShowStateKey, | 198 window_->SetProperty(aura::client::kShowStateKey, |
199 ui::SHOW_STATE_FULLSCREEN); | 199 ui::SHOW_STATE_FULLSCREEN); |
200 } | 200 } |
201 } | 201 } |
202 | 202 |
203 void WindowState::SetBoundsInScreen( | 203 void WindowState::SetBoundsInScreen( |
204 const gfx::Rect& bounds_in_screen) { | 204 const gfx::Rect& bounds_in_screen) { |
205 gfx::Rect bounds_in_parent = | 205 gfx::Rect bounds_in_parent = |
206 ScreenAsh::ConvertRectFromScreen(window_->parent(), | 206 ScreenUtil::ConvertRectFromScreen(window_->parent(), |
207 bounds_in_screen); | 207 bounds_in_screen); |
208 window_->SetBounds(bounds_in_parent); | 208 window_->SetBounds(bounds_in_parent); |
209 } | 209 } |
210 | 210 |
211 void WindowState::SaveCurrentBoundsForRestore() { | 211 void WindowState::SaveCurrentBoundsForRestore() { |
212 gfx::Rect bounds_in_screen = | 212 gfx::Rect bounds_in_screen = |
213 ScreenAsh::ConvertRectToScreen(window_->parent(), | 213 ScreenUtil::ConvertRectToScreen(window_->parent(), |
214 window_->bounds()); | 214 window_->bounds()); |
215 SetRestoreBoundsInScreen(bounds_in_screen); | 215 SetRestoreBoundsInScreen(bounds_in_screen); |
216 } | 216 } |
217 | 217 |
218 gfx::Rect WindowState::GetRestoreBoundsInScreen() const { | 218 gfx::Rect WindowState::GetRestoreBoundsInScreen() const { |
219 return *window_->GetProperty(aura::client::kRestoreBoundsKey); | 219 return *window_->GetProperty(aura::client::kRestoreBoundsKey); |
220 } | 220 } |
221 | 221 |
222 gfx::Rect WindowState::GetRestoreBoundsInParent() const { | 222 gfx::Rect WindowState::GetRestoreBoundsInParent() const { |
223 return ScreenAsh::ConvertRectFromScreen(window_->parent(), | 223 return ScreenUtil::ConvertRectFromScreen(window_->parent(), |
224 GetRestoreBoundsInScreen()); | 224 GetRestoreBoundsInScreen()); |
225 } | 225 } |
226 | 226 |
227 void WindowState::SetRestoreBoundsInScreen(const gfx::Rect& bounds) { | 227 void WindowState::SetRestoreBoundsInScreen(const gfx::Rect& bounds) { |
228 window_->SetProperty(aura::client::kRestoreBoundsKey, new gfx::Rect(bounds)); | 228 window_->SetProperty(aura::client::kRestoreBoundsKey, new gfx::Rect(bounds)); |
229 } | 229 } |
230 | 230 |
231 void WindowState::SetRestoreBoundsInParent(const gfx::Rect& bounds) { | 231 void WindowState::SetRestoreBoundsInParent(const gfx::Rect& bounds) { |
232 SetRestoreBoundsInScreen( | 232 SetRestoreBoundsInScreen( |
233 ScreenAsh::ConvertRectToScreen(window_->parent(), bounds)); | 233 ScreenUtil::ConvertRectToScreen(window_->parent(), bounds)); |
234 } | 234 } |
235 | 235 |
236 void WindowState::ClearRestoreBounds() { | 236 void WindowState::ClearRestoreBounds() { |
237 window_->ClearProperty(aura::client::kRestoreBoundsKey); | 237 window_->ClearProperty(aura::client::kRestoreBoundsKey); |
238 } | 238 } |
239 | 239 |
240 void WindowState::SetPreAutoManageWindowBounds( | 240 void WindowState::SetPreAutoManageWindowBounds( |
241 const gfx::Rect& bounds) { | 241 const gfx::Rect& bounds) { |
242 pre_auto_manage_window_bounds_.reset(new gfx::Rect(bounds)); | 242 pre_auto_manage_window_bounds_.reset(new gfx::Rect(bounds)); |
243 } | 243 } |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 } | 337 } |
338 return settings; | 338 return settings; |
339 } | 339 } |
340 | 340 |
341 const WindowState* GetWindowState(const aura::Window* window) { | 341 const WindowState* GetWindowState(const aura::Window* window) { |
342 return GetWindowState(const_cast<aura::Window*>(window)); | 342 return GetWindowState(const_cast<aura::Window*>(window)); |
343 } | 343 } |
344 | 344 |
345 } // namespace wm | 345 } // namespace wm |
346 } // namespace ash | 346 } // namespace ash |
OLD | NEW |