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

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

Issue 2898743002: Draggable peeking/fullscreen launcher with transparent background. (Closed)
Patch Set: Migrated from wm_shelf to shelf and addressed comments! Created 3 years, 6 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 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 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
11 11
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "ui/app_list/app_list_export.h" 14 #include "ui/app_list/app_list_export.h"
15 #include "ui/app_list/app_list_model.h" 15 #include "ui/app_list/app_list_model.h"
16 #include "ui/app_list/app_list_model_observer.h" 16 #include "ui/app_list/app_list_model_observer.h"
17 #include "ui/app_list/pagination_model.h" 17 #include "ui/app_list/pagination_model.h"
18 #include "ui/app_list/pagination_model_observer.h" 18 #include "ui/app_list/pagination_model_observer.h"
19 #include "ui/app_list/views/app_list_view.h"
19 #include "ui/views/view.h" 20 #include "ui/views/view.h"
20 #include "ui/views/view_model.h" 21 #include "ui/views/view_model.h"
21 22
22 namespace gfx { 23 namespace gfx {
23 class Rect; 24 class Rect;
24 } 25 }
25 26
26 namespace app_list { 27 namespace app_list {
27 28
28 class AppsGridView; 29 class AppsGridView;
(...skipping 10 matching lines...) Expand all
39 40
40 // A view to manage launcher pages within the Launcher (eg. start page, apps 41 // A view to manage launcher pages within the Launcher (eg. start page, apps
41 // grid view, search results). There can be any number of launcher pages, only 42 // grid view, search results). There can be any number of launcher pages, only
42 // one of which can be active at a given time. ContentsView provides the user 43 // one of which can be active at a given time. ContentsView provides the user
43 // interface for switching between launcher pages, and animates the transition 44 // interface for switching between launcher pages, and animates the transition
44 // between them. 45 // between them.
45 class APP_LIST_EXPORT ContentsView : public views::View, 46 class APP_LIST_EXPORT ContentsView : public views::View,
46 public PaginationModelObserver, 47 public PaginationModelObserver,
47 public AppListModelObserver { 48 public AppListModelObserver {
48 public: 49 public:
49 explicit ContentsView(AppListMainView* app_list_main_view); 50 explicit ContentsView(AppListMainView* app_list_main_view,
51 AppListView* app_list_view);
50 ~ContentsView() override; 52 ~ContentsView() override;
51 53
52 // Initialize the pages of the launcher. Should be called after 54 // Initialize the pages of the launcher. Should be called after
53 // set_contents_switcher_view(). 55 // set_contents_switcher_view().
54 void Init(AppListModel* model); 56 void Init(AppListModel* model);
55 57
56 // The app list gets closed and drag and drop operations need to be cancelled. 58 // The app list gets closed and drag and drop operations need to be cancelled.
57 void CancelDrag(); 59 void CancelDrag();
58 60
59 // If |drag_and_drop| is not NULL it will be called upon drag and drop 61 // If |drag_and_drop| is not NULL it will be called upon drag and drop
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 // Unowned pointer to the container of the search answer web view. This 195 // Unowned pointer to the container of the search answer web view. This
194 // container view is a sub-view of search_results_page_view_. 196 // container view is a sub-view of search_results_page_view_.
195 View* search_answer_container_view_; 197 View* search_answer_container_view_;
196 198
197 // The child page views. Owned by the views hierarchy. 199 // The child page views. Owned by the views hierarchy.
198 std::vector<AppListPage*> app_list_pages_; 200 std::vector<AppListPage*> app_list_pages_;
199 201
200 // Parent view. Owned by the views hierarchy. 202 // Parent view. Owned by the views hierarchy.
201 AppListMainView* app_list_main_view_; 203 AppListMainView* app_list_main_view_;
202 204
205 AppListView* app_list_view_; // Owned by the views hierarchy.
vadimt 2017/05/26 01:27:57 const Comment in a separate line.
newcomer 2017/05/26 17:11:28 Done.
206
203 // Maps State onto |view_model_| indices. 207 // Maps State onto |view_model_| indices.
204 std::map<AppListModel::State, int> state_to_view_; 208 std::map<AppListModel::State, int> state_to_view_;
205 209
206 // Maps |view_model_| indices onto State. 210 // Maps |view_model_| indices onto State.
207 std::map<int, AppListModel::State> view_to_state_; 211 std::map<int, AppListModel::State> view_to_state_;
208 212
209 // The page that was showing before ShowSearchResults(true) was invoked. 213 // The page that was showing before ShowSearchResults(true) was invoked.
210 int page_before_search_; 214 int page_before_search_;
211 215
212 // Manages the pagination for the launcher pages. 216 // Manages the pagination for the launcher pages.
213 PaginationModel pagination_model_; 217 PaginationModel pagination_model_;
214 218
215 DISALLOW_COPY_AND_ASSIGN(ContentsView); 219 DISALLOW_COPY_AND_ASSIGN(ContentsView);
216 }; 220 };
217 221
218 } // namespace app_list 222 } // namespace app_list
219 223
220 #endif // UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_ 224 #endif // UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698