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

Unified Diff: ui/app_list/views/contents_view.cc

Issue 380613002: Experimental app list: Added a current page indicator to the launcher. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes lanuch indicator change to start of transition animation Created 6 years, 5 months 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 side-by-side diff with in-line comments
Download patch
« ui/app_list/views/contents_view.h ('K') | « ui/app_list/views/contents_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 452e4fdfc2d17aba57f8218b3e880806ecc1afb7..42cc455545eb93d76948723a061dc727ec6b96b5 100644
--- a/ui/app_list/views/contents_view.cc
+++ b/ui/app_list/views/contents_view.cc
@@ -46,6 +46,8 @@ ContentsView::ContentsView(AppListMainView* app_list_main_view)
ContentsView::~ContentsView() {
pagination_model_.RemoveObserver(this);
+ if (contents_switcher_view_)
+ pagination_model_.RemoveObserver(contents_switcher_view_);
}
void ContentsView::InitNamedPages(AppListModel* model,
@@ -75,6 +77,7 @@ void ContentsView::InitNamedPages(AppListModel* model,
if (app_list::switches::IsExperimentalAppListEnabled())
initial_page_index = GetPageIndexForNamedPage(NAMED_PAGE_START);
+ pagination_model_.SetTransitionDurations(1500, 1500);
pagination_model_.SelectPage(initial_page_index, false);
// Needed to update the main search box visibility.
@@ -97,6 +100,13 @@ void ContentsView::SetDragAndDropHostOfCurrentAppList(
apps_container_view_->SetDragAndDropHostOfCurrentAppList(drag_and_drop_host);
}
+void ContentsView::set_contents_switcher_view(
+ ContentsSwitcherView* contents_switcher_view) {
+ contents_switcher_view_ = contents_switcher_view;
calamity 2014/07/10 03:59:36 Better DCHECK(!contents_switcher_view_) here now s
+ if (contents_switcher_view_)
+ pagination_model_.AddObserver(contents_switcher_view_);
+}
+
void ContentsView::SetActivePage(int page_index) {
if (GetActivePageIndex() == page_index)
return;
@@ -244,9 +254,9 @@ int ContentsView::AddLauncherPage(views::View* view, int resource_id) {
int page_index = view_model_->view_size();
AddChildView(view);
view_model_->Add(view, page_index);
- pagination_model_.SetTotalPages(view_model_->view_size());
if (contents_switcher_view_)
contents_switcher_view_->AddSwitcherButton(resource_id, page_index);
+ pagination_model_.SetTotalPages(view_model_->view_size());
return page_index;
}
« ui/app_list/views/contents_view.h ('K') | « ui/app_list/views/contents_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698