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

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

Issue 1812013003: Pass shelf instances, not root windows, for ash context menus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Call OnShelfAlignmentChanged after LayoutShelf. Created 4 years, 9 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 "ash/ash_export.h" 8 #include "ash/ash_export.h"
9 #include "ash/shelf/shelf_constants.h" 9 #include "ash/shelf/shelf_constants.h"
10 #include "ash/shelf/shelf_types.h" 10 #include "ash/shelf/shelf_types.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 // Return the shelf for the display that |window| is currently on, or a shelf 54 // Return the shelf for the display that |window| is currently on, or a shelf
55 // on primary display if the shelf per display feature is disabled. NULL if no 55 // on primary display if the shelf per display feature is disabled. NULL if no
56 // user is logged in yet. 56 // user is logged in yet.
57 static Shelf* ForWindow(const aura::Window* window); 57 static Shelf* ForWindow(const aura::Window* window);
58 58
59 void SetAlignment(ShelfAlignment alignment); 59 void SetAlignment(ShelfAlignment alignment);
60 ShelfAlignment alignment() const { return alignment_; } 60 ShelfAlignment alignment() const { return alignment_; }
61 bool IsHorizontalAlignment() const; 61 bool IsHorizontalAlignment() const;
62 62
63 // Sets the ShelfAutoHideBehavior. See enum description for details.
64 void SetAutoHideBehavior(ShelfAutoHideBehavior behavior);
65 ShelfAutoHideBehavior GetAutoHideBehavior() const;
66
63 // A helper functions that chooses values specific to a shelf alignment. 67 // A helper functions that chooses values specific to a shelf alignment.
64 template <typename T> 68 template <typename T>
65 T SelectValueForShelfAlignment(T bottom, T left, T right, T top) const { 69 T SelectValueForShelfAlignment(T bottom, T left, T right, T top) const {
66 switch (alignment_) { 70 switch (alignment_) {
67 case SHELF_ALIGNMENT_BOTTOM: 71 case SHELF_ALIGNMENT_BOTTOM:
68 return bottom; 72 return bottom;
69 case SHELF_ALIGNMENT_LEFT: 73 case SHELF_ALIGNMENT_LEFT:
70 return left; 74 return left;
71 case SHELF_ALIGNMENT_RIGHT: 75 case SHELF_ALIGNMENT_RIGHT:
72 return right; 76 return right;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 ShelfDelegate* delegate_; 146 ShelfDelegate* delegate_;
143 147
144 ShelfWidget* shelf_widget_; 148 ShelfWidget* shelf_widget_;
145 149
146 DISALLOW_COPY_AND_ASSIGN(Shelf); 150 DISALLOW_COPY_AND_ASSIGN(Shelf);
147 }; 151 };
148 152
149 } // namespace ash 153 } // namespace ash
150 154
151 #endif // ASH_SHELF_SHELF_H_ 155 #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