| 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 ASH_SHELF_SHELF_VIEW_H_ | 5 #ifndef ASH_SHELF_SHELF_VIEW_H_ |
| 6 #define ASH_SHELF_SHELF_VIEW_H_ | 6 #define ASH_SHELF_SHELF_VIEW_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 // Fades |view| from an opacity of 0 to 1. This is when adding a new item. | 223 // Fades |view| from an opacity of 0 to 1. This is when adding a new item. |
| 224 void FadeIn(views::View* view); | 224 void FadeIn(views::View* view); |
| 225 | 225 |
| 226 // Invoked when the pointer has moved enough to trigger a drag. Sets | 226 // Invoked when the pointer has moved enough to trigger a drag. Sets |
| 227 // internal state in preparation for the drag. | 227 // internal state in preparation for the drag. |
| 228 void PrepareForDrag(Pointer pointer, const ui::LocatedEvent& event); | 228 void PrepareForDrag(Pointer pointer, const ui::LocatedEvent& event); |
| 229 | 229 |
| 230 // Invoked when the mouse is dragged. Updates the models as appropriate. | 230 // Invoked when the mouse is dragged. Updates the models as appropriate. |
| 231 void ContinueDrag(const ui::LocatedEvent& event); | 231 void ContinueDrag(const ui::LocatedEvent& event); |
| 232 | 232 |
| 233 // Ends the drag on the other shelf. (ie if we are on main shelf, ends drag on |
| 234 // the overflow shelf). Invoked when a shelf item is being dragged from one |
| 235 // shelf to the other. |
| 236 void EndDragOnOtherShelf(bool cancel); |
| 237 |
| 233 // Handles ripping off an item from the shelf. Returns true when the item got | 238 // Handles ripping off an item from the shelf. Returns true when the item got |
| 234 // removed. | 239 // removed. |
| 235 bool HandleRipOffDrag(const ui::LocatedEvent& event); | 240 bool HandleRipOffDrag(const ui::LocatedEvent& event); |
| 236 | 241 |
| 237 // Finalize the rip off dragging by either |cancel| the action or validating. | 242 // Finalize the rip off dragging by either |cancel| the action or validating. |
| 238 void FinalizeRipOffDrag(bool cancel); | 243 void FinalizeRipOffDrag(bool cancel); |
| 239 | 244 |
| 240 // Check if an item can be ripped off or not. | 245 // Check if an item can be ripped off or not. |
| 241 RemovableState RemovableByRipOff(int index) const; | 246 RemovableState RemovableByRipOff(int index) const; |
| 242 | 247 |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 | 444 |
| 440 // The cursor offset to the middle of the dragged item. | 445 // The cursor offset to the middle of the dragged item. |
| 441 gfx::Vector2d drag_image_offset_; | 446 gfx::Vector2d drag_image_offset_; |
| 442 | 447 |
| 443 // The view which gets replaced by our drag icon proxy. | 448 // The view which gets replaced by our drag icon proxy. |
| 444 views::View* drag_replaced_view_ = nullptr; | 449 views::View* drag_replaced_view_ = nullptr; |
| 445 | 450 |
| 446 // True when the icon was dragged off the shelf. | 451 // True when the icon was dragged off the shelf. |
| 447 bool dragged_off_shelf_ = false; | 452 bool dragged_off_shelf_ = false; |
| 448 | 453 |
| 454 // True when an item is dragged from one shelf to another (eg. overflow). |
| 455 bool dragged_to_another_shelf_ = false; |
| 456 |
| 449 // The rip off view when a snap back operation is underway. | 457 // The rip off view when a snap back operation is underway. |
| 450 views::View* snap_back_from_rip_off_view_ = nullptr; | 458 views::View* snap_back_from_rip_off_view_ = nullptr; |
| 451 | 459 |
| 452 // True when this ShelfView is used for Overflow Bubble. | 460 // True when this ShelfView is used for Overflow Bubble. |
| 453 bool overflow_mode_ = false; | 461 bool overflow_mode_ = false; |
| 454 | 462 |
| 455 // Holds a pointer to main ShelfView when a ShelfView is in overflow mode. | 463 // Holds a pointer to main ShelfView when a ShelfView is in overflow mode. |
| 456 ShelfView* main_shelf_ = nullptr; | 464 ShelfView* main_shelf_ = nullptr; |
| 457 | 465 |
| 458 // True when ripped item from overflow bubble is entered into Shelf. | 466 // True when ripped item from overflow bubble is entered into Shelf. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 471 ShelfButtonPressedMetricTracker shelf_button_pressed_metric_tracker_; | 479 ShelfButtonPressedMetricTracker shelf_button_pressed_metric_tracker_; |
| 472 | 480 |
| 473 base::WeakPtrFactory<ShelfView> weak_factory_; | 481 base::WeakPtrFactory<ShelfView> weak_factory_; |
| 474 | 482 |
| 475 DISALLOW_COPY_AND_ASSIGN(ShelfView); | 483 DISALLOW_COPY_AND_ASSIGN(ShelfView); |
| 476 }; | 484 }; |
| 477 | 485 |
| 478 } // namespace ash | 486 } // namespace ash |
| 479 | 487 |
| 480 #endif // ASH_SHELF_SHELF_VIEW_H_ | 488 #endif // ASH_SHELF_SHELF_VIEW_H_ |
| OLD | NEW |