| 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 views { | 13 namespace views { |
| 14 class BoundsAnimator; | 14 class BoundsAnimator; |
| 15 class ViewModel; | 15 class ViewModel; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace app_list { | 18 namespace app_list { |
| 19 | 19 |
| 20 class AppsGridView; |
| 21 class ApplicationDragAndDropHost; |
| 20 class AppListMainView; | 22 class AppListMainView; |
| 21 class AppListModel; | 23 class AppListModel; |
| 22 class PaginationModel; | 24 class PaginationModel; |
| 23 | 25 |
| 24 // A view to manage sub views under the search box (apps grid view + page | 26 // A view to manage sub views under the search box (apps grid view + page |
| 25 // switcher and search results). The two sets of sub views are mutually | 27 // switcher and search results). The two sets of sub views are mutually |
| 26 // exclusive. ContentsView manages a show state to choose one set to show | 28 // exclusive. ContentsView manages a show state to choose one set to show |
| 27 // and animates the transition between show states. | 29 // and animates the transition between show states. |
| 28 class ContentsView : public views::View { | 30 class ContentsView : public views::View { |
| 29 public: | 31 public: |
| 30 ContentsView(AppListMainView* app_list_main_view, | 32 ContentsView(AppListMainView* app_list_main_view, |
| 31 PaginationModel* pagination_model); | 33 PaginationModel* pagination_model); |
| 32 virtual ~ContentsView(); | 34 virtual ~ContentsView(); |
| 33 | 35 |
| 34 void SetModel(AppListModel* model); | 36 void SetModel(AppListModel* model); |
| 35 | 37 |
| 38 // If |drag_and_drop| is not NULL it will be called upon drag and drop |
| 39 // operations outside the application list. |
| 40 void SetDragAndDropHostOfCurrentAppList( |
| 41 app_list::ApplicationDragAndDropHost* drag_and_drop_host); |
| 42 |
| 36 void ShowSearchResults(bool show); | 43 void ShowSearchResults(bool show); |
| 37 | 44 |
| 38 void Prerender(); | 45 void Prerender(); |
| 39 | 46 |
| 40 private: | 47 private: |
| 41 enum ShowState { | 48 enum ShowState { |
| 42 SHOW_APPS, | 49 SHOW_APPS, |
| 43 SHOW_SEARCH_RESULTS, | 50 SHOW_SEARCH_RESULTS, |
| 44 }; | 51 }; |
| 45 | 52 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 58 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; | 65 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; |
| 59 virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) OVERRIDE; | 66 virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) OVERRIDE; |
| 60 | 67 |
| 61 // Overridden from ui::EventHandler: | 68 // Overridden from ui::EventHandler: |
| 62 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; | 69 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; |
| 63 virtual void OnScrollEvent(ui::ScrollEvent* event) OVERRIDE; | 70 virtual void OnScrollEvent(ui::ScrollEvent* event) OVERRIDE; |
| 64 | 71 |
| 65 ShowState show_state_; | 72 ShowState show_state_; |
| 66 PaginationModel* pagination_model_; // Owned by AppListController. | 73 PaginationModel* pagination_model_; // Owned by AppListController. |
| 67 | 74 |
| 75 AppsGridView* apps_grid_view_; // Owned by the view. |
| 76 |
| 68 scoped_ptr<views::ViewModel> view_model_; | 77 scoped_ptr<views::ViewModel> view_model_; |
| 69 scoped_ptr<views::BoundsAnimator> bounds_animator_; | 78 scoped_ptr<views::BoundsAnimator> bounds_animator_; |
| 70 | 79 |
| 71 DISALLOW_COPY_AND_ASSIGN(ContentsView); | 80 DISALLOW_COPY_AND_ASSIGN(ContentsView); |
| 72 }; | 81 }; |
| 73 | 82 |
| 74 } // namespace app_list | 83 } // namespace app_list |
| 75 | 84 |
| 76 #endif // UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_ | 85 #endif // UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_ |
| OLD | NEW |