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/wm/workspace/workspace_layout_manager.h" | 5 #include "ash/wm/workspace/workspace_layout_manager.h" |
6 | 6 |
7 #include "ash/screen_ash.h" | 7 #include "ash/screen_ash.h" |
8 #include "ash/wm/property_util.h" | 8 #include "ash/wm/property_util.h" |
9 #include "ash/wm/window_util.h" | 9 #include "ash/wm/window_util.h" |
10 #include "ash/wm/workspace/workspace.h" | 10 #include "ash/wm/workspace/workspace.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 // Workspace is updated via OnRootWindowResized. | 37 // Workspace is updated via OnRootWindowResized. |
38 } | 38 } |
39 | 39 |
40 void WorkspaceLayoutManager::OnWindowAddedToLayout(aura::Window* child) { | 40 void WorkspaceLayoutManager::OnWindowAddedToLayout(aura::Window* child) { |
41 BaseLayoutManager::OnWindowAddedToLayout(child); | 41 BaseLayoutManager::OnWindowAddedToLayout(child); |
42 if (!workspace_manager_->IsManagedWindow(child)) | 42 if (!workspace_manager_->IsManagedWindow(child)) |
43 return; | 43 return; |
44 | 44 |
45 if (child->IsVisible()) { | 45 if (child->IsVisible()) { |
46 workspace_manager_->AddWindow(child); | 46 workspace_manager_->AddWindow(child); |
47 } else if (wm::IsWindowNormal(child)) { | |
48 // Align non-maximized/fullscreen windows to a grid. | |
49 SetChildBoundsDirect( | |
50 child, workspace_manager_->AlignBoundsToGrid(child->GetTargetBounds())); | |
51 } | 47 } |
52 } | 48 } |
53 | 49 |
54 void WorkspaceLayoutManager::OnWillRemoveWindowFromLayout( | 50 void WorkspaceLayoutManager::OnWillRemoveWindowFromLayout( |
55 aura::Window* child) { | 51 aura::Window* child) { |
56 workspace_manager_->RemoveWindow(child); | 52 workspace_manager_->RemoveWindow(child); |
57 BaseLayoutManager::OnWillRemoveWindowFromLayout(child); | 53 BaseLayoutManager::OnWillRemoveWindowFromLayout(child); |
58 } | 54 } |
59 | 55 |
60 void WorkspaceLayoutManager::OnChildWindowVisibilityChanged( | 56 void WorkspaceLayoutManager::OnChildWindowVisibilityChanged( |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 !workspace_manager_->IsManagingWindow(window)) { | 98 !workspace_manager_->IsManagingWindow(window)) { |
103 workspace_manager_->AddWindow(window); | 99 workspace_manager_->AddWindow(window); |
104 } | 100 } |
105 } | 101 } |
106 BaseLayoutManager::ShowStateChanged(window, last_show_state); | 102 BaseLayoutManager::ShowStateChanged(window, last_show_state); |
107 workspace_manager_->ShowStateChanged(window); | 103 workspace_manager_->ShowStateChanged(window); |
108 } | 104 } |
109 | 105 |
110 } // namespace internal | 106 } // namespace internal |
111 } // namespace ash | 107 } // namespace ash |
OLD | NEW |