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