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/app_list_page.h"
16 class AllAppsTileItemView
;
17 class AppListMainView
;
18 class AppListViewDelegate
;
19 class CustomLauncherPageBackgroundView
;
20 class SearchResultTileItemView
;
23 // The start page for the experimental app list.
24 class APP_LIST_EXPORT StartPageView
: public AppListPage
{
26 StartPageView(AppListMainView
* app_list_main_view
,
27 AppListViewDelegate
* view_delegate
);
28 ~StartPageView() override
;
32 void UpdateForTesting();
34 views::View
* instant_container() const { return instant_container_
; }
35 const std::vector
<SearchResultTileItemView
*>& tile_views() const;
36 TileItemView
* all_apps_button() const;
38 // Overridden from AppListPage:
39 gfx::Rect
GetPageBoundsForState(AppListModel::State state
) const override
;
40 gfx::Rect
GetSearchBoxBounds() const override
;
41 void OnShown() override
;
43 // Overridden from views::View:
44 void Layout() override
;
45 bool OnKeyPressed(const ui::KeyEvent
& event
) override
;
47 bool OnMousePressed(const ui::MouseEvent
& event
) override
;
48 bool OnMouseWheel(const ui::MouseWheelEvent
& event
) override
;
49 void OnGestureEvent(ui::GestureEvent
* event
) override
;
50 void OnScrollEvent(ui::ScrollEvent
* event
) override
;
54 class StartPageTilesContainer
;
56 void InitInstantContainer();
57 void MaybeOpenCustomLauncherPage();
59 void SetCustomLauncherPageSelected(bool selected
);
61 TileItemView
* GetTileItemView(size_t index
);
63 // The parent view of ContentsView which is the parent of this view.
64 AppListMainView
* app_list_main_view_
;
66 AppListViewDelegate
* view_delegate_
; // Owned by AppListView.
68 views::View
* search_box_spacer_view_
; // Owned by views hierarchy.
69 views::View
* instant_container_
; // Owned by views hierarchy.
70 CustomLauncherPageBackgroundView
*
71 custom_launcher_page_background_
; // Owned by view hierarchy.
72 StartPageTilesContainer
* tiles_container_
; // Owned by views hierarchy.
74 DISALLOW_COPY_AND_ASSIGN(StartPageView
);
77 } // namespace app_list
79 #endif // UI_APP_LIST_VIEWS_START_PAGE_VIEW_H_