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_APPS_GRID_VIEW_H_ | 5 #ifndef UI_APP_LIST_VIEWS_APPS_GRID_VIEW_H_ |
6 #define UI_APP_LIST_VIEWS_APPS_GRID_VIEW_H_ | 6 #define UI_APP_LIST_VIEWS_APPS_GRID_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/timer/timer.h" | 10 #include "base/timer/timer.h" |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 | 215 |
216 // Invoked when |page_flip_timer_| fires. | 216 // Invoked when |page_flip_timer_| fires. |
217 void OnPageFlipTimer(); | 217 void OnPageFlipTimer(); |
218 | 218 |
219 // Updates |model_| to move item represented by |item_view| to |target| slot. | 219 // Updates |model_| to move item represented by |item_view| to |target| slot. |
220 void MoveItemInModel(views::View* item_view, const Index& target); | 220 void MoveItemInModel(views::View* item_view, const Index& target); |
221 | 221 |
222 // Cancels any context menus showing for app items on the current page. | 222 // Cancels any context menus showing for app items on the current page. |
223 void CancelContextMenusOnCurrentPage(); | 223 void CancelContextMenusOnCurrentPage(); |
224 | 224 |
| 225 // Returnes true if |point| lies within the bounds of this grid view plus a |
| 226 // buffer area surrounding it. |
| 227 bool IsPointWithinDragBuffer(const gfx::Point& point) const; |
| 228 |
225 // Overridden from views::ButtonListener: | 229 // Overridden from views::ButtonListener: |
226 virtual void ButtonPressed(views::Button* sender, | 230 virtual void ButtonPressed(views::Button* sender, |
227 const ui::Event& event) OVERRIDE; | 231 const ui::Event& event) OVERRIDE; |
228 | 232 |
229 // Overridden from ListModelObserver: | 233 // Overridden from ListModelObserver: |
230 virtual void ListItemsAdded(size_t start, size_t count) OVERRIDE; | 234 virtual void ListItemsAdded(size_t start, size_t count) OVERRIDE; |
231 virtual void ListItemsRemoved(size_t start, size_t count) OVERRIDE; | 235 virtual void ListItemsRemoved(size_t start, size_t count) OVERRIDE; |
232 virtual void ListItemMoved(size_t index, size_t target_index) OVERRIDE; | 236 virtual void ListItemMoved(size_t index, size_t target_index) OVERRIDE; |
233 virtual void ListItemsChanged(size_t start, size_t count) OVERRIDE; | 237 virtual void ListItemsChanged(size_t start, size_t count) OVERRIDE; |
234 | 238 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 | 270 |
267 // The point where the drag started in AppListItemView coordinates. | 271 // The point where the drag started in AppListItemView coordinates. |
268 gfx::Point drag_view_offset_; | 272 gfx::Point drag_view_offset_; |
269 | 273 |
270 // The point where the drag started in GridView coordinates. | 274 // The point where the drag started in GridView coordinates. |
271 gfx::Point drag_start_grid_view_; | 275 gfx::Point drag_start_grid_view_; |
272 | 276 |
273 // The location of |drag_view_| when the drag started. | 277 // The location of |drag_view_| when the drag started. |
274 gfx::Point drag_view_start_; | 278 gfx::Point drag_view_start_; |
275 | 279 |
| 280 // Page the drag started on. |
| 281 int drag_start_page_; |
| 282 |
276 #if defined(OS_WIN) && !defined(USE_AURA) | 283 #if defined(OS_WIN) && !defined(USE_AURA) |
277 // Created when a drag is started (ie: drag exceeds the drag threshold), but | 284 // Created when a drag is started (ie: drag exceeds the drag threshold), but |
278 // not Run() until supplied with a shortcut path. | 285 // not Run() until supplied with a shortcut path. |
279 scoped_refptr<SynchronousDrag> synchronous_drag_; | 286 scoped_refptr<SynchronousDrag> synchronous_drag_; |
280 #endif | 287 #endif |
281 | 288 |
282 Pointer drag_pointer_; | 289 Pointer drag_pointer_; |
283 Index drop_target_; | 290 Index drop_target_; |
284 | 291 |
285 // An application target drag and drop host which accepts dnd operations. | 292 // An application target drag and drop host which accepts dnd operations. |
(...skipping 17 matching lines...) Expand all Loading... |
303 int page_flip_delay_in_ms_; | 310 int page_flip_delay_in_ms_; |
304 | 311 |
305 views::BoundsAnimator bounds_animator_; | 312 views::BoundsAnimator bounds_animator_; |
306 | 313 |
307 DISALLOW_COPY_AND_ASSIGN(AppsGridView); | 314 DISALLOW_COPY_AND_ASSIGN(AppsGridView); |
308 }; | 315 }; |
309 | 316 |
310 } // namespace app_list | 317 } // namespace app_list |
311 | 318 |
312 #endif // UI_APP_LIST_VIEWS_APPS_GRID_VIEW_H_ | 319 #endif // UI_APP_LIST_VIEWS_APPS_GRID_VIEW_H_ |
OLD | NEW |