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

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 tests and bugs. 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 11 matching lines...) Expand all
22 class AppListViewTestApi; 22 class AppListViewTestApi;
23 } 23 }
24 24
25 namespace app_list { 25 namespace app_list {
26 class ApplicationDragAndDropHost; 26 class ApplicationDragAndDropHost;
27 class AppListMainView; 27 class AppListMainView;
28 class AppListModel; 28 class AppListModel;
29 class AppListViewDelegate; 29 class AppListViewDelegate;
30 class AppListViewObserver; 30 class AppListViewObserver;
31 class HideViewAnimationObserver; 31 class HideViewAnimationObserver;
32 class PaginationModel;
33 class SigninDelegate; 32 class SigninDelegate;
34 class SigninView; 33 class SigninView;
35 class SpeechView; 34 class SpeechView;
36 35
37 // AppListView is the top-level view and controller of app list UI. It creates 36 // AppListView is the top-level view and controller of app list UI. It creates
38 // and hosts a AppsGridView and passes AppListModel to it for display. 37 // and hosts a AppsGridView and passes AppListModel to it for display.
39 class APP_LIST_EXPORT AppListView : public views::BubbleDelegateView, 38 class APP_LIST_EXPORT AppListView : public views::BubbleDelegateView,
40 public AppListViewDelegateObserver, 39 public AppListViewDelegateObserver,
41 public SpeechUIModelObserver { 40 public SpeechUIModelObserver {
42 public: 41 public:
43 // Takes ownership of |delegate|. 42 // Takes ownership of |delegate|.
44 explicit AppListView(AppListViewDelegate* delegate); 43 explicit AppListView(AppListViewDelegate* delegate);
45 virtual ~AppListView(); 44 virtual ~AppListView();
46 45
47 // Initializes the widget and use a given |anchor| plus an |anchor_offset| for 46 // Initializes the widget and use a given |anchor| plus an |anchor_offset| for
48 // positioning. 47 // positioning.
49 void InitAsBubbleAttachedToAnchor(gfx::NativeView parent, 48 void InitAsBubbleAttachedToAnchor(gfx::NativeView parent,
50 PaginationModel* pagination_model,
51 views::View* anchor, 49 views::View* anchor,
52 const gfx::Vector2d& anchor_offset, 50 const gfx::Vector2d& anchor_offset,
53 views::BubbleBorder::Arrow arrow, 51 views::BubbleBorder::Arrow arrow,
54 bool border_accepts_events); 52 bool border_accepts_events);
55 53
56 // 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
57 // positioning. 55 // positioning.
58 void InitAsBubbleAtFixedLocation(gfx::NativeView parent, 56 void InitAsBubbleAtFixedLocation(gfx::NativeView parent,
59 PaginationModel* pagination_model,
60 const gfx::Point& anchor_point_in_screen, 57 const gfx::Point& anchor_point_in_screen,
61 views::BubbleBorder::Arrow arrow, 58 views::BubbleBorder::Arrow arrow,
62 bool border_accepts_events); 59 bool border_accepts_events);
63 60
64 void SetBubbleArrow(views::BubbleBorder::Arrow arrow); 61 void SetBubbleArrow(views::BubbleBorder::Arrow arrow);
65 62
66 void SetAnchorPoint(const gfx::Point& anchor_point); 63 void SetAnchorPoint(const gfx::Point& anchor_point);
67 64
68 // If |drag_and_drop_host| is not NULL it will be called upon drag and drop 65 // 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 66 // operations outside the application list. This has to be called after
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 #if defined(OS_WIN) 109 #if defined(OS_WIN)
113 HWND GetHWND() const; 110 HWND GetHWND() const;
114 #endif 111 #endif
115 112
116 AppListMainView* app_list_main_view() { return app_list_main_view_; } 113 AppListMainView* app_list_main_view() { return app_list_main_view_; }
117 114
118 private: 115 private:
119 friend class ::test::AppListViewTestApi; 116 friend class ::test::AppListViewTestApi;
120 117
121 void InitAsBubbleInternal(gfx::NativeView parent, 118 void InitAsBubbleInternal(gfx::NativeView parent,
122 PaginationModel* pagination_model,
123 views::BubbleBorder::Arrow arrow, 119 views::BubbleBorder::Arrow arrow,
124 bool border_accepts_events, 120 bool border_accepts_events,
125 const gfx::Vector2d& anchor_offset); 121 const gfx::Vector2d& anchor_offset);
126 122
127 // Overridden from views::BubbleDelegateView: 123 // Overridden from views::BubbleDelegateView:
128 virtual void OnBeforeBubbleWidgetInit( 124 virtual void OnBeforeBubbleWidgetInit(
129 views::Widget::InitParams* params, 125 views::Widget::InitParams* params,
130 views::Widget* widget) const OVERRIDE; 126 views::Widget* widget) const OVERRIDE;
131 127
132 // Overridden from views::WidgetDelegateView: 128 // Overridden from views::WidgetDelegateView:
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 164
169 // For UMA and testing. If non-null, triggered when the app list is painted. 165 // For UMA and testing. If non-null, triggered when the app list is painted.
170 base::Closure next_paint_callback_; 166 base::Closure next_paint_callback_;
171 167
172 DISALLOW_COPY_AND_ASSIGN(AppListView); 168 DISALLOW_COPY_AND_ASSIGN(AppListView);
173 }; 169 };
174 170
175 } // namespace app_list 171 } // namespace app_list
176 172
177 #endif // UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_ 173 #endif // UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698