Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(275)

Side by Side Diff: ash/wm/workspace/workspace_layout_manager.cc

Issue 9969164: Ignoring alignment when it pushes a window out of the screen (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Not my code anymore Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ash/wm/workspace/workspace_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | ash/wm/workspace/workspace_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698