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

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

Issue 497413003: Refactor app list event handling and prerendering. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reorder in .cc file. Created 6 years, 3 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
« no previous file with comments | « ui/app_list/views/apps_grid_view.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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 SearchResultListView* search_results_view() { return search_results_view_; } 96 SearchResultListView* search_results_view() { return search_results_view_; }
97 views::View* GetPageView(int index); 97 views::View* GetPageView(int index);
98 98
99 // Adds a blank launcher page. For use in tests only. 99 // Adds a blank launcher page. For use in tests only.
100 void AddBlankPageForTesting(); 100 void AddBlankPageForTesting();
101 101
102 // Overridden from views::View: 102 // Overridden from views::View:
103 virtual gfx::Size GetPreferredSize() const OVERRIDE; 103 virtual gfx::Size GetPreferredSize() const OVERRIDE;
104 virtual void Layout() OVERRIDE; 104 virtual void Layout() OVERRIDE;
105 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; 105 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE;
106 virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) OVERRIDE;
107 106
108 // Overridden from PaginationModelObserver: 107 // Overridden from PaginationModelObserver:
109 virtual void TotalPagesChanged() OVERRIDE; 108 virtual void TotalPagesChanged() OVERRIDE;
110 virtual void SelectedPageChanged(int old_selected, int new_selected) OVERRIDE; 109 virtual void SelectedPageChanged(int old_selected, int new_selected) OVERRIDE;
111 virtual void TransitionStarted() OVERRIDE; 110 virtual void TransitionStarted() OVERRIDE;
112 virtual void TransitionChanged() OVERRIDE; 111 virtual void TransitionChanged() OVERRIDE;
113 112
114 // Returns the pagination model for the ContentsView. 113 // Returns the pagination model for the ContentsView.
115 const PaginationModel& pagination_model() { return pagination_model_; } 114 const PaginationModel& pagination_model() { return pagination_model_; }
116 115
(...skipping 19 matching lines...) Expand all
136 // view is inserted as a child of the ContentsView, and a button with 135 // view is inserted as a child of the ContentsView, and a button with
137 // |resource_id| is added to the ContentsSwitcherView. The page is associated 136 // |resource_id| is added to the ContentsSwitcherView. The page is associated
138 // with the name |named_page|. Returns the index of the new page. 137 // with the name |named_page|. Returns the index of the new page.
139 int AddLauncherPage(views::View* view, int resource_id, NamedPage named_page); 138 int AddLauncherPage(views::View* view, int resource_id, NamedPage named_page);
140 139
141 // Gets the PaginationModel owned by the AppsGridView. 140 // Gets the PaginationModel owned by the AppsGridView.
142 // Note: This is different to |pagination_model_|, which manages top-level 141 // Note: This is different to |pagination_model_|, which manages top-level
143 // launcher-page pagination. 142 // launcher-page pagination.
144 PaginationModel* GetAppsPaginationModel(); 143 PaginationModel* GetAppsPaginationModel();
145 144
146 // Overridden from ui::EventHandler:
147 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
148 virtual void OnScrollEvent(ui::ScrollEvent* event) OVERRIDE;
149
150 // Special sub views of the ContentsView. All owned by the views hierarchy. 145 // Special sub views of the ContentsView. All owned by the views hierarchy.
151 AppsContainerView* apps_container_view_; 146 AppsContainerView* apps_container_view_;
152 SearchResultListView* search_results_view_; 147 SearchResultListView* search_results_view_;
153 StartPageView* start_page_view_; 148 StartPageView* start_page_view_;
154 149
155 AppListMainView* app_list_main_view_; // Parent view, owns this. 150 AppListMainView* app_list_main_view_; // Parent view, owns this.
156 // Sibling view, owned by |app_list_main_view_|. 151 // Sibling view, owned by |app_list_main_view_|.
157 ContentsSwitcherView* contents_switcher_view_; 152 ContentsSwitcherView* contents_switcher_view_;
158 153
159 scoped_ptr<views::ViewModel> view_model_; 154 scoped_ptr<views::ViewModel> view_model_;
160 // Maps NamedPage onto |view_model_| indices. 155 // Maps NamedPage onto |view_model_| indices.
161 std::map<NamedPage, int> named_page_to_view_; 156 std::map<NamedPage, int> named_page_to_view_;
162 157
163 // The page that was showing before ShowSearchResults(true) was invoked. 158 // The page that was showing before ShowSearchResults(true) was invoked.
164 int page_before_search_; 159 int page_before_search_;
165 160
166 // Manages the pagination for the launcher pages. 161 // Manages the pagination for the launcher pages.
167 PaginationModel pagination_model_; 162 PaginationModel pagination_model_;
168 163
169 DISALLOW_COPY_AND_ASSIGN(ContentsView); 164 DISALLOW_COPY_AND_ASSIGN(ContentsView);
170 }; 165 };
171 166
172 } // namespace app_list 167 } // namespace app_list
173 168
174 #endif // UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_ 169 #endif // UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_
OLDNEW
« no previous file with comments | « ui/app_list/views/apps_grid_view.cc ('k') | ui/app_list/views/contents_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698