Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: ui/app_list/views/contents_view.h

Issue 302803002: Refactor app list so AppsGridView owns the PaginationModel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile error (conflict). Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/app_list/views/apps_grid_view_unittest.cc ('k') | ui/app_list/views/contents_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 27 matching lines...) Expand all
38 // and animates the transition between show states. 38 // and animates the transition between show states.
39 class APP_LIST_EXPORT ContentsView : public views::View { 39 class APP_LIST_EXPORT ContentsView : public views::View {
40 public: 40 public:
41 enum ShowState { 41 enum ShowState {
42 SHOW_APPS, 42 SHOW_APPS,
43 SHOW_SEARCH_RESULTS, 43 SHOW_SEARCH_RESULTS,
44 SHOW_START_PAGE, 44 SHOW_START_PAGE,
45 }; 45 };
46 46
47 ContentsView(AppListMainView* app_list_main_view, 47 ContentsView(AppListMainView* app_list_main_view,
48 PaginationModel* pagination_model,
49 AppListModel* model, 48 AppListModel* model,
50 AppListViewDelegate* view_delegate); 49 AppListViewDelegate* view_delegate);
51 virtual ~ContentsView(); 50 virtual ~ContentsView();
52 51
53 // The app list gets closed and drag and drop operations need to be cancelled. 52 // The app list gets closed and drag and drop operations need to be cancelled.
54 void CancelDrag(); 53 void CancelDrag();
55 54
56 // If |drag_and_drop| is not NULL it will be called upon drag and drop 55 // If |drag_and_drop| is not NULL it will be called upon drag and drop
57 // operations outside the application list. 56 // operations outside the application list.
58 void SetDragAndDropHostOfCurrentAppList( 57 void SetDragAndDropHostOfCurrentAppList(
(...skipping 18 matching lines...) Expand all
77 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; 76 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE;
78 virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) OVERRIDE; 77 virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) OVERRIDE;
79 78
80 private: 79 private:
81 // Invoked when show state is changed. 80 // Invoked when show state is changed.
82 void ShowStateChanged(); 81 void ShowStateChanged();
83 82
84 void CalculateIdealBounds(); 83 void CalculateIdealBounds();
85 void AnimateToIdealBounds(); 84 void AnimateToIdealBounds();
86 85
86 // Gets the PaginationModel owned by the AppsGridView.
87 PaginationModel* GetAppsPaginationModel();
88
87 // Overridden from ui::EventHandler: 89 // Overridden from ui::EventHandler:
88 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; 90 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
89 virtual void OnScrollEvent(ui::ScrollEvent* event) OVERRIDE; 91 virtual void OnScrollEvent(ui::ScrollEvent* event) OVERRIDE;
90 92
91 ShowState show_state_; 93 ShowState show_state_;
92 PaginationModel* pagination_model_; // Owned by AppListController.
93 94
94 AppsContainerView* apps_container_view_; // Owned by the views hierarchy. 95 AppsContainerView* apps_container_view_; // Owned by the views hierarchy.
95 StartPageView* start_page_view_; // Owned by the views hierarchy. 96 StartPageView* start_page_view_; // Owned by the views hierarchy.
96 97
97 AppListMainView* app_list_main_view_; // Parent view, owns this. 98 AppListMainView* app_list_main_view_; // Parent view, owns this.
98 99
99 scoped_ptr<views::ViewModel> view_model_; 100 scoped_ptr<views::ViewModel> view_model_;
100 scoped_ptr<views::BoundsAnimator> bounds_animator_; 101 scoped_ptr<views::BoundsAnimator> bounds_animator_;
101 102
102 DISALLOW_COPY_AND_ASSIGN(ContentsView); 103 DISALLOW_COPY_AND_ASSIGN(ContentsView);
103 }; 104 };
104 105
105 } // namespace app_list 106 } // namespace app_list
106 107
107 #endif // UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_ 108 #endif // UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_
OLDNEW
« no previous file with comments | « ui/app_list/views/apps_grid_view_unittest.cc ('k') | ui/app_list/views/contents_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698