OLD | NEW |
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 Loading... |
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 Loading... |
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_ |
OLD | NEW |