| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_CONTENTS_VIEW_H_ | 5 #ifndef UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_ |
| 6 #define UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_ | 6 #define UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "ui/views/view.h" | 11 #include "ui/views/view.h" |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 class WebContents; | 14 class WebContents; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace views { | 17 namespace views { |
| 18 class BoundsAnimator; | 18 class BoundsAnimator; |
| 19 class ViewModel; | 19 class ViewModel; |
| 20 } | 20 } |
| 21 | 21 |
| 22 namespace app_list { | 22 namespace app_list { |
| 23 | 23 |
| 24 class AppsGridView; | 24 class AppsGridView; |
| 25 class ApplicationDragAndDropHost; | 25 class ApplicationDragAndDropHost; |
| 26 class AppListFolderItem; |
| 26 class AppListMainView; | 27 class AppListMainView; |
| 27 class AppListModel; | 28 class AppListModel; |
| 28 class AppListViewDelegate; | 29 class AppListViewDelegate; |
| 30 class AppsContainerView; |
| 29 class PaginationModel; | 31 class PaginationModel; |
| 30 | 32 |
| 31 // A view to manage sub views under the search box (apps grid view + page | 33 // A view to manage sub views under the search box (apps grid view + page |
| 32 // switcher and search results). The two sets of sub views are mutually | 34 // switcher and search results). The two sets of sub views are mutually |
| 33 // exclusive. ContentsView manages a show state to choose one set to show | 35 // exclusive. ContentsView manages a show state to choose one set to show |
| 34 // and animates the transition between show states. | 36 // and animates the transition between show states. |
| 35 class ContentsView : public views::View { | 37 class ContentsView : public views::View { |
| 36 public: | 38 public: |
| 37 ContentsView(AppListMainView* app_list_main_view, | 39 ContentsView(AppListMainView* app_list_main_view, |
| 38 PaginationModel* pagination_model, | 40 PaginationModel* pagination_model, |
| 39 AppListModel* model, | 41 AppListModel* model, |
| 40 content::WebContents* start_page_contents); | 42 content::WebContents* start_page_contents); |
| 41 virtual ~ContentsView(); | 43 virtual ~ContentsView(); |
| 42 | 44 |
| 43 // The app list gets closed and drag and drop operations need to be cancelled. | 45 // The app list gets closed and drag and drop operations need to be cancelled. |
| 44 void CancelDrag(); | 46 void CancelDrag(); |
| 45 | 47 |
| 46 // If |drag_and_drop| is not NULL it will be called upon drag and drop | 48 // If |drag_and_drop| is not NULL it will be called upon drag and drop |
| 47 // operations outside the application list. | 49 // operations outside the application list. |
| 48 void SetDragAndDropHostOfCurrentAppList( | 50 void SetDragAndDropHostOfCurrentAppList( |
| 49 ApplicationDragAndDropHost* drag_and_drop_host); | 51 ApplicationDragAndDropHost* drag_and_drop_host); |
| 50 | 52 |
| 51 void ShowSearchResults(bool show); | 53 void ShowSearchResults(bool show); |
| 54 void ShowFolderContent(AppListFolderItem* folder); |
| 55 void ShowApps(); |
| 52 | 56 |
| 53 void Prerender(); | 57 void Prerender(); |
| 54 | 58 |
| 55 private: | 59 private: |
| 56 enum ShowState { | 60 enum ShowState { |
| 57 SHOW_APPS, | 61 SHOW_APPS, |
| 58 SHOW_SEARCH_RESULTS, | 62 SHOW_SEARCH_RESULTS, |
| 59 }; | 63 }; |
| 60 | 64 |
| 61 // Sets show state. | 65 // Sets show state. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 73 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; | 77 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; |
| 74 virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) OVERRIDE; | 78 virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) OVERRIDE; |
| 75 | 79 |
| 76 // Overridden from ui::EventHandler: | 80 // Overridden from ui::EventHandler: |
| 77 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; | 81 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; |
| 78 virtual void OnScrollEvent(ui::ScrollEvent* event) OVERRIDE; | 82 virtual void OnScrollEvent(ui::ScrollEvent* event) OVERRIDE; |
| 79 | 83 |
| 80 ShowState show_state_; | 84 ShowState show_state_; |
| 81 PaginationModel* pagination_model_; // Owned by AppListController. | 85 PaginationModel* pagination_model_; // Owned by AppListController. |
| 82 | 86 |
| 83 AppsGridView* apps_grid_view_; // Owned by the view. | 87 AppsContainerView* apps_container_view_; // Owned by the views hierarchy. |
| 84 | 88 |
| 85 scoped_ptr<views::ViewModel> view_model_; | 89 scoped_ptr<views::ViewModel> view_model_; |
| 86 scoped_ptr<views::BoundsAnimator> bounds_animator_; | 90 scoped_ptr<views::BoundsAnimator> bounds_animator_; |
| 87 | 91 |
| 88 DISALLOW_COPY_AND_ASSIGN(ContentsView); | 92 DISALLOW_COPY_AND_ASSIGN(ContentsView); |
| 89 }; | 93 }; |
| 90 | 94 |
| 91 } // namespace app_list | 95 } // namespace app_list |
| 92 | 96 |
| 93 #endif // UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_ | 97 #endif // UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_ |
| OLD | NEW |