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

Side by Side Diff: ui/app_list/views/contents_switcher_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, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/app_list/views/contents_switcher_view.h" 5 #include "ui/app_list/views/contents_switcher_view.h"
6 6
7 #include "ui/app_list/views/contents_view.h" 7 #include "ui/app_list/views/contents_view.h"
8 #include "ui/base/resource/resource_bundle.h" 8 #include "ui/base/resource/resource_bundle.h"
9 #include "ui/views/controls/button/custom_button.h" 9 #include "ui/views/controls/button/custom_button.h"
10 #include "ui/views/controls/button/image_button.h" 10 #include "ui/views/controls/button/image_button.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 void ContentsSwitcherView::SelectedPageChanged(int old_selected, 54 void ContentsSwitcherView::SelectedPageChanged(int old_selected,
55 int new_selected) { 55 int new_selected) {
56 // TODO(mgiuca): Visually indicate which page is now selected. 56 // TODO(mgiuca): Visually indicate which page is now selected.
57 } 57 }
58 58
59 void ContentsSwitcherView::TransitionStarted() { 59 void ContentsSwitcherView::TransitionStarted() {
60 } 60 }
61 61
62 void ContentsSwitcherView::TransitionChanged() { 62 void ContentsSwitcherView::TransitionChanged() {
63 // Change the indicator during a launcher page transition. 63 // Change the indicator during a launcher page transition.
64 const PaginationModel& pm = contents_view_->pagination_model(); 64 const PaginationModel* pm = contents_view_->pagination_model();
65 int old_selected = pm.selected_page(); 65 int old_selected = pm->selected_page();
66 int new_selected = pm.transition().target_page; 66 int new_selected = pm->transition().target_page;
67 if (pm.IsRevertingCurrentTransition()) { 67 if (pm->IsRevertingCurrentTransition()) {
68 // Swap the direction if the transition is reversed. 68 // Swap the direction if the transition is reversed.
69 old_selected = pm.transition().target_page; 69 old_selected = pm->transition().target_page;
70 new_selected = pm.selected_page(); 70 new_selected = pm->selected_page();
71 } 71 }
72 72
73 SelectedPageChanged(old_selected, new_selected); 73 SelectedPageChanged(old_selected, new_selected);
74 } 74 }
75 75
76 } // namespace app_list 76 } // namespace app_list
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698