App list start page view: Clicking the custom page now opens it up.
[chromium-blink-merge.git] / ui / app_list / views / start_page_view.h
blob62364c6f72e31c49820d86c221011e0eb2ef4541
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"
13 namespace app_list {
15 class AllAppsTileItemView;
16 class AppListMainView;
17 class AppListViewDelegate;
18 class SearchResultTileItemView;
19 class TileItemView;
21 // The start page for the experimental app list.
22 class APP_LIST_EXPORT StartPageView : public SearchResultContainerView,
23 public SearchBoxViewDelegate {
24 public:
25 StartPageView(AppListMainView* app_list_main_view,
26 AppListViewDelegate* view_delegate);
27 ~StartPageView() override;
29 void Reset();
31 void UpdateForTesting();
33 const std::vector<SearchResultTileItemView*>& tile_views() const {
34 return search_result_tile_views_;
36 TileItemView* all_apps_button() const;
37 SearchBoxView* dummy_search_box_view() { return search_box_view_; }
39 // Called when the start page view is displayed.
40 void OnShow();
42 // Called when the start page view is hidden (while the app list is still
43 // open).
44 void OnHide();
46 // Overridden from views::View:
47 void Layout() override;
49 // Overridden from SearchResultContainerView:
50 void OnContainerSelected(bool from_bottom) override;
52 private:
53 // Overridden from SearchResultContainerView:
54 int Update() override;
55 void UpdateSelectedIndex(int old_selected, int new_selected) override;
57 void InitInstantContainer();
58 void InitTilesContainer();
60 // Overridden from SearchBoxViewDelegate:
61 void QueryChanged(SearchBoxView* sender) override;
62 void BackButtonPressed() override;
64 // The parent view of ContentsView which is the parent of this view.
65 AppListMainView* app_list_main_view_;
67 AppListViewDelegate* view_delegate_; // Owned by AppListView.
69 SearchBoxView* search_box_view_; // Owned by views hierarchy.
70 views::View* instant_container_; // Owned by views hierarchy.
71 views::View* tiles_container_; // Owned by views hierarchy.
73 std::vector<SearchResultTileItemView*> search_result_tile_views_;
74 AllAppsTileItemView* all_apps_button_;
76 DISALLOW_COPY_AND_ASSIGN(StartPageView);
79 } // namespace app_list
81 #endif // UI_APP_LIST_VIEWS_START_PAGE_VIEW_H_