OLD | NEW |
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/contents_view.h" |
15 #include "ui/app_list/views/search_box_view_delegate.h" | 16 #include "ui/app_list/views/search_box_view_delegate.h" |
16 #include "ui/app_list/views/search_result_list_view_delegate.h" | 17 #include "ui/app_list/views/search_result_list_view_delegate.h" |
17 #include "ui/views/view.h" | 18 #include "ui/views/view.h" |
18 | 19 |
19 namespace views { | 20 namespace views { |
20 class Widget; | 21 class Widget; |
21 } | 22 } |
22 | 23 |
23 namespace app_list { | 24 namespace app_list { |
24 | 25 |
25 class AppListItem; | 26 class AppListItem; |
26 class AppListModel; | 27 class AppListModel; |
27 class AppListViewDelegate; | 28 class AppListViewDelegate; |
28 class ApplicationDragAndDropHost; | 29 class ApplicationDragAndDropHost; |
29 class ContentsView; | |
30 class PaginationModel; | 30 class PaginationModel; |
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, | 42 PaginationModel* pagination_model, |
43 gfx::NativeView parent); | 43 gfx::NativeView parent); |
44 virtual ~AppListMainView(); | 44 virtual ~AppListMainView(); |
45 | 45 |
46 void ShowAppListWhenReady(); | 46 void ShowAppListWhenReady(); |
47 | 47 |
48 void ResetForShow(); | 48 void ResetForShow(); |
49 | 49 |
50 void Close(); | 50 void Close(); |
51 | 51 |
52 void Prerender(); | 52 void Prerender(); |
53 | 53 |
54 void ModelChanged(); | 54 void ModelChanged(); |
55 | 55 |
| 56 void OnContentsViewShowStateChanged(ContentsView::ShowState show_state); |
| 57 |
56 SearchBoxView* search_box_view() const { return search_box_view_; } | 58 SearchBoxView* search_box_view() const { return search_box_view_; } |
57 | 59 |
58 // If |drag_and_drop_host| is not NULL it will be called upon drag and drop | 60 // If |drag_and_drop_host| is not NULL it will be called upon drag and drop |
59 // operations outside the application list. | 61 // operations outside the application list. |
60 void SetDragAndDropHostOfCurrentAppList( | 62 void SetDragAndDropHostOfCurrentAppList( |
61 ApplicationDragAndDropHost* drag_and_drop_host); | 63 ApplicationDragAndDropHost* drag_and_drop_host); |
62 | 64 |
63 ContentsView* contents_view() const { return contents_view_; } | 65 ContentsView* contents_view() const { return contents_view_; } |
64 | 66 |
65 // Returns true if the app list should be centered and in landscape mode. | 67 // Returns true if the app list should be centered and in landscape mode. |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 ScopedVector<IconLoader> pending_icon_loaders_; | 112 ScopedVector<IconLoader> pending_icon_loaders_; |
111 | 113 |
112 base::WeakPtrFactory<AppListMainView> weak_ptr_factory_; | 114 base::WeakPtrFactory<AppListMainView> weak_ptr_factory_; |
113 | 115 |
114 DISALLOW_COPY_AND_ASSIGN(AppListMainView); | 116 DISALLOW_COPY_AND_ASSIGN(AppListMainView); |
115 }; | 117 }; |
116 | 118 |
117 } // namespace app_list | 119 } // namespace app_list |
118 | 120 |
119 #endif // UI_APP_LIST_VIEWS_APP_LIST_MAIN_VIEW_H_ | 121 #endif // UI_APP_LIST_VIEWS_APP_LIST_MAIN_VIEW_H_ |
OLD | NEW |