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

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

Issue 683703002: Notify launcher page with onTransitionChanged event (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@launcher_page_api_show_state_notify
Patch Set: nullptr like it's 1999 Created 6 years, 2 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/app_list_view.cc ('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 c9ea27655c55962d62d45ed9a73f2db58491bcb9..a44cd1439f4dcaf7ab2602aa7edc40f16e13ffb9 100644
--- a/ui/app_list/views/contents_view.cc
+++ b/ui/app_list/views/contents_view.cc
@@ -56,7 +56,14 @@ 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 should be the custom launcher page state.
+ 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);
@@ -137,6 +144,15 @@ int ContentsView::GetPageIndexForState(AppListModel::State state) const {
return it->second;
}
+AppListModel::State ContentsView::GetStateForPageIndex(int index) const {
+ std::map<int, AppListModel::State>::const_iterator it =
+ view_to_state_.find(index);
+ if (it == view_to_state_.end())
+ return AppListModel::INVALID_STATE;
+
+ return it->second;
+}
+
int ContentsView::NumLauncherPages() const {
return pagination_model_.total_pages();
}
« ui/app_list/views/app_list_view.cc ('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