PaginationModel* pagination_model,
AppListModel* model)
: model_(model),
- show_state_(SHOW_APPS),
+ show_state_(SHOW_NONE),
top_icon_animation_pending_count_(0) {
apps_grid_view_ = new AppsGridView(app_list_main_view, pagination_model);
int cols = kPreferredCols;
int rows = kPreferredRows;
- if (app_list::switches::IsExperimentalAppListPositionEnabled()) {
+ // ShouldCenterWindow also implies that it is wide instead of tall.
+ if (app_list_main_view->ShouldCenterWindow()) {
cols = kExperimentalPreferredCols;
rows = kExperimentalPreferredRows;
}
}
void AppsContainerView::ShowActiveFolder(AppListFolderItem* folder_item) {
+ // Prevent new animations from starting if there are currently animations
+ // pending. This fixes crbug.com/357099.
+ if (top_icon_animation_pending_count_)
+ return;
+
app_list_folder_view_->SetAppListFolderItem(folder_item);
SetShowState(SHOW_ACTIVE_FOLDER, false);
}
void AppsContainerView::ShowApps(AppListFolderItem* folder_item) {
+ if (top_icon_animation_pending_count_)
+ return;
+
PrepareToShowApps(folder_item);
SetShowState(SHOW_APPS,
true); /* show apps with animation */
}
+void AppsContainerView::ResetForShowApps() {
+ SetShowState(SHOW_APPS, false /* show apps without animation */);
+ folder_background_view_->UpdateFolderContainerBubble(
+ FolderBackgroundView::NO_BUBBLE);
+}
+
void AppsContainerView::SetDragAndDropHostOfCurrentAppList(
ApplicationDragAndDropHost* drag_and_drop_host) {
apps_grid_view()->SetDragAndDropHostOfCurrentAppList(drag_and_drop_host);
void AppsContainerView::ReparentFolderItemTransit(
AppListFolderItem* folder_item) {
+ if (top_icon_animation_pending_count_)
+ return;
+
PrepareToShowApps(folder_item);
SetShowState(SHOW_ITEM_REPARENT, false);
}
+bool AppsContainerView::IsInFolderView() const {
+ return show_state_ == SHOW_ACTIVE_FOLDER;
+}
+
gfx::Size AppsContainerView::GetPreferredSize() {
const gfx::Size grid_size = apps_grid_view_->GetPreferredSize();
const gfx::Size folder_view_size = app_list_folder_view_->GetPreferredSize();
apps_grid_view_->ScheduleShowHideAnimation(true);
} else {
app_list_folder_view_->HideViewImmediately();
- apps_grid_view_->SetVisible(true);
+ apps_grid_view_->ResetForShowApps();
}
break;
case SHOW_ACTIVE_FOLDER: