Index: ui/app_list/views/contents_view.cc |
diff --git a/ui/app_list/views/contents_view.cc b/ui/app_list/views/contents_view.cc |
index c9ea27655c55962d62d45ed9a73f2db58491bcb9..e8efd76a0e0b96ccf18a56fc1f53063f4e6dd649 100644 |
--- a/ui/app_list/views/contents_view.cc |
+++ b/ui/app_list/views/contents_view.cc |
@@ -49,6 +49,8 @@ void ContentsView::Init(AppListModel* model, |
AppListViewDelegate* view_delegate) { |
DCHECK(model); |
+ view_delegate_ = view_delegate; |
+ |
if (app_list::switches::IsExperimentalAppListEnabled()) { |
std::vector<views::View*> custom_page_views = |
view_delegate->CreateCustomPageWebViews(GetLocalBounds().size()); |
@@ -56,7 +58,15 @@ void ContentsView::Init(AppListModel* model, |
custom_page_views.begin(); |
it != custom_page_views.end(); |
++it) { |
- AddLauncherPage(*it, IDR_APP_LIST_NOTIFICATIONS_ICON); |
+ // Only the first launcher page is considered to represent |
+ // STATE_CUSTOM_LAUNCHER_PAGE. |
+ if (it == custom_page_views.begin()) { |
+ AddLauncherPage(*it, |
+ IDR_APP_LIST_NOTIFICATIONS_ICON, |
+ AppListModel::STATE_CUSTOM_LAUNCHER_PAGE); |
+ } else { |
+ AddLauncherPage(*it, IDR_APP_LIST_NOTIFICATIONS_ICON); |
+ } |
} |
start_page_view_ = new StartPageView(app_list_main_view_, view_delegate); |
@@ -211,6 +221,17 @@ gfx::Rect ContentsView::GetOffscreenPageBounds(int page_index) const { |
return bounds; |
} |
+void ContentsView::NotifyCustomLauncherPageAnimationChanged(double progress, |
+ int current_page, |
+ int target_page) { |
+ int custom_launcher_page_index = |
+ GetPageIndexForState(AppListModel::STATE_CUSTOM_LAUNCHER_PAGE); |
+ if (custom_launcher_page_index == target_page) |
+ view_delegate_->CustomLauncherPageAnimationChanged(progress); |
+ else if (custom_launcher_page_index == current_page) |
+ view_delegate_->CustomLauncherPageAnimationChanged(1 - progress); |
+} |
+ |
void ContentsView::UpdatePageBounds() { |
// The bounds calculations will potentially be mid-transition (depending on |
// the state of the PaginationModel). |
@@ -226,6 +247,8 @@ void ContentsView::UpdatePageBounds() { |
} |
} |
+ NotifyCustomLauncherPageAnimationChanged(progress, current_page, target_page); |
+ |
// Move |current_page| from 0 to its origin. Move |target_page| from its |
// origin to 0. |
gfx::Rect on_screen(GetDefaultContentsBounds()); |