| 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 <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 void CalculateNearestTileForVertex( | 396 void CalculateNearestTileForVertex( |
| 397 const gfx::Point& vertex, Index* nearest_tile, int* d_min); | 397 const gfx::Point& vertex, Index* nearest_tile, int* d_min); |
| 398 | 398 |
| 399 // Returns the bounds of the tile in which |point| is enclosed if there | 399 // Returns the bounds of the tile in which |point| is enclosed if there |
| 400 // is a valid item sits on the tile. | 400 // is a valid item sits on the tile. |
| 401 gfx::Rect GetTileBoundsForPoint(const gfx::Point& point, Index* tile_index); | 401 gfx::Rect GetTileBoundsForPoint(const gfx::Point& point, Index* tile_index); |
| 402 | 402 |
| 403 // Gets the bounds of the tile located at |row| and |col| on current page. | 403 // Gets the bounds of the tile located at |row| and |col| on current page. |
| 404 gfx::Rect GetTileBounds(int row, int col) const; | 404 gfx::Rect GetTileBounds(int row, int col) const; |
| 405 | 405 |
| 406 // Returns true if the slot of |index| is the first empty slot next to the | 406 // Returns true if the slot of |index| is the last possible slot to drop |
| 407 // last item on the last page. | 407 // an item, i.e. first empty slot next to the last item on the last page. |
| 408 bool IsFirstEmptySlot(const Index& index) const; | 408 bool IsLastPossibleDropTarget(const Index& index) const; |
| 409 | 409 |
| 410 // Gets the item view located at |slot| on the current page. If there is | 410 // Gets the item view located at |slot| on the current page. If there is |
| 411 // no item located at |slot|, returns NULL. | 411 // no item located at |slot|, returns NULL. |
| 412 views::View* GetViewAtSlotOnCurrentPage(int slot); | 412 views::View* GetViewAtSlotOnCurrentPage(int slot); |
| 413 | 413 |
| 414 // Sets state of the view with |target_index| to |is_target_folder| for | 414 // Sets state of the view with |target_index| to |is_target_folder| for |
| 415 // dropping |drag_view_|. | 415 // dropping |drag_view_|. |
| 416 void SetAsFolderDroppingTarget(const Index& target_index, | 416 void SetAsFolderDroppingTarget(const Index& target_index, |
| 417 bool is_target_folder); | 417 bool is_target_folder); |
| 418 | 418 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 // The location of |drag_view_| when the drag started. | 490 // The location of |drag_view_| when the drag started. |
| 491 gfx::Point drag_view_start_; | 491 gfx::Point drag_view_start_; |
| 492 | 492 |
| 493 // Page the drag started on. | 493 // Page the drag started on. |
| 494 int drag_start_page_; | 494 int drag_start_page_; |
| 495 | 495 |
| 496 #if defined(OS_WIN) | 496 #if defined(OS_WIN) |
| 497 // Created when a drag is started (ie: drag exceeds the drag threshold), but | 497 // Created when a drag is started (ie: drag exceeds the drag threshold), but |
| 498 // not Run() until supplied with a shortcut path. | 498 // not Run() until supplied with a shortcut path. |
| 499 scoped_refptr<SynchronousDrag> synchronous_drag_; | 499 scoped_refptr<SynchronousDrag> synchronous_drag_; |
| 500 |
| 501 // Whether to use SynchronousDrag to support dropping to task bar etc. |
| 502 bool use_synchronous_drag_; |
| 500 #endif | 503 #endif |
| 501 | 504 |
| 502 Pointer drag_pointer_; | 505 Pointer drag_pointer_; |
| 503 Index drop_target_; | 506 Index drop_target_; |
| 504 DropAttempt drop_attempt_; | 507 DropAttempt drop_attempt_; |
| 505 | 508 |
| 506 // Timer for re-ordering the |drop_target_| and |drag_view_|. | 509 // Timer for re-ordering the |drop_target_| and |drag_view_|. |
| 507 base::OneShotTimer<AppsGridView> reorder_timer_; | 510 base::OneShotTimer<AppsGridView> reorder_timer_; |
| 508 | 511 |
| 509 // Timer for dropping |drag_view_| into the folder containing | 512 // Timer for dropping |drag_view_| into the folder containing |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 | 547 |
| 545 // True if the drag_view_ item is a folder item being dragged for reparenting. | 548 // True if the drag_view_ item is a folder item being dragged for reparenting. |
| 546 bool dragging_for_reparent_item_; | 549 bool dragging_for_reparent_item_; |
| 547 | 550 |
| 548 DISALLOW_COPY_AND_ASSIGN(AppsGridView); | 551 DISALLOW_COPY_AND_ASSIGN(AppsGridView); |
| 549 }; | 552 }; |
| 550 | 553 |
| 551 } // namespace app_list | 554 } // namespace app_list |
| 552 | 555 |
| 553 #endif // UI_APP_LIST_VIEWS_APPS_GRID_VIEW_H_ | 556 #endif // UI_APP_LIST_VIEWS_APPS_GRID_VIEW_H_ |
| OLD | NEW |