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

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: Respond to review comments (tapted and xiyuan). 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
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 29 matching lines...) Expand all
40 public AppListViewDelegateObserver, 40 public AppListViewDelegateObserver,
41 public SpeechUIModelObserver { 41 public SpeechUIModelObserver {
42 public: 42 public:
43 // Takes ownership of |delegate|. 43 // Takes ownership of |delegate|.
44 explicit AppListView(AppListViewDelegate* delegate); 44 explicit AppListView(AppListViewDelegate* delegate);
45 virtual ~AppListView(); 45 virtual ~AppListView();
46 46
47 // Initializes the widget and use a given |anchor| plus an |anchor_offset| for 47 // Initializes the widget and use a given |anchor| plus an |anchor_offset| for
48 // positioning. 48 // positioning.
49 void InitAsBubbleAttachedToAnchor(gfx::NativeView parent, 49 void InitAsBubbleAttachedToAnchor(gfx::NativeView parent,
50 PaginationModel* pagination_model,
51 views::View* anchor, 50 views::View* anchor,
52 const gfx::Vector2d& anchor_offset, 51 const gfx::Vector2d& anchor_offset,
53 views::BubbleBorder::Arrow arrow, 52 views::BubbleBorder::Arrow arrow,
54 bool border_accepts_events); 53 bool border_accepts_events);
55 54
56 // Initializes the widget and use a fixed |anchor_point_in_screen| for 55 // Initializes the widget and use a fixed |anchor_point_in_screen| for
57 // positioning. 56 // positioning.
58 void InitAsBubbleAtFixedLocation(gfx::NativeView parent, 57 void InitAsBubbleAtFixedLocation(gfx::NativeView parent,
59 PaginationModel* pagination_model,
60 const gfx::Point& anchor_point_in_screen, 58 const gfx::Point& anchor_point_in_screen,
61 views::BubbleBorder::Arrow arrow, 59 views::BubbleBorder::Arrow arrow,
62 bool border_accepts_events); 60 bool border_accepts_events);
63 61
64 void SetBubbleArrow(views::BubbleBorder::Arrow arrow); 62 void SetBubbleArrow(views::BubbleBorder::Arrow arrow);
65 63
66 void SetAnchorPoint(const gfx::Point& anchor_point); 64 void SetAnchorPoint(const gfx::Point& anchor_point);
67 65
68 // 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
69 // 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
108 106
109 // 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.
110 void SetNextPaintCallback(const base::Closure& callback); 108 void SetNextPaintCallback(const base::Closure& callback);
111 109
112 #if defined(OS_WIN) 110 #if defined(OS_WIN)
113 HWND GetHWND() const; 111 HWND GetHWND() const;
114 #endif 112 #endif
115 113
116 AppListMainView* app_list_main_view() { return app_list_main_view_; } 114 AppListMainView* app_list_main_view() { return app_list_main_view_; }
117 115
116 // Gets the PaginationModel owned by this view's apps grid.
117 PaginationModel* GetAppsPaginationModel();
118
118 private: 119 private:
119 friend class ::test::AppListViewTestApi; 120 friend class ::test::AppListViewTestApi;
120 121
121 void InitAsBubbleInternal(gfx::NativeView parent, 122 void InitAsBubbleInternal(gfx::NativeView parent,
122 PaginationModel* pagination_model,
123 views::BubbleBorder::Arrow arrow, 123 views::BubbleBorder::Arrow arrow,
124 bool border_accepts_events, 124 bool border_accepts_events,
125 const gfx::Vector2d& anchor_offset); 125 const gfx::Vector2d& anchor_offset);
126 126
127 // Overridden from views::BubbleDelegateView: 127 // Overridden from views::BubbleDelegateView:
128 virtual void OnBeforeBubbleWidgetInit( 128 virtual void OnBeforeBubbleWidgetInit(
129 views::Widget::InitParams* params, 129 views::Widget::InitParams* params,
130 views::Widget* widget) const OVERRIDE; 130 views::Widget* widget) const OVERRIDE;
131 131
132 // Overridden from views::WidgetDelegateView: 132 // Overridden from views::WidgetDelegateView:
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 168
169 // For UMA and testing. If non-null, triggered when the app list is painted. 169 // For UMA and testing. If non-null, triggered when the app list is painted.
170 base::Closure next_paint_callback_; 170 base::Closure next_paint_callback_;
171 171
172 DISALLOW_COPY_AND_ASSIGN(AppListView); 172 DISALLOW_COPY_AND_ASSIGN(AppListView);
173 }; 173 };
174 174
175 } // namespace app_list 175 } // namespace app_list
176 176
177 #endif // UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_ 177 #endif // UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698