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

Side by Side Diff: ui/app_list/views/contents_view.h

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: 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_ 5 #ifndef UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_
6 #define UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_ 6 #define UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 // Invoked when active view is changed. 124 // Invoked when active view is changed.
125 void ActivePageChanged(bool show_search_results); 125 void ActivePageChanged(bool show_search_results);
126 126
127 // Returns the size of the default content area. 127 // Returns the size of the default content area.
128 gfx::Size GetDefaultContentsSize() const; 128 gfx::Size GetDefaultContentsSize() const;
129 129
130 // Gets the origin (the off-screen resting place) for a given launcher page 130 // Gets the origin (the off-screen resting place) for a given launcher page
131 // with index |page_index|. 131 // with index |page_index|.
132 gfx::Rect GetOffscreenPageBounds(int page_index) const; 132 gfx::Rect GetOffscreenPageBounds(int page_index) const;
133 133
134 // Notifies the view delegate that the custom launcher page's animation has
135 // changed.
136 void NotifyCustomLauncherPageAnimationChanged(double progress,
137 int current_page,
138 int target_page);
139
134 // Calculates and sets the bounds for the subviews. If there is currently an 140 // Calculates and sets the bounds for the subviews. If there is currently an
135 // animation, this positions the views as appropriate for the current frame. 141 // animation, this positions the views as appropriate for the current frame.
136 void UpdatePageBounds(); 142 void UpdatePageBounds();
137 143
138 // Adds |view| as a new page to the end of the list of launcher pages. The 144 // Adds |view| as a new page to the end of the list of launcher pages. The
139 // view is inserted as a child of the ContentsView, and a button with 145 // view is inserted as a child of the ContentsView, and a button with
140 // |resource_id| is added to the ContentsSwitcherView. There is no name 146 // |resource_id| is added to the ContentsSwitcherView. There is no name
141 // associated with the page. Returns the index of the new page. 147 // associated with the page. Returns the index of the new page.
142 int AddLauncherPage(views::View* view, int resource_id); 148 int AddLauncherPage(views::View* view, int resource_id);
143 149
144 // Adds |view| as a new page to the end of the list of launcher pages. The 150 // Adds |view| as a new page to the end of the list of launcher pages. The
145 // view is inserted as a child of the ContentsView, and a button with 151 // view is inserted as a child of the ContentsView, and a button with
146 // |resource_id| is added to the ContentsSwitcherView. The page is associated 152 // |resource_id| is added to the ContentsSwitcherView. The page is associated
147 // with the name |state|. Returns the index of the new page. 153 // with the name |state|. Returns the index of the new page.
148 int AddLauncherPage(views::View* view, 154 int AddLauncherPage(views::View* view,
149 int resource_id, 155 int resource_id,
150 AppListModel::State state); 156 AppListModel::State state);
151 157
152 // Gets the PaginationModel owned by the AppsGridView. 158 // Gets the PaginationModel owned by the AppsGridView.
153 // Note: This is different to |pagination_model_|, which manages top-level 159 // Note: This is different to |pagination_model_|, which manages top-level
154 // launcher-page pagination. 160 // launcher-page pagination.
155 PaginationModel* GetAppsPaginationModel(); 161 PaginationModel* GetAppsPaginationModel();
156 162
157 // Special sub views of the ContentsView. All owned by the views hierarchy. 163 // Special sub views of the ContentsView. All owned by the views hierarchy.
158 AppsContainerView* apps_container_view_; 164 AppsContainerView* apps_container_view_;
159 SearchResultListView* search_results_view_; 165 SearchResultListView* search_results_view_;
160 StartPageView* start_page_view_; 166 StartPageView* start_page_view_;
161 167
168 AppListViewDelegate* view_delegate_;
tapted 2014/11/06 06:05:45 needs to be initialized. But I'd prefer exposing
calamity 2014/11/07 03:43:29 Done.
169
162 AppListMainView* app_list_main_view_; // Parent view, owns this. 170 AppListMainView* app_list_main_view_; // Parent view, owns this.
163 // Sibling view, owned by |app_list_main_view_|. 171 // Sibling view, owned by |app_list_main_view_|.
164 ContentsSwitcherView* contents_switcher_view_; 172 ContentsSwitcherView* contents_switcher_view_;
165 173
166 scoped_ptr<views::ViewModel> view_model_; 174 scoped_ptr<views::ViewModel> view_model_;
167 175
168 // Maps State onto |view_model_| indices. 176 // Maps State onto |view_model_| indices.
169 std::map<AppListModel::State, int> state_to_view_; 177 std::map<AppListModel::State, int> state_to_view_;
170 178
171 // Maps |view_model_| indices onto State. 179 // Maps |view_model_| indices onto State.
172 std::map<int, AppListModel::State> view_to_state_; 180 std::map<int, AppListModel::State> view_to_state_;
173 181
174 // The page that was showing before ShowSearchResults(true) was invoked. 182 // The page that was showing before ShowSearchResults(true) was invoked.
175 int page_before_search_; 183 int page_before_search_;
176 184
177 // Manages the pagination for the launcher pages. 185 // Manages the pagination for the launcher pages.
178 PaginationModel pagination_model_; 186 PaginationModel pagination_model_;
179 187
180 DISALLOW_COPY_AND_ASSIGN(ContentsView); 188 DISALLOW_COPY_AND_ASSIGN(ContentsView);
181 }; 189 };
182 190
183 } // namespace app_list 191 } // namespace app_list
184 192
185 #endif // UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_ 193 #endif // UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698