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