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/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 Loading... |
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 Loading... |
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 |
OLD | NEW |