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

Side by Side Diff: ash/common/shelf/shelf_layout_manager.cc

Issue 2534953006: Fix shelf auto-hide calculation for app-list visibility. (Closed)
Patch Set: Cleanup. Created 4 years 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/common/wm_shell.h » ('j') | ash/common/wm_shell.h » ('J')
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/common/shelf/shelf_layout_manager.h" 5 #include "ash/common/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 819 matching lines...) Expand 10 before | Expand all | Expand 10 after
830 if (visibility_state != SHELF_AUTO_HIDE || !wm_shelf_->IsShelfInitialized()) 830 if (visibility_state != SHELF_AUTO_HIDE || !wm_shelf_->IsShelfInitialized())
831 return SHELF_AUTO_HIDE_HIDDEN; 831 return SHELF_AUTO_HIDE_HIDDEN;
832 832
833 const int64_t shelf_display_id = WmLookup::Get() 833 const int64_t shelf_display_id = WmLookup::Get()
834 ->GetWindowForWidget(shelf_widget_) 834 ->GetWindowForWidget(shelf_widget_)
835 ->GetDisplayNearestWindow() 835 ->GetDisplayNearestWindow()
836 .id(); 836 .id();
837 837
838 // Unhide the shelf only on the active screen when the AppList is shown 838 // Unhide the shelf only on the active screen when the AppList is shown
839 // (crbug.com/312445). 839 // (crbug.com/312445).
840 if (WmShell::Get()->GetAppListTargetVisibility()) { 840 if (WmShell::Get()->GetAppListTargetVisibility(shelf_display_id) ||
841 WmWindow* window = WmShell::Get()->GetActiveWindow(); 841 WmShell::Get()->IsApplistVisible(shelf_display_id)) {
842 if (window && window->GetDisplayNearestWindow().id() == shelf_display_id) 842 return SHELF_AUTO_HIDE_SHOWN;
843 return SHELF_AUTO_HIDE_SHOWN;
844 } 843 }
845 844
846 if (shelf_widget_->status_area_widget() && 845 if (shelf_widget_->status_area_widget() &&
847 shelf_widget_->status_area_widget()->ShouldShowShelf()) 846 shelf_widget_->status_area_widget()->ShouldShowShelf())
848 return SHELF_AUTO_HIDE_SHOWN; 847 return SHELF_AUTO_HIDE_SHOWN;
849 848
850 if (shelf_widget_->IsShowingContextMenu()) 849 if (shelf_widget_->IsShowingContextMenu())
851 return SHELF_AUTO_HIDE_SHOWN; 850 return SHELF_AUTO_HIDE_SHOWN;
852 851
853 if (shelf_widget_->IsShowingOverflowBubble()) 852 if (shelf_widget_->IsShowingOverflowBubble())
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
1102 gesture_drag_status_ = GESTURE_DRAG_NONE; 1101 gesture_drag_status_ = GESTURE_DRAG_NONE;
1103 } 1102 }
1104 1103
1105 void ShelfLayoutManager::CancelGestureDrag() { 1104 void ShelfLayoutManager::CancelGestureDrag() {
1106 gesture_drag_status_ = GESTURE_DRAG_CANCEL_IN_PROGRESS; 1105 gesture_drag_status_ = GESTURE_DRAG_CANCEL_IN_PROGRESS;
1107 UpdateVisibilityState(); 1106 UpdateVisibilityState();
1108 gesture_drag_status_ = GESTURE_DRAG_NONE; 1107 gesture_drag_status_ = GESTURE_DRAG_NONE;
1109 } 1108 }
1110 1109
1111 } // namespace ash 1110 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/common/wm_shell.h » ('j') | ash/common/wm_shell.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698