| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_APP_LIST_VIEWS_START_PAGE_VIEW_H_ | 5 #ifndef UI_APP_LIST_VIEWS_START_PAGE_VIEW_H_ |
| 6 #define UI_APP_LIST_VIEWS_START_PAGE_VIEW_H_ | 6 #define UI_APP_LIST_VIEWS_START_PAGE_VIEW_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "ui/app_list/app_list_export.h" | 13 #include "ui/app_list/app_list_export.h" |
| 14 #include "ui/app_list/views/app_list_page.h" | 14 #include "ui/app_list/views/app_list_page.h" |
| 15 | 15 |
| 16 namespace app_list { | 16 namespace app_list { |
| 17 | 17 |
| 18 class AppListMainView; | 18 class AppListMainView; |
| 19 class AppListView; | |
| 20 class AppListViewDelegate; | 19 class AppListViewDelegate; |
| 21 class CustomLauncherPageBackgroundView; | 20 class CustomLauncherPageBackgroundView; |
| 22 class SearchResultTileItemView; | 21 class SearchResultTileItemView; |
| 23 class TileItemView; | 22 class TileItemView; |
| 24 | 23 |
| 25 // The start page for the app list. | 24 // The start page for the app list. |
| 26 class APP_LIST_EXPORT StartPageView : public AppListPage { | 25 class APP_LIST_EXPORT StartPageView : public AppListPage { |
| 27 public: | 26 public: |
| 28 StartPageView(AppListMainView* app_list_main_view, | 27 StartPageView(AppListMainView* app_list_main_view, |
| 29 AppListViewDelegate* view_delegate, | 28 AppListViewDelegate* view_delegate); |
| 30 AppListView* app_list_view); | |
| 31 ~StartPageView() override; | 29 ~StartPageView() override; |
| 32 | 30 |
| 33 void Reset(); | 31 void Reset(); |
| 34 | 32 |
| 35 void UpdateForTesting(); | 33 void UpdateForTesting(); |
| 36 | 34 |
| 37 views::View* instant_container() const { return instant_container_; } | 35 views::View* instant_container() const { return instant_container_; } |
| 38 const std::vector<SearchResultTileItemView*>& tile_views() const; | 36 const std::vector<SearchResultTileItemView*>& tile_views() const; |
| 39 TileItemView* all_apps_button() const; | 37 TileItemView* all_apps_button() const; |
| 40 | 38 |
| 41 // Overridden from AppListPage: | 39 // Overridden from AppListPage: |
| 42 gfx::Rect GetPageBoundsForState(AppListModel::State state) const override; | 40 gfx::Rect GetPageBoundsForState(AppListModel::State state) const override; |
| 43 gfx::Rect GetSearchBoxBounds() const override; | 41 gfx::Rect GetSearchBoxBounds() const override; |
| 44 void OnShown() override; | 42 void OnShown() override; |
| 45 | 43 |
| 46 // Overridden from views::View: | 44 // Overridden from views::View: |
| 47 void Layout() override; | 45 void Layout() override; |
| 48 bool OnKeyPressed(const ui::KeyEvent& event) override; | 46 bool OnKeyPressed(const ui::KeyEvent& event) override; |
| 49 | 47 |
| 50 bool OnMousePressed(const ui::MouseEvent& event) override; | 48 bool OnMousePressed(const ui::MouseEvent& event) override; |
| 51 bool OnMouseWheel(const ui::MouseWheelEvent& event) override; | 49 bool OnMouseWheel(const ui::MouseWheelEvent& event) override; |
| 52 void OnGestureEvent(ui::GestureEvent* event) override; | 50 void OnGestureEvent(ui::GestureEvent* event) override; |
| 53 void OnScrollEvent(ui::ScrollEvent* event) override; | 51 void OnScrollEvent(ui::ScrollEvent* event) override; |
| 54 | 52 |
| 53 |
| 55 private: | 54 private: |
| 56 class StartPageTilesContainer; | 55 class StartPageTilesContainer; |
| 57 | 56 |
| 58 void InitInstantContainer(); | 57 void InitInstantContainer(); |
| 59 | |
| 60 void MaybeOpenCustomLauncherPage(); | 58 void MaybeOpenCustomLauncherPage(); |
| 61 | 59 |
| 62 void SetCustomLauncherPageSelected(bool selected); | 60 void SetCustomLauncherPageSelected(bool selected); |
| 63 | 61 |
| 64 TileItemView* GetTileItemView(size_t index); | 62 TileItemView* GetTileItemView(size_t index); |
| 65 | 63 |
| 66 // The parent view of ContentsView which is the parent of this view. | 64 // The parent view of ContentsView which is the parent of this view. |
| 67 AppListMainView* app_list_main_view_; | 65 AppListMainView* app_list_main_view_; |
| 68 | 66 |
| 69 AppListViewDelegate* view_delegate_; // Owned by AppListView. | 67 AppListViewDelegate* view_delegate_; // Owned by AppListView. |
| 70 | 68 |
| 71 // An invisible placeholder view which fills the space for the search box view | 69 // An invisible placeholder view which fills the space for the search box view |
| 72 // in a box layout. The search box view itself is a child of the AppListView | 70 // in a box layout. The search box view itself is a child of the AppListView |
| 73 // (because it is visible on many different pages). | 71 // (because it is visible on many different pages). |
| 74 views::View* search_box_spacer_view_; // Owned by views hierarchy. | 72 views::View* search_box_spacer_view_; // Owned by views hierarchy. |
| 75 | 73 |
| 76 views::View* instant_container_; // Owned by views hierarchy. | 74 views::View* instant_container_; // Owned by views hierarchy. |
| 77 CustomLauncherPageBackgroundView* | 75 CustomLauncherPageBackgroundView* |
| 78 custom_launcher_page_background_; // Owned by view hierarchy. | 76 custom_launcher_page_background_; // Owned by view hierarchy. |
| 79 StartPageTilesContainer* tiles_container_; // Owned by views hierarchy. | 77 StartPageTilesContainer* tiles_container_; // Owned by views hierarchy. |
| 80 | 78 |
| 81 DISALLOW_COPY_AND_ASSIGN(StartPageView); | 79 DISALLOW_COPY_AND_ASSIGN(StartPageView); |
| 82 }; | 80 }; |
| 83 | 81 |
| 84 } // namespace app_list | 82 } // namespace app_list |
| 85 | 83 |
| 86 #endif // UI_APP_LIST_VIEWS_START_PAGE_VIEW_H_ | 84 #endif // UI_APP_LIST_VIEWS_START_PAGE_VIEW_H_ |
| OLD | NEW |