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

Side by Side Diff: ash/app_list/app_list_presenter_delegate.cc

Issue 2534953006: Fix shelf auto-hide calculation for app-list visibility. (Closed)
Patch Set: Address comments. 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/shelf/app_list_button.h » ('j') | no next file with comments »
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/app_list/app_list_presenter_delegate.h" 5 #include "ash/app_list/app_list_presenter_delegate.h"
6 6
7 #include "ash/aura/wm_window_aura.h" 7 #include "ash/aura/wm_window_aura.h"
8 #include "ash/common/ash_switches.h" 8 #include "ash/common/ash_switches.h"
9 #include "ash/common/shelf/app_list_button.h" 9 #include "ash/common/shelf/app_list_button.h"
10 #include "ash/common/shelf/shelf_layout_manager.h" 10 #include "ash/common/shelf/shelf_layout_manager.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 ->GetAppListButton() 157 ->GetAppListButton()
158 ->OnAppListShown(); 158 ->OnAppListShown();
159 } 159 }
160 160
161 void AppListPresenterDelegate::OnDismissed() { 161 void AppListPresenterDelegate::OnDismissed() {
162 DCHECK(is_visible_); 162 DCHECK(is_visible_);
163 DCHECK(view_); 163 DCHECK(view_);
164 164
165 is_visible_ = false; 165 is_visible_ = false;
166 166
167 // App list needs to know the new shelf layout in order to calculate its 167 // Update applist button status when app list visibility is changed.
168 // UI layout when AppListView visibility changes.
169 WmShelf* shelf = WmShelf::ForWindow( 168 WmShelf* shelf = WmShelf::ForWindow(
170 WmLookup::Get()->GetWindowForWidget(view_->GetWidget())); 169 WmLookup::Get()->GetWindowForWidget(view_->GetWidget()));
171 shelf->UpdateAutoHideState();
172
173 // Update applist button status when app list visibility is changed.
174 shelf->shelf_widget()->GetAppListButton()->OnAppListDismissed(); 170 shelf->shelf_widget()->GetAppListButton()->OnAppListDismissed();
175 } 171 }
176 172
177 void AppListPresenterDelegate::UpdateBounds() { 173 void AppListPresenterDelegate::UpdateBounds() {
178 if (!view_ || !is_visible_) 174 if (!view_ || !is_visible_)
179 return; 175 return;
180 176
181 view_->UpdateBounds(); 177 view_->UpdateBounds();
182 view_->SetAnchorPoint(GetCenterOfDisplayForView( 178 view_->SetAnchorPoint(GetCenterOfDisplayForView(
183 view_, GetMinimumBoundsHeightForAppList(view_))); 179 view_, GetMinimumBoundsHeightForAppList(view_)));
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 } 281 }
286 282
287 //////////////////////////////////////////////////////////////////////////////// 283 ////////////////////////////////////////////////////////////////////////////////
288 // AppListPresenterDelegate, WmShelfObserver implementation: 284 // AppListPresenterDelegate, WmShelfObserver implementation:
289 285
290 void AppListPresenterDelegate::OnShelfIconPositionsChanged() { 286 void AppListPresenterDelegate::OnShelfIconPositionsChanged() {
291 UpdateBounds(); 287 UpdateBounds();
292 } 288 }
293 289
294 } // namespace ash 290 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/common/shelf/app_list_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698