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/shelf/shelf_layout_manager.h" | 5 #include "ash/shelf/shelf_layout_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
869 show_shelf_region_in_screen.set_height(kMaxAutoHideShowShelfRegionSize); | 869 show_shelf_region_in_screen.set_height(kMaxAutoHideShowShelfRegionSize); |
870 else | 870 else |
871 show_shelf_region_in_screen.set_width(kMaxAutoHideShowShelfRegionSize); | 871 show_shelf_region_in_screen.set_width(kMaxAutoHideShowShelfRegionSize); |
872 | 872 |
873 // TODO: Figure out if we need any special handling when the keyboard is | 873 // TODO: Figure out if we need any special handling when the keyboard is |
874 // visible. | 874 // visible. |
875 return show_shelf_region_in_screen; | 875 return show_shelf_region_in_screen; |
876 } | 876 } |
877 | 877 |
878 bool ShelfLayoutManager::HasVisibleWindow() const { | 878 bool ShelfLayoutManager::HasVisibleWindow() const { |
879 WmWindow* root = | 879 aura::Window* root = shelf_widget_->GetNativeWindow()->GetRootWindow(); |
880 WmWindow::Get(shelf_widget_->GetNativeWindow())->GetRootWindow(); | 880 const aura::Window::Windows windows = |
881 const std::vector<WmWindow*> windows = | |
882 Shell::Get()->mru_window_tracker()->BuildWindowListIgnoreModal(); | 881 Shell::Get()->mru_window_tracker()->BuildWindowListIgnoreModal(); |
883 // Process the window list and check if there are any visible windows. | 882 // Process the window list and check if there are any visible windows. |
884 // Ignore app list windows that may be animating to hide after dismissal. | 883 // Ignore app list windows that may be animating to hide after dismissal. |
885 for (auto* window : windows) { | 884 for (auto* window : windows) { |
886 if (window->IsVisible() && !IsAppListWindow(window->aura_window()) && | 885 if (window->IsVisible() && !IsAppListWindow(window) && |
887 root->Contains(window)) { | 886 root->Contains(window)) { |
888 return true; | 887 return true; |
889 } | 888 } |
890 } | 889 } |
891 return false; | 890 return false; |
892 } | 891 } |
893 | 892 |
894 ShelfAutoHideState ShelfLayoutManager::CalculateAutoHideState( | 893 ShelfAutoHideState ShelfLayoutManager::CalculateAutoHideState( |
895 ShelfVisibilityState visibility_state) const { | 894 ShelfVisibilityState visibility_state) const { |
896 // Shelf is not available before login. | 895 // Shelf is not available before login. |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1156 gesture_drag_status_ = GESTURE_DRAG_NONE; | 1155 gesture_drag_status_ = GESTURE_DRAG_NONE; |
1157 } | 1156 } |
1158 | 1157 |
1159 void ShelfLayoutManager::CancelGestureDrag() { | 1158 void ShelfLayoutManager::CancelGestureDrag() { |
1160 gesture_drag_status_ = GESTURE_DRAG_CANCEL_IN_PROGRESS; | 1159 gesture_drag_status_ = GESTURE_DRAG_CANCEL_IN_PROGRESS; |
1161 UpdateVisibilityState(); | 1160 UpdateVisibilityState(); |
1162 gesture_drag_status_ = GESTURE_DRAG_NONE; | 1161 gesture_drag_status_ = GESTURE_DRAG_NONE; |
1163 } | 1162 } |
1164 | 1163 |
1165 } // namespace ash | 1164 } // namespace ash |
OLD | NEW |