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

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

Issue 660463003: Add a SearchResultPageView to the experimental app list. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@search_result_container_view
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
« no previous file with comments | « ui/app_list/views/app_list_view_unittest.cc ('k') | ui/app_list/views/contents_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 15 matching lines...) Expand all
26 class AppsGridView; 26 class AppsGridView;
27 class ApplicationDragAndDropHost; 27 class ApplicationDragAndDropHost;
28 class AppListFolderItem; 28 class AppListFolderItem;
29 class AppListMainView; 29 class AppListMainView;
30 class AppListModel; 30 class AppListModel;
31 class AppListViewDelegate; 31 class AppListViewDelegate;
32 class AppsContainerView; 32 class AppsContainerView;
33 class ContentsSwitcherView; 33 class ContentsSwitcherView;
34 class PaginationModel; 34 class PaginationModel;
35 class SearchResultListView; 35 class SearchResultListView;
36 class SearchResultPageView;
36 class StartPageView; 37 class StartPageView;
37 38
38 // A view to manage launcher pages within the Launcher (eg. start page, apps 39 // A view to manage launcher pages within the Launcher (eg. start page, apps
39 // grid view, search results). There can be any number of launcher pages, only 40 // grid view, search results). There can be any number of launcher pages, only
40 // one of which can be active at a given time. ContentsView provides the user 41 // one of which can be active at a given time. ContentsView provides the user
41 // interface for switching between launcher pages, and animates the transition 42 // interface for switching between launcher pages, and animates the transition
42 // between them. 43 // between them.
43 class APP_LIST_EXPORT ContentsView : public views::View, 44 class APP_LIST_EXPORT ContentsView : public views::View,
44 public PaginationModelObserver { 45 public PaginationModelObserver {
45 public: 46 public:
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 // Gets the index of a launcher page in |view_model_|, by State. Returns 82 // Gets the index of a launcher page in |view_model_|, by State. Returns
82 // -1 if there is no view for |state|. 83 // -1 if there is no view for |state|.
83 int GetPageIndexForState(AppListModel::State state) const; 84 int GetPageIndexForState(AppListModel::State state) const;
84 85
85 int NumLauncherPages() const; 86 int NumLauncherPages() const;
86 87
87 void Prerender(); 88 void Prerender();
88 89
89 AppsContainerView* apps_container_view() { return apps_container_view_; } 90 AppsContainerView* apps_container_view() { return apps_container_view_; }
90 StartPageView* start_page_view() { return start_page_view_; } 91 StartPageView* start_page_view() { return start_page_view_; }
91 SearchResultListView* search_results_view() { return search_results_view_; } 92 SearchResultListView* search_results_list_view() {
93 return search_results_list_view_;
94 }
95 SearchResultPageView* search_results_page_view() {
96 return search_results_page_view_;
97 }
92 views::View* GetPageView(int index); 98 views::View* GetPageView(int index);
93 99
94 // Adds a blank launcher page. For use in tests only. 100 // Adds a blank launcher page. For use in tests only.
95 void AddBlankPageForTesting(); 101 void AddBlankPageForTesting();
96 102
97 // Returns the pagination model for the ContentsView. 103 // Returns the pagination model for the ContentsView.
98 const PaginationModel& pagination_model() { return pagination_model_; } 104 const PaginationModel& pagination_model() { return pagination_model_; }
99 105
100 // Returns search box bounds to use for content views that do not specify 106 // Returns search box bounds to use for content views that do not specify
101 // their own custom layout. 107 // their own custom layout.
(...skipping 13 matching lines...) Expand all
115 void SelectedPageChanged(int old_selected, int new_selected) override; 121 void SelectedPageChanged(int old_selected, int new_selected) override;
116 void TransitionStarted() override; 122 void TransitionStarted() override;
117 void TransitionChanged() override; 123 void TransitionChanged() override;
118 124
119 private: 125 private:
120 // Sets the active launcher page, accounting for whether the change is for 126 // Sets the active launcher page, accounting for whether the change is for
121 // search results. 127 // search results.
122 void SetActivePageInternal(int page_index, bool show_search_results); 128 void SetActivePageInternal(int page_index, bool show_search_results);
123 129
124 // Invoked when active view is changed. 130 // Invoked when active view is changed.
125 void ActivePageChanged(bool show_search_results); 131 void ActivePageChanged();
126 132
127 // Returns the size of the default content area. 133 // Returns the size of the default content area.
128 gfx::Size GetDefaultContentsSize() const; 134 gfx::Size GetDefaultContentsSize() const;
129 135
130 // Gets the origin (the off-screen resting place) for a given launcher page 136 // Gets the origin (the off-screen resting place) for a given launcher page
131 // with index |page_index|. 137 // with index |page_index|.
132 gfx::Rect GetOffscreenPageBounds(int page_index) const; 138 gfx::Rect GetOffscreenPageBounds(int page_index) const;
133 139
134 // Notifies the view delegate that the custom launcher page's animation has 140 // Notifies the view delegate that the custom launcher page's animation has
135 // changed. 141 // changed.
(...skipping 19 matching lines...) Expand all
155 int resource_id, 161 int resource_id,
156 AppListModel::State state); 162 AppListModel::State state);
157 163
158 // Gets the PaginationModel owned by the AppsGridView. 164 // Gets the PaginationModel owned by the AppsGridView.
159 // Note: This is different to |pagination_model_|, which manages top-level 165 // Note: This is different to |pagination_model_|, which manages top-level
160 // launcher-page pagination. 166 // launcher-page pagination.
161 PaginationModel* GetAppsPaginationModel(); 167 PaginationModel* GetAppsPaginationModel();
162 168
163 // Special sub views of the ContentsView. All owned by the views hierarchy. 169 // Special sub views of the ContentsView. All owned by the views hierarchy.
164 AppsContainerView* apps_container_view_; 170 AppsContainerView* apps_container_view_;
165 SearchResultListView* search_results_view_; 171
172 // Only used in the normal app list.
173 SearchResultListView* search_results_list_view_;
174
175 // Only used in the experimental app list.
176 SearchResultPageView* search_results_page_view_;
166 StartPageView* start_page_view_; 177 StartPageView* start_page_view_;
167 178
168 AppListMainView* app_list_main_view_; // Parent view, owns this. 179 AppListMainView* app_list_main_view_; // Parent view, owns this.
169 // Sibling view, owned by |app_list_main_view_|. 180 // Sibling view, owned by |app_list_main_view_|.
170 ContentsSwitcherView* contents_switcher_view_; 181 ContentsSwitcherView* contents_switcher_view_;
171 182
172 scoped_ptr<views::ViewModel> view_model_; 183 scoped_ptr<views::ViewModel> view_model_;
173 184
174 // Maps State onto |view_model_| indices. 185 // Maps State onto |view_model_| indices.
175 std::map<AppListModel::State, int> state_to_view_; 186 std::map<AppListModel::State, int> state_to_view_;
176 187
177 // Maps |view_model_| indices onto State. 188 // Maps |view_model_| indices onto State.
178 std::map<int, AppListModel::State> view_to_state_; 189 std::map<int, AppListModel::State> view_to_state_;
179 190
180 // The page that was showing before ShowSearchResults(true) was invoked. 191 // The page that was showing before ShowSearchResults(true) was invoked.
181 int page_before_search_; 192 int page_before_search_;
182 193
183 // Manages the pagination for the launcher pages. 194 // Manages the pagination for the launcher pages.
184 PaginationModel pagination_model_; 195 PaginationModel pagination_model_;
185 196
186 DISALLOW_COPY_AND_ASSIGN(ContentsView); 197 DISALLOW_COPY_AND_ASSIGN(ContentsView);
187 }; 198 };
188 199
189 } // namespace app_list 200 } // namespace app_list
190 201
191 #endif // UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_ 202 #endif // UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_
OLDNEW
« no previous file with comments | « ui/app_list/views/app_list_view_unittest.cc ('k') | ui/app_list/views/contents_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698