Chromium Code Reviews| 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 <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
|
oshima
2016/04/08 07:09:41
include?
| |
| 11 | 11 |
| 12 #include "ash/shelf/shelf_button_pressed_metric_tracker.h" | 12 #include "ash/shelf/shelf_button_pressed_metric_tracker.h" |
| 13 #include "ash/shelf/shelf_item_delegate.h" | 13 #include "ash/shelf/shelf_item_delegate.h" |
| 14 #include "ash/shelf/shelf_model_observer.h" | 14 #include "ash/shelf/shelf_model_observer.h" |
| 15 #include "ash/shelf/shelf_tooltip_manager.h" | 15 #include "ash/shelf/shelf_tooltip_manager.h" |
| 16 #include "ash/wm/gestures/shelf_gesture_handler.h" | 16 #include "ash/wm/gestures/shelf_gesture_handler.h" |
| 17 #include "base/macros.h" | 17 #include "base/macros.h" |
| 18 #include "base/observer_list.h" | 18 #include "base/observer_list.h" |
| 19 #include "ui/app_list/views/app_list_drag_and_drop_host.h" | 19 #include "ui/app_list/views/app_list_drag_and_drop_host.h" |
| 20 #include "ui/views/animation/bounds_animator_observer.h" | 20 #include "ui/views/animation/bounds_animator_observer.h" |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 318 ShelfModel* model_; | 318 ShelfModel* model_; |
| 319 | 319 |
| 320 // Delegate; owned by Launcher. | 320 // Delegate; owned by Launcher. |
| 321 ShelfDelegate* delegate_; | 321 ShelfDelegate* delegate_; |
| 322 | 322 |
| 323 // The shelf; owned by ShelfWidget. | 323 // The shelf; owned by ShelfWidget. |
| 324 Shelf* shelf_; | 324 Shelf* shelf_; |
| 325 | 325 |
| 326 // Used to manage the set of active launcher buttons. There is a view per | 326 // Used to manage the set of active launcher buttons. There is a view per |
| 327 // item in |model_|. | 327 // item in |model_|. |
| 328 scoped_ptr<views::ViewModel> view_model_; | 328 std::unique_ptr<views::ViewModel> view_model_; |
| 329 | 329 |
| 330 // Index of first visible launcher item. | 330 // Index of first visible launcher item. |
| 331 int first_visible_index_; | 331 int first_visible_index_; |
| 332 | 332 |
| 333 // Last index of a launcher button that is visible | 333 // Last index of a launcher button that is visible |
| 334 // (does not go into overflow). | 334 // (does not go into overflow). |
| 335 mutable int last_visible_index_; | 335 mutable int last_visible_index_; |
| 336 | 336 |
| 337 scoped_ptr<views::BoundsAnimator> bounds_animator_; | 337 std::unique_ptr<views::BoundsAnimator> bounds_animator_; |
| 338 | 338 |
| 339 OverflowButton* overflow_button_; | 339 OverflowButton* overflow_button_; |
| 340 | 340 |
| 341 scoped_ptr<OverflowBubble> overflow_bubble_; | 341 std::unique_ptr<OverflowBubble> overflow_bubble_; |
| 342 | 342 |
| 343 OverflowBubble* owner_overflow_bubble_; | 343 OverflowBubble* owner_overflow_bubble_; |
| 344 | 344 |
| 345 ShelfTooltipManager tooltip_; | 345 ShelfTooltipManager tooltip_; |
| 346 | 346 |
| 347 // Pointer device that initiated the current drag operation. If there is no | 347 // Pointer device that initiated the current drag operation. If there is no |
| 348 // current dragging operation, this is NONE. | 348 // current dragging operation, this is NONE. |
| 349 Pointer drag_pointer_; | 349 Pointer drag_pointer_; |
| 350 | 350 |
| 351 // The view being dragged. This is set immediately when the mouse is pressed. | 351 // The view being dragged. This is set immediately when the mouse is pressed. |
| 352 // |dragging_| is set only if the mouse is dragged far enough. | 352 // |dragging_| is set only if the mouse is dragged far enough. |
| 353 ShelfButton* drag_view_; | 353 ShelfButton* drag_view_; |
| 354 | 354 |
| 355 // Position of the mouse down event in |drag_view_|'s coordinates. | 355 // Position of the mouse down event in |drag_view_|'s coordinates. |
| 356 gfx::Point drag_origin_; | 356 gfx::Point drag_origin_; |
| 357 | 357 |
| 358 // Index |drag_view_| was initially at. | 358 // Index |drag_view_| was initially at. |
| 359 int start_drag_index_; | 359 int start_drag_index_; |
| 360 | 360 |
| 361 // Used for the context menu of a particular item. | 361 // Used for the context menu of a particular item. |
| 362 ShelfID context_menu_id_; | 362 ShelfID context_menu_id_; |
| 363 | 363 |
| 364 scoped_ptr<views::FocusSearch> focus_search_; | 364 std::unique_ptr<views::FocusSearch> focus_search_; |
| 365 | 365 |
| 366 scoped_ptr<views::MenuRunner> launcher_menu_runner_; | 366 std::unique_ptr<views::MenuRunner> launcher_menu_runner_; |
| 367 | 367 |
| 368 base::ObserverList<ShelfIconObserver> observers_; | 368 base::ObserverList<ShelfIconObserver> observers_; |
| 369 | 369 |
| 370 // Amount content is inset on the left edge (or top edge for vertical | 370 // Amount content is inset on the left edge (or top edge for vertical |
| 371 // alignment). | 371 // alignment). |
| 372 int leading_inset_; | 372 int leading_inset_; |
| 373 | 373 |
| 374 ShelfGestureHandler gesture_handler_; | 374 ShelfGestureHandler gesture_handler_; |
| 375 | 375 |
| 376 // True when an item being inserted or removed in the model cancels a drag. | 376 // True when an item being inserted or removed in the model cancels a drag. |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 396 ShelfID drag_and_drop_shelf_id_; | 396 ShelfID drag_and_drop_shelf_id_; |
| 397 | 397 |
| 398 // The application ID of the application which we drag and drop. | 398 // The application ID of the application which we drag and drop. |
| 399 std::string drag_and_drop_app_id_; | 399 std::string drag_and_drop_app_id_; |
| 400 | 400 |
| 401 // The original launcher item's size before the dragging operation. | 401 // The original launcher item's size before the dragging operation. |
| 402 gfx::Size pre_drag_and_drop_size_; | 402 gfx::Size pre_drag_and_drop_size_; |
| 403 | 403 |
| 404 // The image proxy for drag operations when a drag and drop host exists and | 404 // The image proxy for drag operations when a drag and drop host exists and |
| 405 // the item can be dragged outside the app grid. | 405 // the item can be dragged outside the app grid. |
| 406 scoped_ptr<ash::DragImageView> drag_image_; | 406 std::unique_ptr<ash::DragImageView> drag_image_; |
| 407 | 407 |
| 408 // The cursor offset to the middle of the dragged item. | 408 // The cursor offset to the middle of the dragged item. |
| 409 gfx::Vector2d drag_image_offset_; | 409 gfx::Vector2d drag_image_offset_; |
| 410 | 410 |
| 411 // The view which gets replaced by our drag icon proxy. | 411 // The view which gets replaced by our drag icon proxy. |
| 412 views::View* drag_replaced_view_; | 412 views::View* drag_replaced_view_; |
| 413 | 413 |
| 414 // True when the icon was dragged off the shelf. | 414 // True when the icon was dragged off the shelf. |
| 415 bool dragged_off_shelf_; | 415 bool dragged_off_shelf_; |
| 416 | 416 |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 440 | 440 |
| 441 // Tracks UMA metrics based on shelf button press actions. | 441 // Tracks UMA metrics based on shelf button press actions. |
| 442 ShelfButtonPressedMetricTracker shelf_button_pressed_metric_tracker_; | 442 ShelfButtonPressedMetricTracker shelf_button_pressed_metric_tracker_; |
| 443 | 443 |
| 444 DISALLOW_COPY_AND_ASSIGN(ShelfView); | 444 DISALLOW_COPY_AND_ASSIGN(ShelfView); |
| 445 }; | 445 }; |
| 446 | 446 |
| 447 } // namespace ash | 447 } // namespace ash |
| 448 | 448 |
| 449 #endif // ASH_SHELF_SHELF_VIEW_H_ | 449 #endif // ASH_SHELF_SHELF_VIEW_H_ |
| OLD | NEW |