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
3 // found in the LICENSE file.
5 #ifndef UI_APP_LIST_VIEWS_START_PAGE_VIEW_H_
6 #define UI_APP_LIST_VIEWS_START_PAGE_VIEW_H_
8 #include "base/basictypes.h"
9 #include "ui/app_list/app_list_export.h"
10 #include "ui/app_list/views/search_box_view_delegate.h"
11 #include "ui/app_list/views/search_result_container_view.h"
15 class AllAppsTileItemView;
16 class AppListMainView;
17 class AppListViewDelegate;
18 class SearchResultListView;
19 class SearchResultTileItemView;
22 // The start page for the experimental app list.
23 class APP_LIST_EXPORT StartPageView : public SearchResultContainerView,
24 public SearchBoxViewDelegate {
26 StartPageView(AppListMainView* app_list_main_view,
27 AppListViewDelegate* view_delegate);
28 ~StartPageView() override;
31 void ShowSearchResults();
33 bool IsShowingSearchResults() const;
35 void UpdateForTesting();
37 const std::vector<SearchResultTileItemView*>& tile_views() const {
38 return search_result_tile_views_;
40 TileItemView* all_apps_button() const;
41 SearchBoxView* dummy_search_box_view() { return search_box_view_; }
43 // Overridden from views::View:
44 bool OnKeyPressed(const ui::KeyEvent& event) override;
45 void Layout() override;
47 // Overridden from SearchResultContainerView:
48 void Update() override;
56 void InitInstantContainer();
57 void InitTilesContainer();
59 void SetShowState(ShowState show_state);
60 void SetModel(AppListModel* model);
62 // Overridden from SearchBoxViewDelegate:
63 void QueryChanged(SearchBoxView* sender) override;
65 // The parent view of ContentsView which is the parent of this view.
66 AppListMainView* app_list_main_view_;
68 AppListViewDelegate* view_delegate_; // Owned by AppListView.
70 SearchBoxView* search_box_view_; // Owned by views hierarchy.
71 SearchResultListView* results_view_; // Owned by views hierarchy.
72 views::View* instant_container_; // Owned by views hierarchy.
73 views::View* tiles_container_; // Owned by views hierarchy.
75 std::vector<SearchResultTileItemView*> search_result_tile_views_;
76 AllAppsTileItemView* all_apps_button_;
78 ShowState show_state_;
80 DISALLOW_COPY_AND_ASSIGN(StartPageView);
83 } // namespace app_list
85 #endif // UI_APP_LIST_VIEWS_START_PAGE_VIEW_H_