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 <cstring> | 9 #include <cstring> |
10 #include <string> | 10 #include <string> |
(...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1024 // visible. | 1024 // visible. |
1025 return show_shelf_region_in_screen; | 1025 return show_shelf_region_in_screen; |
1026 } | 1026 } |
1027 | 1027 |
1028 ShelfAutoHideState ShelfLayoutManager::CalculateAutoHideState( | 1028 ShelfAutoHideState ShelfLayoutManager::CalculateAutoHideState( |
1029 ShelfVisibilityState visibility_state) const { | 1029 ShelfVisibilityState visibility_state) const { |
1030 if (visibility_state != SHELF_AUTO_HIDE || !shelf_widget_ || | 1030 if (visibility_state != SHELF_AUTO_HIDE || !shelf_widget_ || |
1031 !shelf_widget_->shelf()) | 1031 !shelf_widget_->shelf()) |
1032 return SHELF_AUTO_HIDE_HIDDEN; | 1032 return SHELF_AUTO_HIDE_HIDDEN; |
1033 | 1033 |
1034 Shell* shell = Shell::GetInstance(); | |
1035 // Unhide the shelf only on the active screen when the AppList is shown | 1034 // Unhide the shelf only on the active screen when the AppList is shown |
1036 // (crbug.com/312445). | 1035 // (crbug.com/312445). |
1037 if (shell->GetAppListTargetVisibility()) { | 1036 if (WmShell::Get()->GetAppListTargetVisibility()) { |
1038 aura::Window* active_window = wm::GetActiveWindow(); | 1037 aura::Window* active_window = wm::GetActiveWindow(); |
1039 aura::Window* shelf_window = shelf_widget_->GetNativeWindow(); | 1038 aura::Window* shelf_window = shelf_widget_->GetNativeWindow(); |
1040 if (active_window && shelf_window && | 1039 if (active_window && shelf_window && |
1041 active_window->GetRootWindow() == shelf_window->GetRootWindow()) { | 1040 active_window->GetRootWindow() == shelf_window->GetRootWindow()) { |
1042 return SHELF_AUTO_HIDE_SHOWN; | 1041 return SHELF_AUTO_HIDE_SHOWN; |
1043 } | 1042 } |
1044 } | 1043 } |
1045 | 1044 |
1046 if (shelf_widget_->status_area_widget() && | 1045 if (shelf_widget_->status_area_widget() && |
1047 shelf_widget_->status_area_widget()->ShouldShowShelf()) | 1046 shelf_widget_->status_area_widget()->ShouldShowShelf()) |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1207 if (ash::MaterialDesignController::IsShelfMaterial()) { | 1206 if (ash::MaterialDesignController::IsShelfMaterial()) { |
1208 return (state.visibility_state == SHELF_AUTO_HIDE && | 1207 return (state.visibility_state == SHELF_AUTO_HIDE && |
1209 state.auto_hide_state == SHELF_AUTO_HIDE_SHOWN) | 1208 state.auto_hide_state == SHELF_AUTO_HIDE_SHOWN) |
1210 ? 1.0f | 1209 ? 1.0f |
1211 : 0.0f; | 1210 : 0.0f; |
1212 } | 1211 } |
1213 return (state.visibility_state == SHELF_AUTO_HIDE) ? 1.0f : 0.0f; | 1212 return (state.visibility_state == SHELF_AUTO_HIDE) ? 1.0f : 0.0f; |
1214 } | 1213 } |
1215 | 1214 |
1216 } // namespace ash | 1215 } // namespace ash |
OLD | NEW |