OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_START_PAGE_VIEW_H_ | 5 #ifndef UI_APP_LIST_VIEWS_START_PAGE_VIEW_H_ |
6 #define UI_APP_LIST_VIEWS_START_PAGE_VIEW_H_ | 6 #define UI_APP_LIST_VIEWS_START_PAGE_VIEW_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "ui/app_list/app_list_model_observer.h" |
| 10 #include "ui/app_list/app_list_view_delegate_observer.h" |
9 #include "ui/views/controls/button/button.h" | 11 #include "ui/views/controls/button/button.h" |
10 #include "ui/views/view.h" | 12 #include "ui/views/view.h" |
11 | 13 |
12 namespace content { | 14 namespace content { |
13 class WebContents; | 15 class WebContents; |
14 } | 16 } |
15 | 17 |
16 namespace app_list { | 18 namespace app_list { |
17 | 19 |
18 class AppListMainView; | 20 class AppListMainView; |
| 21 class AppListModel; |
| 22 class AppListViewDelegate; |
| 23 class TileItemView; |
19 | 24 |
20 // The start page for the experimental app list. | 25 // The start page for the experimental app list. |
21 class StartPageView : public views::View, public views::ButtonListener { | 26 class StartPageView : public views::View, |
| 27 public views::ButtonListener, |
| 28 public AppListViewDelegateObserver, |
| 29 public AppListModelObserver { |
22 public: | 30 public: |
23 StartPageView(AppListMainView* app_list_main_view, | 31 StartPageView(AppListMainView* app_list_main_view, |
24 content::WebContents* start_page_web_contents); | 32 AppListViewDelegate* view_delegate); |
25 virtual ~StartPageView(); | 33 virtual ~StartPageView(); |
26 | 34 |
27 void Reset(); | 35 void Reset(); |
28 | 36 |
| 37 const std::vector<TileItemView*>& tile_views() const { return tile_views_; } |
| 38 |
29 private: | 39 private: |
| 40 void SetModel(AppListModel* model); |
| 41 |
30 // Overridden from views::ButtonListener: | 42 // Overridden from views::ButtonListener: |
31 virtual void ButtonPressed(views::Button* sender, | 43 virtual void ButtonPressed(views::Button* sender, |
32 const ui::Event& event) OVERRIDE; | 44 const ui::Event& event) OVERRIDE; |
33 | 45 |
| 46 // Overridden from AppListViewDelegateObserver: |
| 47 virtual void OnProfilesChanged() OVERRIDE; |
| 48 |
| 49 // Overridden from AppListModelObserver: |
| 50 virtual void OnAppListModelStatusChanged() OVERRIDE; |
| 51 virtual void OnAppListItemAdded(AppListItem* item) OVERRIDE; |
| 52 virtual void OnAppListItemDeleted() OVERRIDE; |
| 53 virtual void OnAppListItemUpdated(AppListItem* item) OVERRIDE; |
| 54 |
34 // The parent view of ContentsView which is the parent of this view. | 55 // The parent view of ContentsView which is the parent of this view. |
35 AppListMainView* app_list_main_view_; | 56 AppListMainView* app_list_main_view_; |
36 | 57 |
| 58 AppListModel* model_; // Owned by AppListSyncableService. |
| 59 |
| 60 AppListViewDelegate* view_delegate_; // Owned by AppListView. |
| 61 |
37 views::View* instant_container_; // Owned by views hierarchy. | 62 views::View* instant_container_; // Owned by views hierarchy. |
| 63 views::View* tiles_container_; // Owned by views hierarchy. |
| 64 |
| 65 std::vector<TileItemView*> tile_views_; |
38 | 66 |
39 DISALLOW_COPY_AND_ASSIGN(StartPageView); | 67 DISALLOW_COPY_AND_ASSIGN(StartPageView); |
40 }; | 68 }; |
41 | 69 |
42 } // namespace app_list | 70 } // namespace app_list |
43 | 71 |
44 #endif // UI_APP_LIST_VIEWS_START_PAGE_VIEW_H_ | 72 #endif // UI_APP_LIST_VIEWS_START_PAGE_VIEW_H_ |
OLD | NEW |