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