Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1313)

Side by Side Diff: ash/shelf/shelf_view.h

Issue 2046843005: mash: Migrate shelf menus to wm common types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ash_shell_with_content Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/shelf/shelf_alignment_menu.cc ('k') | ash/shelf/shelf_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 17 matching lines...) Expand all
28 namespace ui { 28 namespace ui {
29 class MenuModel; 29 class MenuModel;
30 } 30 }
31 31
32 namespace views { 32 namespace views {
33 class BoundsAnimator; 33 class BoundsAnimator;
34 class MenuRunner; 34 class MenuRunner;
35 } 35 }
36 36
37 namespace ash { 37 namespace ash {
38 class DragImageView;
39 class OverflowBubble;
40 class OverflowButton;
38 class Shelf; 41 class Shelf;
42 class ShelfButton;
39 class ShelfDelegate; 43 class ShelfDelegate;
40 class ShelfIconObserver; 44 class ShelfIconObserver;
41 class ShelfItemDelegateManager; 45 class ShelfItemDelegateManager;
42 class ShelfModel; 46 class ShelfModel;
43 struct ShelfItem; 47 struct ShelfItem;
44 class DragImageView; 48 class WmShelf;
45 class OverflowBubble;
46 class OverflowButton;
47 class ShelfButton;
48 49
49 namespace test { 50 namespace test {
50 class ShelfViewTestAPI; 51 class ShelfViewTestAPI;
51 } 52 }
52 53
53 extern const int SHELF_ALIGNMENT_UMA_ENUM_VALUE_BOTTOM; 54 extern const int SHELF_ALIGNMENT_UMA_ENUM_VALUE_BOTTOM;
54 extern const int SHELF_ALIGNMENT_UMA_ENUM_VALUE_LEFT; 55 extern const int SHELF_ALIGNMENT_UMA_ENUM_VALUE_LEFT;
55 extern const int SHELF_ALIGNMENT_UMA_ENUM_VALUE_RIGHT; 56 extern const int SHELF_ALIGNMENT_UMA_ENUM_VALUE_RIGHT;
56 extern const int SHELF_ALIGNMENT_UMA_ENUM_VALUE_COUNT; 57 extern const int SHELF_ALIGNMENT_UMA_ENUM_VALUE_COUNT;
57 58
58 class ASH_EXPORT ShelfView : public views::View, 59 class ASH_EXPORT ShelfView : public views::View,
59 public ShelfModelObserver, 60 public ShelfModelObserver,
60 public views::ButtonListener, 61 public views::ButtonListener,
61 public views::ContextMenuController, 62 public views::ContextMenuController,
62 public views::FocusTraversable, 63 public views::FocusTraversable,
63 public views::BoundsAnimatorObserver, 64 public views::BoundsAnimatorObserver,
64 public app_list::ApplicationDragAndDropHost { 65 public app_list::ApplicationDragAndDropHost {
65 public: 66 public:
66 ShelfView(ShelfModel* model, ShelfDelegate* delegate, Shelf* shelf); 67 ShelfView(ShelfModel* model,
68 ShelfDelegate* delegate,
69 WmShelf* wm_shelf,
70 Shelf* shelf);
67 ~ShelfView() override; 71 ~ShelfView() override;
68 72
69 Shelf* shelf() const { return shelf_; } 73 Shelf* shelf() const { return shelf_; }
70 ShelfModel* model() const { return model_; } 74 ShelfModel* model() const { return model_; }
71 75
72 void Init(); 76 void Init();
73 77
74 void OnShelfAlignmentChanged(); 78 void OnShelfAlignmentChanged();
75 void SchedulePaintForAllButtons(); 79 void SchedulePaintForAllButtons();
76 80
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 // Get the distance from the given |coordinate| to the closest point on this 318 // Get the distance from the given |coordinate| to the closest point on this
315 // launcher/shelf. 319 // launcher/shelf.
316 int CalculateShelfDistance(const gfx::Point& coordinate) const; 320 int CalculateShelfDistance(const gfx::Point& coordinate) const;
317 321
318 // The model; owned by Launcher. 322 // The model; owned by Launcher.
319 ShelfModel* model_; 323 ShelfModel* model_;
320 324
321 // Delegate; owned by Launcher. 325 // Delegate; owned by Launcher.
322 ShelfDelegate* delegate_; 326 ShelfDelegate* delegate_;
323 327
328 // The shelf controller; owned by RootWindowController.
329 WmShelf* wm_shelf_;
330
324 // The shelf; owned by ShelfWidget. 331 // The shelf; owned by ShelfWidget.
325 Shelf* shelf_; 332 Shelf* shelf_;
326 333
327 // Used to manage the set of active launcher buttons. There is a view per 334 // Used to manage the set of active launcher buttons. There is a view per
328 // item in |model_|. 335 // item in |model_|.
329 std::unique_ptr<views::ViewModel> view_model_; 336 std::unique_ptr<views::ViewModel> view_model_;
330 337
331 // Index of first visible launcher item. 338 // Index of first visible launcher item.
332 int first_visible_index_; 339 int first_visible_index_;
333 340
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 448
442 // Tracks UMA metrics based on shelf button press actions. 449 // Tracks UMA metrics based on shelf button press actions.
443 ShelfButtonPressedMetricTracker shelf_button_pressed_metric_tracker_; 450 ShelfButtonPressedMetricTracker shelf_button_pressed_metric_tracker_;
444 451
445 DISALLOW_COPY_AND_ASSIGN(ShelfView); 452 DISALLOW_COPY_AND_ASSIGN(ShelfView);
446 }; 453 };
447 454
448 } // namespace ash 455 } // namespace ash
449 456
450 #endif // ASH_SHELF_SHELF_VIEW_H_ 457 #endif // ASH_SHELF_SHELF_VIEW_H_
OLDNEW
« no previous file with comments | « ash/shelf/shelf_alignment_menu.cc ('k') | ash/shelf/shelf_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698