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 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1032 // In Chrome OS Material Design, when shelf is hidden during auto hide state, | 1032 // In Chrome OS Material Design, when shelf is hidden during auto hide state, |
1033 // target bounds are also hidden. So the window can extend to the edge of | 1033 // target bounds are also hidden. So the window can extend to the edge of |
1034 // screen. | 1034 // screen. |
1035 return (state.visibility_state == SHELF_AUTO_HIDE && | 1035 return (state.visibility_state == SHELF_AUTO_HIDE && |
1036 state.auto_hide_state == SHELF_AUTO_HIDE_SHOWN) | 1036 state.auto_hide_state == SHELF_AUTO_HIDE_SHOWN) |
1037 ? 1.0f | 1037 ? 1.0f |
1038 : 0.0f; | 1038 : 0.0f; |
1039 } | 1039 } |
1040 | 1040 |
1041 bool ShelfLayoutManager::IsShelfHiddenForFullscreen() const { | 1041 bool ShelfLayoutManager::IsShelfHiddenForFullscreen() const { |
1042 const WmWindow* fullscreen_window = wm::GetWindowForFullscreenMode( | 1042 const aura::Window* fullscreen_window = |
1043 WmWindow::Get(shelf_widget_->GetNativeWindow())); | 1043 wm::GetWindowForFullscreenMode(shelf_widget_->GetNativeWindow()); |
1044 return fullscreen_window && | 1044 return fullscreen_window && |
1045 fullscreen_window->GetWindowState()->hide_shelf_when_fullscreen(); | 1045 wm::GetWindowState(fullscreen_window)->hide_shelf_when_fullscreen(); |
1046 } | 1046 } |
1047 | 1047 |
1048 bool ShelfLayoutManager::IsShelfAutoHideForFullscreenMaximized() const { | 1048 bool ShelfLayoutManager::IsShelfAutoHideForFullscreenMaximized() const { |
1049 wm::WindowState* active_window = wm::GetActiveWindowState(); | 1049 wm::WindowState* active_window = wm::GetActiveWindowState(); |
1050 return active_window && | 1050 return active_window && |
1051 active_window->autohide_shelf_when_maximized_or_fullscreen(); | 1051 active_window->autohide_shelf_when_maximized_or_fullscreen(); |
1052 } | 1052 } |
1053 | 1053 |
1054 //////////////////////////////////////////////////////////////////////////////// | 1054 //////////////////////////////////////////////////////////////////////////////// |
1055 // ShelfLayoutManager, Gesture functions: | 1055 // ShelfLayoutManager, Gesture functions: |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1142 gesture_drag_status_ = GESTURE_DRAG_NONE; | 1142 gesture_drag_status_ = GESTURE_DRAG_NONE; |
1143 } | 1143 } |
1144 | 1144 |
1145 void ShelfLayoutManager::CancelGestureDrag() { | 1145 void ShelfLayoutManager::CancelGestureDrag() { |
1146 gesture_drag_status_ = GESTURE_DRAG_CANCEL_IN_PROGRESS; | 1146 gesture_drag_status_ = GESTURE_DRAG_CANCEL_IN_PROGRESS; |
1147 UpdateVisibilityState(); | 1147 UpdateVisibilityState(); |
1148 gesture_drag_status_ = GESTURE_DRAG_NONE; | 1148 gesture_drag_status_ = GESTURE_DRAG_NONE; |
1149 } | 1149 } |
1150 | 1150 |
1151 } // namespace ash | 1151 } // namespace ash |
OLD | NEW |