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_
10 #include "base/basictypes.h"
11 #include "ui/app_list/app_list_export.h"
12 #include "ui/app_list/views/search_result_container_view.h"
16 class AllAppsTileItemView
;
17 class AppListMainView
;
18 class AppListViewDelegate
;
19 class SearchResultTileItemView
;
22 // The start page for the experimental app list.
23 class APP_LIST_EXPORT StartPageView
: public SearchResultContainerView
{
25 StartPageView(AppListMainView
* app_list_main_view
,
26 AppListViewDelegate
* view_delegate
);
27 ~StartPageView() override
;
31 void UpdateForTesting();
33 const std::vector
<SearchResultTileItemView
*>& tile_views() const {
34 return search_result_tile_views_
;
36 TileItemView
* all_apps_button() const;
38 // Called when the start page view is displayed.
41 // Called when the start page view is hidden (while the app list is still
45 // Overridden from views::View:
46 void Layout() override
;
47 bool OnKeyPressed(const ui::KeyEvent
& event
) override
;
49 // Overridden from SearchResultContainerView:
50 void OnContainerSelected(bool from_bottom
) override
;
52 // Returns search box bounds to use when the start page is active.
53 gfx::Rect
GetSearchBoxBounds() const;
55 // Updates whether the custom page clickzone is visible.
56 void UpdateCustomPageClickzoneVisibility();
59 // Overridden from SearchResultContainerView:
60 int Update() override
;
61 void UpdateSelectedIndex(int old_selected
, int new_selected
) override
;
63 void InitInstantContainer();
64 void InitTilesContainer();
66 TileItemView
* GetTileItemView(size_t index
);
68 // The parent view of ContentsView which is the parent of this view.
69 AppListMainView
* app_list_main_view_
;
71 AppListViewDelegate
* view_delegate_
; // Owned by AppListView.
73 views::View
* search_box_spacer_view_
; // Owned by views hierarchy.
74 views::View
* instant_container_
; // Owned by views hierarchy.
75 views::View
* tiles_container_
; // Owned by views hierarchy.
77 std::vector
<SearchResultTileItemView
*> search_result_tile_views_
;
78 AllAppsTileItemView
* all_apps_button_
;
80 DISALLOW_COPY_AND_ASSIGN(StartPageView
);
83 } // namespace app_list
85 #endif // UI_APP_LIST_VIEWS_START_PAGE_VIEW_H_