| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/root_window_controller.h" | 5 #include "ash/root_window_controller.h" |
| 6 | 6 |
| 7 #include <queue> | 7 #include <queue> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/ash_constants.h" | 10 #include "ash/ash_constants.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 | 113 |
| 114 // Reparents |window| to |new_parent|. | 114 // Reparents |window| to |new_parent|. |
| 115 void ReparentWindow(aura::Window* window, aura::Window* new_parent) { | 115 void ReparentWindow(aura::Window* window, aura::Window* new_parent) { |
| 116 const gfx::Size src_size = window->parent()->bounds().size(); | 116 const gfx::Size src_size = window->parent()->bounds().size(); |
| 117 const gfx::Size dst_size = new_parent->bounds().size(); | 117 const gfx::Size dst_size = new_parent->bounds().size(); |
| 118 // Update the restore bounds to make it relative to the display. | 118 // Update the restore bounds to make it relative to the display. |
| 119 wm::WindowState* state = wm::GetWindowState(window); | 119 wm::WindowState* state = wm::GetWindowState(window); |
| 120 gfx::Rect restore_bounds; | 120 gfx::Rect restore_bounds; |
| 121 bool has_restore_bounds = state->HasRestoreBounds(); | 121 bool has_restore_bounds = state->HasRestoreBounds(); |
| 122 | 122 |
| 123 bool update_bounds = (state->IsNormalShowState() || state->IsMinimized()) && | 123 bool update_bounds = (state->IsNormalOrSnapped() || state->IsMinimized()) && |
| 124 new_parent->id() != internal::kShellWindowId_DockedContainer; | 124 new_parent->id() != internal::kShellWindowId_DockedContainer; |
| 125 gfx::Rect local_bounds; | 125 gfx::Rect local_bounds; |
| 126 if (update_bounds) { | 126 if (update_bounds) { |
| 127 local_bounds = state->window()->bounds(); | 127 local_bounds = state->window()->bounds(); |
| 128 MoveOriginRelativeToSize(src_size, dst_size, &local_bounds); | 128 MoveOriginRelativeToSize(src_size, dst_size, &local_bounds); |
| 129 } | 129 } |
| 130 | 130 |
| 131 if (has_restore_bounds) { | 131 if (has_restore_bounds) { |
| 132 restore_bounds = state->GetRestoreBoundsInParent(); | 132 restore_bounds = state->GetRestoreBoundsInParent(); |
| 133 MoveOriginRelativeToSize(src_size, dst_size, &restore_bounds); | 133 MoveOriginRelativeToSize(src_size, dst_size, &restore_bounds); |
| (...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 980 DisableTouchHudProjection(); | 980 DisableTouchHudProjection(); |
| 981 } | 981 } |
| 982 | 982 |
| 983 RootWindowController* GetRootWindowController( | 983 RootWindowController* GetRootWindowController( |
| 984 const aura::Window* root_window) { | 984 const aura::Window* root_window) { |
| 985 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; | 985 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; |
| 986 } | 986 } |
| 987 | 987 |
| 988 } // namespace internal | 988 } // namespace internal |
| 989 } // namespace ash | 989 } // namespace ash |
| OLD | NEW |