ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / ui / app_list / views / start_page_view.h
blobfa97e8097ae3701596eba60344600e914c3285fb
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 <vector>
10 #include "base/basictypes.h"
11 #include "ui/app_list/app_list_export.h"
12 #include "ui/views/view.h"
14 namespace app_list {
16 class AllAppsTileItemView;
17 class AppListMainView;
18 class AppListViewDelegate;
19 class CustomLauncherPageBackgroundView;
20 class SearchResultTileItemView;
21 class TileItemView;
23 // The start page for the experimental app list.
24 class APP_LIST_EXPORT StartPageView : public views::View {
25 public:
26 StartPageView(AppListMainView* app_list_main_view,
27 AppListViewDelegate* view_delegate);
28 ~StartPageView() override;
30 void Reset();
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 // Called when the start page view is displayed.
39 void OnShow();
41 // Overridden from views::View:
42 void Layout() override;
43 bool OnKeyPressed(const ui::KeyEvent& event) override;
45 bool OnMousePressed(const ui::MouseEvent& event) override;
46 bool OnMouseWheel(const ui::MouseWheelEvent& event) override;
47 void OnGestureEvent(ui::GestureEvent* event) override;
48 void OnScrollEvent(ui::ScrollEvent* event) override;
50 // Returns search box bounds to use when the start page is active.
51 gfx::Rect GetSearchBoxBounds() const;
53 private:
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_