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_window_resizer.h" | 5 #include "ash/wm/workspace/workspace_window_resizer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 } | 734 } |
735 window_tracker_.Remove(magnetism_window_); | 735 window_tracker_.Remove(magnetism_window_); |
736 magnetism_window_ = NULL; | 736 magnetism_window_ = NULL; |
737 } | 737 } |
738 | 738 |
739 // Avoid magnetically snapping to popups, menus, tooltips, controls and | 739 // Avoid magnetically snapping to popups, menus, tooltips, controls and |
740 // windows that are not tracked by workspace. | 740 // windows that are not tracked by workspace. |
741 if (!window_state()->CanResize() || !window_state()->tracked_by_workspace()) | 741 if (!window_state()->CanResize() || !window_state()->tracked_by_workspace()) |
742 return false; | 742 return false; |
743 | 743 |
744 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); | 744 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); |
745 for (Shell::RootWindowList::iterator iter = root_windows.begin(); | 745 for (aura::Window::Windows::iterator iter = root_windows.begin(); |
746 iter != root_windows.end(); ++iter) { | 746 iter != root_windows.end(); ++iter) { |
747 const aura::RootWindow* root_window = *iter; | 747 const aura::Window* root_window = *iter; |
748 // Test all children from the desktop in each root window. | 748 // Test all children from the desktop in each root window. |
749 const aura::Window::Windows& children = Shell::GetContainer( | 749 const aura::Window::Windows& children = Shell::GetContainer( |
750 root_window, kShellWindowId_DefaultContainer)->children(); | 750 root_window, kShellWindowId_DefaultContainer)->children(); |
751 for (aura::Window::Windows::const_reverse_iterator i = children.rbegin(); | 751 for (aura::Window::Windows::const_reverse_iterator i = children.rbegin(); |
752 i != children.rend() && !matcher.AreEdgesObscured(); ++i) { | 752 i != children.rend() && !matcher.AreEdgesObscured(); ++i) { |
753 wm::WindowState* other_state = wm::GetWindowState(*i); | 753 wm::WindowState* other_state = wm::GetWindowState(*i); |
754 if (other_state->window() == window() || | 754 if (other_state->window() == window() || |
755 !other_state->window()->IsVisible() || | 755 !other_state->window()->IsVisible() || |
756 !other_state->IsNormalShowState() || | 756 !other_state->IsNormalShowState() || |
757 !other_state->CanResize()) { | 757 !other_state->CanResize()) { |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1009 if (!dock_layout_->is_dragged_window_docked()) | 1009 if (!dock_layout_->is_dragged_window_docked()) |
1010 dock_layout_->DockDraggedWindow(window()); | 1010 dock_layout_->DockDraggedWindow(window()); |
1011 } else { | 1011 } else { |
1012 if (dock_layout_->is_dragged_window_docked()) | 1012 if (dock_layout_->is_dragged_window_docked()) |
1013 dock_layout_->UndockDraggedWindow(); | 1013 dock_layout_->UndockDraggedWindow(); |
1014 } | 1014 } |
1015 } | 1015 } |
1016 | 1016 |
1017 } // namespace internal | 1017 } // namespace internal |
1018 } // namespace ash | 1018 } // namespace ash |
OLD | NEW |