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

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

Issue 2235233006: ash: Refactor Shelf ownership and ShelfView creation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 4 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/root_window_controller.cc ('k') | ash/shelf/shelf.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_H_ 5 #ifndef ASH_SHELF_SHELF_H_
6 #define ASH_SHELF_SHELF_H_ 6 #define ASH_SHELF_SHELF_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 17 matching lines...) Expand all
28 28
29 namespace views { 29 namespace views {
30 class View; 30 class View;
31 } 31 }
32 32
33 namespace ash { 33 namespace ash {
34 class AppListButton; 34 class AppListButton;
35 class FocusCycler; 35 class FocusCycler;
36 class ShelfDelegate; 36 class ShelfDelegate;
37 class ShelfIconObserver; 37 class ShelfIconObserver;
38 class ShelfModel;
39 class ShelfView; 38 class ShelfView;
40 class WmShelf; 39 class WmShelf;
41 40
42 namespace test { 41 namespace test {
43 class ShelfTestAPI; 42 class ShelfTestAPI;
44 } 43 }
45 44
46 // Controller for shelf state. All access to state (visibility, auto-hide, etc.) 45 // Controller for shelf state.
47 // should occur via this class. 46 // DEPRECATED: WmShelf is replacing this class as part of the mus/mash refactor.
47 // Use WmShelf for access to state (visibility, auto-hide, etc.).
48 class ASH_EXPORT Shelf { 48 class ASH_EXPORT Shelf {
49 public: 49 public:
50 static const char kNativeViewName[]; 50 Shelf(WmShelf* wm_shelf, ShelfView* shelf_view, ShelfWidget* widget);
51
52 Shelf(ShelfModel* model,
53 WmShelf* wm_shelf,
54 ShelfWidget* widget);
55 ~Shelf(); 51 ~Shelf();
56 52
57 // Return the shelf for the primary display. NULL if no user is logged in yet. 53 // Return the shelf for the primary display. NULL if no user is logged in yet.
58 // Useful for tests. For production code use ForWindow() because the user may 54 // Useful for tests. For production code use ForWindow() because the user may
59 // have multiple displays. 55 // have multiple displays.
60 static Shelf* ForPrimaryDisplay(); 56 static Shelf* ForPrimaryDisplay();
61 57
62 // Return the shelf for the display that |window| is currently on, or a shelf 58 // Return the shelf for the display that |window| is currently on, or a shelf
63 // on primary display if the shelf per display feature is disabled. NULL if no 59 // on primary display if the shelf per display feature is disabled. NULL if no
64 // user is logged in yet. 60 // user is logged in yet.
65 static Shelf* ForWindow(const WmWindow* window); 61 static Shelf* ForWindow(const WmWindow* window);
66 62
63 // DEPRECATED. Use WmShelf::GetAlignment() and SetAlignment().
67 void SetAlignment(ShelfAlignment alignment); 64 void SetAlignment(ShelfAlignment alignment);
68 ShelfAlignment alignment() const { return alignment_; } 65 ShelfAlignment alignment() const { return alignment_; }
69 66
70 // Sets the ShelfAutoHideBehavior. See enum description for details. 67 // Sets the ShelfAutoHideBehavior. See enum description for details.
68 // DEPRECATED. Use WmShelf::GetAutoHideBehavior() and SetAutoHideBehavior().
71 void SetAutoHideBehavior(ShelfAutoHideBehavior auto_hide_behavior); 69 void SetAutoHideBehavior(ShelfAutoHideBehavior auto_hide_behavior);
72 ShelfAutoHideBehavior auto_hide_behavior() const { 70 ShelfAutoHideBehavior auto_hide_behavior() const {
73 return auto_hide_behavior_; 71 return auto_hide_behavior_;
74 } 72 }
75 73
76 ShelfAutoHideState GetAutoHideState() const; 74 ShelfAutoHideState GetAutoHideState() const;
77 75
78 ShelfVisibilityState GetVisibilityState() const; 76 ShelfVisibilityState GetVisibilityState() const;
79 77
80 // Returns the screen bounds of the item for the specified window. If there is 78 // Returns the screen bounds of the item for the specified window. If there is
(...skipping 13 matching lines...) Expand all
94 92
95 void AddIconObserver(ShelfIconObserver* observer); 93 void AddIconObserver(ShelfIconObserver* observer);
96 void RemoveIconObserver(ShelfIconObserver* observer); 94 void RemoveIconObserver(ShelfIconObserver* observer);
97 95
98 // Returns true if the shelf is showing a context menu. 96 // Returns true if the shelf is showing a context menu.
99 bool IsShowingMenu() const; 97 bool IsShowingMenu() const;
100 98
101 // TODO(jamescook): Migrate this to ShelfWidget. 99 // TODO(jamescook): Migrate this to ShelfWidget.
102 bool IsShowingOverflowBubble() const; 100 bool IsShowingOverflowBubble() const;
103 101
104 void SetVisible(bool visible) const; 102 // TODO(jamescook): Migrate to ShelfWidget::IsShelfVisible().
105 bool IsVisible() const; 103 bool IsVisible() const;
106 104
107 void SchedulePaint(); 105 void SchedulePaint();
108 106
109 AppListButton* GetAppListButton() const; 107 AppListButton* GetAppListButton() const;
110 108
111 // Launch a 0-indexed shelf item in the shelf. 109 // Launch a 0-indexed shelf item in the shelf.
112 // A negative index launches the last shelf item in the shelf. 110 // A negative index launches the last shelf item in the shelf.
113 void LaunchAppIndexAt(int item_index); 111 void LaunchAppIndexAt(int item_index);
114 112
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 144
147 ShelfAlignment alignment_ = SHELF_ALIGNMENT_BOTTOM; 145 ShelfAlignment alignment_ = SHELF_ALIGNMENT_BOTTOM;
148 ShelfAutoHideBehavior auto_hide_behavior_ = SHELF_AUTO_HIDE_BEHAVIOR_NEVER; 146 ShelfAutoHideBehavior auto_hide_behavior_ = SHELF_AUTO_HIDE_BEHAVIOR_NEVER;
149 147
150 DISALLOW_COPY_AND_ASSIGN(Shelf); 148 DISALLOW_COPY_AND_ASSIGN(Shelf);
151 }; 149 };
152 150
153 } // namespace ash 151 } // namespace ash
154 152
155 #endif // ASH_SHELF_SHELF_H_ 153 #endif // ASH_SHELF_SHELF_H_
OLDNEW
« no previous file with comments | « ash/root_window_controller.cc ('k') | ash/shelf/shelf.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698