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

Side by Side Diff: ui/app_list/views/app_list_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/app_list_main_view_unittest.cc ('k') | ui/app_list/views/app_list_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_APP_LIST_VIEW_H_ 5 #ifndef UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_
6 #define UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_ 6 #define UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/observer_list.h" 10 #include "base/observer_list.h"
(...skipping 27 matching lines...) Expand all
38 public AppListViewDelegateObserver, 38 public AppListViewDelegateObserver,
39 public SpeechUIModelObserver { 39 public SpeechUIModelObserver {
40 public: 40 public:
41 // Takes ownership of |delegate|. 41 // Takes ownership of |delegate|.
42 explicit AppListView(AppListViewDelegate* delegate); 42 explicit AppListView(AppListViewDelegate* delegate);
43 virtual ~AppListView(); 43 virtual ~AppListView();
44 44
45 // Initializes the widget and use a given |anchor| plus an |anchor_offset| for 45 // Initializes the widget and use a given |anchor| plus an |anchor_offset| for
46 // positioning. 46 // positioning.
47 void InitAsBubbleAttachedToAnchor(gfx::NativeView parent, 47 void InitAsBubbleAttachedToAnchor(gfx::NativeView parent,
48 PaginationModel* pagination_model, 48 int initial_apps_page,
49 views::View* anchor, 49 views::View* anchor,
50 const gfx::Vector2d& anchor_offset, 50 const gfx::Vector2d& anchor_offset,
51 views::BubbleBorder::Arrow arrow, 51 views::BubbleBorder::Arrow arrow,
52 bool border_accepts_events); 52 bool border_accepts_events);
53 53
54 // Initializes the widget and use a fixed |anchor_point_in_screen| for 54 // Initializes the widget and use a fixed |anchor_point_in_screen| for
55 // positioning. 55 // positioning.
56 void InitAsBubbleAtFixedLocation(gfx::NativeView parent, 56 void InitAsBubbleAtFixedLocation(gfx::NativeView parent,
57 PaginationModel* pagination_model, 57 int initial_apps_page,
58 const gfx::Point& anchor_point_in_screen, 58 const gfx::Point& anchor_point_in_screen,
59 views::BubbleBorder::Arrow arrow, 59 views::BubbleBorder::Arrow arrow,
60 bool border_accepts_events); 60 bool border_accepts_events);
61 61
62 void SetBubbleArrow(views::BubbleBorder::Arrow arrow); 62 void SetBubbleArrow(views::BubbleBorder::Arrow arrow);
63 63
64 void SetAnchorPoint(const gfx::Point& anchor_point); 64 void SetAnchorPoint(const gfx::Point& anchor_point);
65 65
66 // If |drag_and_drop_host| is not NULL it will be called upon drag and drop 66 // If |drag_and_drop_host| is not NULL it will be called upon drag and drop
67 // operations outside the application list. This has to be called after 67 // operations outside the application list. This has to be called after
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 106
107 // Set a callback to be called the next time any app list paints. 107 // Set a callback to be called the next time any app list paints.
108 void SetNextPaintCallback(const base::Closure& callback); 108 void SetNextPaintCallback(const base::Closure& callback);
109 109
110 #if defined(OS_WIN) 110 #if defined(OS_WIN)
111 HWND GetHWND() const; 111 HWND GetHWND() const;
112 #endif 112 #endif
113 113
114 AppListMainView* app_list_main_view() { return app_list_main_view_; } 114 AppListMainView* app_list_main_view() { return app_list_main_view_; }
115 115
116 // Gets the PaginationModel owned by this view's apps grid.
117 PaginationModel* GetAppsPaginationModel();
118
116 private: 119 private:
117 friend class ::test::AppListViewTestApi; 120 friend class ::test::AppListViewTestApi;
118 121
119 void InitAsBubbleInternal(gfx::NativeView parent, 122 void InitAsBubbleInternal(gfx::NativeView parent,
120 PaginationModel* pagination_model, 123 int initial_apps_page,
121 views::BubbleBorder::Arrow arrow, 124 views::BubbleBorder::Arrow arrow,
122 bool border_accepts_events, 125 bool border_accepts_events,
123 const gfx::Vector2d& anchor_offset); 126 const gfx::Vector2d& anchor_offset);
124 127
125 // Overridden from views::BubbleDelegateView: 128 // Overridden from views::BubbleDelegateView:
126 virtual void OnBeforeBubbleWidgetInit( 129 virtual void OnBeforeBubbleWidgetInit(
127 views::Widget::InitParams* params, 130 views::Widget::InitParams* params,
128 views::Widget* widget) const OVERRIDE; 131 views::Widget* widget) const OVERRIDE;
129 132
130 // Overridden from views::WidgetDelegateView: 133 // Overridden from views::WidgetDelegateView:
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 166
164 // For UMA and testing. If non-null, triggered when the app list is painted. 167 // For UMA and testing. If non-null, triggered when the app list is painted.
165 base::Closure next_paint_callback_; 168 base::Closure next_paint_callback_;
166 169
167 DISALLOW_COPY_AND_ASSIGN(AppListView); 170 DISALLOW_COPY_AND_ASSIGN(AppListView);
168 }; 171 };
169 172
170 } // namespace app_list 173 } // namespace app_list
171 174
172 #endif // UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_ 175 #endif // UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_
OLDNEW
« no previous file with comments | « ui/app_list/views/app_list_main_view_unittest.cc ('k') | ui/app_list/views/app_list_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698