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

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

Issue 302803002: Refactor app list so AppsGridView owns the PaginationModel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests and bugs. Created 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_APP_LIST_MAIN_VIEW_H_ 5 #ifndef UI_APP_LIST_VIEWS_APP_LIST_MAIN_VIEW_H_
6 #define UI_APP_LIST_VIEWS_APP_LIST_MAIN_VIEW_H_ 6 #define UI_APP_LIST_VIEWS_APP_LIST_MAIN_VIEW_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/scoped_vector.h" 10 #include "base/memory/scoped_vector.h"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "base/timer/timer.h" 12 #include "base/timer/timer.h"
13 #include "ui/app_list/app_list_export.h" 13 #include "ui/app_list/app_list_export.h"
14 #include "ui/app_list/views/apps_grid_view_delegate.h" 14 #include "ui/app_list/views/apps_grid_view_delegate.h"
15 #include "ui/app_list/views/search_box_view_delegate.h" 15 #include "ui/app_list/views/search_box_view_delegate.h"
16 #include "ui/app_list/views/search_result_list_view_delegate.h" 16 #include "ui/app_list/views/search_result_list_view_delegate.h"
17 #include "ui/views/view.h" 17 #include "ui/views/view.h"
18 18
19 namespace views { 19 namespace views {
20 class Widget; 20 class Widget;
21 } 21 }
22 22
23 namespace app_list { 23 namespace app_list {
24 24
25 class AppListItem; 25 class AppListItem;
26 class AppListModel; 26 class AppListModel;
27 class AppListViewDelegate; 27 class AppListViewDelegate;
28 class ApplicationDragAndDropHost; 28 class ApplicationDragAndDropHost;
29 class ContentsView; 29 class ContentsView;
30 class PaginationModel; 30 class PaginationModel;
tapted 2014/06/02 04:02:21 Depending what else uses it.. this could possibly
Matt Giuca 2014/06/02 07:11:23 Yeah, I was planning to clean up the use of Pagina
31 class SearchBoxView; 31 class SearchBoxView;
32 32
33 // AppListMainView contains the normal view of the app list, which is shown 33 // AppListMainView contains the normal view of the app list, which is shown
34 // when the user is signed in. 34 // when the user is signed in.
35 class APP_LIST_EXPORT AppListMainView : public views::View, 35 class APP_LIST_EXPORT AppListMainView : public views::View,
36 public AppsGridViewDelegate, 36 public AppsGridViewDelegate,
37 public SearchBoxViewDelegate, 37 public SearchBoxViewDelegate,
38 public SearchResultListViewDelegate { 38 public SearchResultListViewDelegate {
39 public: 39 public:
40 // Takes ownership of |delegate|. 40 // Takes ownership of |delegate|.
41 explicit AppListMainView(AppListViewDelegate* delegate, 41 explicit AppListMainView(AppListViewDelegate* delegate,
42 PaginationModel* pagination_model,
43 gfx::NativeView parent); 42 gfx::NativeView parent);
44 virtual ~AppListMainView(); 43 virtual ~AppListMainView();
45 44
46 void ShowAppListWhenReady(); 45 void ShowAppListWhenReady();
47 46
48 void ResetForShow(); 47 void ResetForShow();
49 48
50 void Close(); 49 void Close();
51 50
52 void Prerender(); 51 void Prerender();
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 const base::Callback<void(const base::FilePath&)>& callback) OVERRIDE; 93 const base::Callback<void(const base::FilePath&)>& callback) OVERRIDE;
95 94
96 // Overridden from SearchBoxViewDelegate: 95 // Overridden from SearchBoxViewDelegate:
97 virtual void QueryChanged(SearchBoxView* sender) OVERRIDE; 96 virtual void QueryChanged(SearchBoxView* sender) OVERRIDE;
98 97
99 // Overridden from SearchResultListViewDelegate: 98 // Overridden from SearchResultListViewDelegate:
100 virtual void OnResultInstalled(SearchResult* result) OVERRIDE; 99 virtual void OnResultInstalled(SearchResult* result) OVERRIDE;
101 virtual void OnResultUninstalled(SearchResult* result) OVERRIDE; 100 virtual void OnResultUninstalled(SearchResult* result) OVERRIDE;
102 101
103 AppListViewDelegate* delegate_; // Owned by parent view (AppListView). 102 AppListViewDelegate* delegate_; // Owned by parent view (AppListView).
104 PaginationModel* pagination_model_; // Owned by AppListController. 103 PaginationModel* pagination_model_; // Owned by AppListGridView.
xiyuan 2014/05/30 15:47:47 nit: AppListGridView -> AppsGridView
Matt Giuca 2014/06/02 07:11:23 Done.
105 AppListModel* model_; // Unowned; ownership is handled by |delegate_|. 104 AppListModel* model_; // Unowned; ownership is handled by |delegate_|.
106 105
107 SearchBoxView* search_box_view_; // Owned by views hierarchy. 106 SearchBoxView* search_box_view_; // Owned by views hierarchy.
108 ContentsView* contents_view_; // Owned by views hierarchy. 107 ContentsView* contents_view_; // Owned by views hierarchy.
109 108
110 // A timer that fires when maximum allowed time to wait for icon loading has 109 // A timer that fires when maximum allowed time to wait for icon loading has
111 // passed. 110 // passed.
112 base::OneShotTimer<AppListMainView> icon_loading_wait_timer_; 111 base::OneShotTimer<AppListMainView> icon_loading_wait_timer_;
113 112
114 ScopedVector<IconLoader> pending_icon_loaders_; 113 ScopedVector<IconLoader> pending_icon_loaders_;
115 114
116 base::WeakPtrFactory<AppListMainView> weak_ptr_factory_; 115 base::WeakPtrFactory<AppListMainView> weak_ptr_factory_;
117 116
118 DISALLOW_COPY_AND_ASSIGN(AppListMainView); 117 DISALLOW_COPY_AND_ASSIGN(AppListMainView);
119 }; 118 };
120 119
121 } // namespace app_list 120 } // namespace app_list
122 121
123 #endif // UI_APP_LIST_VIEWS_APP_LIST_MAIN_VIEW_H_ 122 #endif // UI_APP_LIST_VIEWS_APP_LIST_MAIN_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698