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" |
(...skipping 11 matching lines...) Loading... | |
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 AppListFolderItem; |
27 class AppListMainView; | 27 class AppListMainView; |
28 class AppListModel; | 28 class AppListModel; |
29 class AppListViewDelegate; | 29 class AppListViewDelegate; |
30 class AppsContainerView; | 30 class AppsContainerView; |
31 class PaginationModel; | 31 class PaginationModel; |
32 class StartPageView; | |
32 | 33 |
33 // A view to manage sub views under the search box (apps grid view + page | 34 // A view to manage sub views under the search box (apps grid view + page |
34 // switcher and search results). The two sets of sub views are mutually | 35 // switcher and search results). The two sets of sub views are mutually |
35 // exclusive. ContentsView manages a show state to choose one set to show | 36 // exclusive. ContentsView manages a show state to choose one set to show |
36 // and animates the transition between show states. | 37 // and animates the transition between show states. |
37 class ContentsView : public views::View { | 38 class ContentsView : public views::View { |
38 public: | 39 public: |
39 enum ShowState { SHOW_APPS, SHOW_SEARCH_RESULTS, }; | 40 enum ShowState { SHOW_APPS, SHOW_SEARCH_RESULTS, SHOW_START_PAGE, }; |
40 | 41 |
41 ContentsView(AppListMainView* app_list_main_view, | 42 ContentsView(AppListMainView* app_list_main_view, |
42 PaginationModel* pagination_model, | 43 PaginationModel* pagination_model, |
43 AppListModel* model, | 44 AppListModel* model, |
44 AppListViewDelegate* view_delegate); | 45 AppListViewDelegate* view_delegate); |
45 virtual ~ContentsView(); | 46 virtual ~ContentsView(); |
46 | 47 |
47 // The app list gets closed and drag and drop operations need to be cancelled. | 48 // The app list gets closed and drag and drop operations need to be cancelled. |
48 void CancelDrag(); | 49 void CancelDrag(); |
49 | 50 |
(...skipping 12 matching lines...) Loading... | |
62 | 63 |
63 AppsContainerView* apps_container_view() { return apps_container_view_; } | 64 AppsContainerView* apps_container_view() { return apps_container_view_; } |
64 | 65 |
65 // Overridden from views::View: | 66 // Overridden from views::View: |
66 virtual gfx::Size GetPreferredSize() OVERRIDE; | 67 virtual gfx::Size GetPreferredSize() OVERRIDE; |
67 virtual void Layout() OVERRIDE; | 68 virtual void Layout() OVERRIDE; |
68 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; | 69 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; |
69 virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) OVERRIDE; | 70 virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) OVERRIDE; |
70 | 71 |
71 private: | 72 private: |
73 AppListMainView* GetMainView(); | |
xiyuan
2014/03/14 17:00:54
Seems not used. And casting parent is not safe, if
calamity
2014/05/07 06:11:52
Done.
| |
74 | |
72 // Invoked when show state is changed. | 75 // Invoked when show state is changed. |
73 void ShowStateChanged(); | 76 void ShowStateChanged(); |
74 | 77 |
75 void CalculateIdealBounds(); | 78 void CalculateIdealBounds(); |
76 void AnimateToIdealBounds(); | 79 void AnimateToIdealBounds(); |
77 | 80 |
78 // Overridden from ui::EventHandler: | 81 // Overridden from ui::EventHandler: |
79 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; | 82 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; |
80 virtual void OnScrollEvent(ui::ScrollEvent* event) OVERRIDE; | 83 virtual void OnScrollEvent(ui::ScrollEvent* event) OVERRIDE; |
81 | 84 |
82 ShowState show_state_; | 85 ShowState show_state_; |
83 PaginationModel* pagination_model_; // Owned by AppListController. | 86 PaginationModel* pagination_model_; // Owned by AppListController. |
84 | 87 |
85 AppsContainerView* apps_container_view_; // Owned by the views hierarchy. | 88 AppsContainerView* apps_container_view_; // Owned by the views hierarchy. |
86 | 89 |
87 scoped_ptr<views::ViewModel> view_model_; | 90 scoped_ptr<views::ViewModel> view_model_; |
88 scoped_ptr<views::BoundsAnimator> bounds_animator_; | 91 scoped_ptr<views::BoundsAnimator> bounds_animator_; |
89 | 92 |
90 DISALLOW_COPY_AND_ASSIGN(ContentsView); | 93 DISALLOW_COPY_AND_ASSIGN(ContentsView); |
91 }; | 94 }; |
92 | 95 |
93 } // namespace app_list | 96 } // namespace app_list |
94 | 97 |
95 #endif // UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_ | 98 #endif // UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_ |
OLD | NEW |