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_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/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
10 #include "ui/app_list/app_list_export.h" | 10 #include "ui/app_list/app_list_export.h" |
11 #include "ui/app_list/app_list_view_delegate_observer.h" | 11 #include "ui/app_list/app_list_view_delegate_observer.h" |
12 #include "ui/app_list/speech_ui_model_observer.h" | 12 #include "ui/app_list/speech_ui_model_observer.h" |
13 #include "ui/views/bubble/bubble_delegate.h" | 13 #include "ui/views/bubble/bubble_delegate.h" |
14 #include "ui/views/widget/widget.h" | 14 #include "ui/views/widget/widget.h" |
15 | 15 |
16 namespace base { | 16 namespace base { |
17 class FilePath; | 17 class FilePath; |
18 } | 18 } |
19 | 19 |
20 namespace gfx { | |
21 class Screen; | |
22 } | |
23 | |
24 namespace app_list { | 20 namespace app_list { |
25 class ApplicationDragAndDropHost; | 21 class ApplicationDragAndDropHost; |
26 class AppListMainView; | 22 class AppListMainView; |
27 class AppListModel; | 23 class AppListModel; |
28 class AppListViewDelegate; | 24 class AppListViewDelegate; |
29 class AppListViewObserver; | 25 class AppListViewObserver; |
30 class HideViewAnimationObserver; | 26 class HideViewAnimationObserver; |
31 class PaginationModel; | 27 class PaginationModel; |
32 class SigninDelegate; | 28 class SigninDelegate; |
33 class SigninView; | 29 class SigninView; |
(...skipping 20 matching lines...) Expand all Loading... |
54 bool border_accepts_events); | 50 bool border_accepts_events); |
55 | 51 |
56 // Initializes the widget and use a fixed |anchor_point_in_screen| for | 52 // Initializes the widget and use a fixed |anchor_point_in_screen| for |
57 // positioning. | 53 // positioning. |
58 void InitAsBubbleAtFixedLocation(gfx::NativeView parent, | 54 void InitAsBubbleAtFixedLocation(gfx::NativeView parent, |
59 PaginationModel* pagination_model, | 55 PaginationModel* pagination_model, |
60 const gfx::Point& anchor_point_in_screen, | 56 const gfx::Point& anchor_point_in_screen, |
61 views::BubbleBorder::Arrow arrow, | 57 views::BubbleBorder::Arrow arrow, |
62 bool border_accepts_events); | 58 bool border_accepts_events); |
63 | 59 |
64 // Initializes the widget and use the center of the primary display for | |
65 // positioning. | |
66 void InitAsBubbleCenteredOnPrimaryDisplay( | |
67 gfx::NativeView parent, | |
68 PaginationModel* pagination_model, | |
69 gfx::Screen* screen_to_keep_centered_on, | |
70 views::BubbleBorder::Arrow arrow, | |
71 bool border_accepts_events); | |
72 | |
73 void SetBubbleArrow(views::BubbleBorder::Arrow arrow); | 60 void SetBubbleArrow(views::BubbleBorder::Arrow arrow); |
74 | 61 |
75 void SetAnchorPoint(const gfx::Point& anchor_point); | 62 void SetAnchorPoint(const gfx::Point& anchor_point); |
76 | 63 |
77 // If |drag_and_drop_host| is not NULL it will be called upon drag and drop | 64 // If |drag_and_drop_host| is not NULL it will be called upon drag and drop |
78 // operations outside the application list. This has to be called after | 65 // operations outside the application list. This has to be called after |
79 // InitAsBubble was called since the app list object needs to exist so that | 66 // InitAsBubble was called since the app list object needs to exist so that |
80 // it can set the host. | 67 // it can set the host. |
81 void SetDragAndDropHostOfCurrentAppList( | 68 void SetDragAndDropHostOfCurrentAppList( |
82 ApplicationDragAndDropHost* drag_and_drop_host); | 69 ApplicationDragAndDropHost* drag_and_drop_host); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 | 103 |
117 AppListMainView* app_list_main_view() { return app_list_main_view_; } | 104 AppListMainView* app_list_main_view() { return app_list_main_view_; } |
118 | 105 |
119 private: | 106 private: |
120 void InitAsBubbleInternal(gfx::NativeView parent, | 107 void InitAsBubbleInternal(gfx::NativeView parent, |
121 PaginationModel* pagination_model, | 108 PaginationModel* pagination_model, |
122 views::BubbleBorder::Arrow arrow, | 109 views::BubbleBorder::Arrow arrow, |
123 bool border_accepts_events, | 110 bool border_accepts_events, |
124 const gfx::Vector2d& anchor_offset); | 111 const gfx::Vector2d& anchor_offset); |
125 | 112 |
126 // Gets the point at the center of the current screen. | |
127 // |screen_to_keep_centered_on_| must not be NULL. | |
128 gfx::Point GetCenterPoint(); | |
129 | |
130 // Overridden from views::BubbleDelegateView: | 113 // Overridden from views::BubbleDelegateView: |
131 virtual void OnBeforeBubbleWidgetInit( | 114 virtual void OnBeforeBubbleWidgetInit( |
132 views::Widget::InitParams* params, | 115 views::Widget::InitParams* params, |
133 views::Widget* widget) const OVERRIDE; | 116 views::Widget* widget) const OVERRIDE; |
134 | 117 |
135 // Overridden from views::WidgetDelegateView: | 118 // Overridden from views::WidgetDelegateView: |
136 virtual views::View* GetInitiallyFocusedView() OVERRIDE; | 119 virtual views::View* GetInitiallyFocusedView() OVERRIDE; |
137 virtual gfx::ImageSkia GetWindowIcon() OVERRIDE; | 120 virtual gfx::ImageSkia GetWindowIcon() OVERRIDE; |
138 virtual bool WidgetHasHitTestMask() const OVERRIDE; | 121 virtual bool WidgetHasHitTestMask() const OVERRIDE; |
139 virtual void GetWidgetHitTestMask(gfx::Path* mask) const OVERRIDE; | 122 virtual void GetWidgetHitTestMask(gfx::Path* mask) const OVERRIDE; |
(...skipping 18 matching lines...) Expand all Loading... |
158 | 141 |
159 scoped_ptr<AppListViewDelegate> delegate_; | 142 scoped_ptr<AppListViewDelegate> delegate_; |
160 | 143 |
161 AppListMainView* app_list_main_view_; | 144 AppListMainView* app_list_main_view_; |
162 SigninView* signin_view_; | 145 SigninView* signin_view_; |
163 SpeechView* speech_view_; | 146 SpeechView* speech_view_; |
164 | 147 |
165 ObserverList<AppListViewObserver> observers_; | 148 ObserverList<AppListViewObserver> observers_; |
166 scoped_ptr<HideViewAnimationObserver> animation_observer_; | 149 scoped_ptr<HideViewAnimationObserver> animation_observer_; |
167 | 150 |
168 // If non-NULL, the app list will remain centered on this screen's primary | |
169 // display. | |
170 gfx::Screen* screen_to_keep_centered_on_; | |
171 | |
172 DISALLOW_COPY_AND_ASSIGN(AppListView); | 151 DISALLOW_COPY_AND_ASSIGN(AppListView); |
173 }; | 152 }; |
174 | 153 |
175 } // namespace app_list | 154 } // namespace app_list |
176 | 155 |
177 #endif // UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_ | 156 #endif // UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_ |
OLD | NEW |