| 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 <stdint.h> |
| 9 |
| 8 #include <memory> | 10 #include <memory> |
| 9 | 11 |
| 10 #include "ash/ash_export.h" | 12 #include "ash/ash_export.h" |
| 11 #include "ash/shelf/shelf_constants.h" | 13 #include "ash/shelf/shelf_constants.h" |
| 12 #include "ash/shelf/shelf_locking_manager.h" | 14 #include "ash/shelf/shelf_locking_manager.h" |
| 13 #include "ash/shelf/shelf_types.h" | 15 #include "ash/shelf/shelf_types.h" |
| 14 #include "ash/shelf/shelf_widget.h" | 16 #include "ash/shelf/shelf_widget.h" |
| 15 #include "base/macros.h" | 17 #include "base/macros.h" |
| 16 #include "ui/gfx/geometry/size.h" | 18 #include "ui/gfx/geometry/size.h" |
| 17 #include "ui/views/widget/widget_observer.h" | 19 #include "ui/views/widget/widget_observer.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 // Return the shelf for the primary display. NULL if no user is logged in yet. | 61 // Return the shelf for the primary display. NULL if no user is logged in yet. |
| 60 // Useful for tests. For production code use ForWindow() because the user may | 62 // Useful for tests. For production code use ForWindow() because the user may |
| 61 // have multiple displays. | 63 // have multiple displays. |
| 62 static Shelf* ForPrimaryDisplay(); | 64 static Shelf* ForPrimaryDisplay(); |
| 63 | 65 |
| 64 // Return the shelf for the display that |window| is currently on, or a shelf | 66 // Return the shelf for the display that |window| is currently on, or a shelf |
| 65 // on primary display if the shelf per display feature is disabled. NULL if no | 67 // on primary display if the shelf per display feature is disabled. NULL if no |
| 66 // user is logged in yet. | 68 // user is logged in yet. |
| 67 static Shelf* ForWindow(const aura::Window* window); | 69 static Shelf* ForWindow(const aura::Window* window); |
| 68 | 70 |
| 71 // Returns the shelf for the display with |display_id| or null if that display |
| 72 // does not exist or does not have a shelf. |
| 73 static Shelf* ForDisplayId(int64_t display_id); |
| 74 |
| 69 void SetAlignment(wm::ShelfAlignment alignment); | 75 void SetAlignment(wm::ShelfAlignment alignment); |
| 70 wm::ShelfAlignment alignment() const { return alignment_; } | 76 wm::ShelfAlignment alignment() const { return alignment_; } |
| 71 bool IsHorizontalAlignment() const; | 77 bool IsHorizontalAlignment() const; |
| 72 | 78 |
| 73 // Sets the ShelfAutoHideBehavior. See enum description for details. | 79 // Sets the ShelfAutoHideBehavior. See enum description for details. |
| 74 void SetAutoHideBehavior(ShelfAutoHideBehavior auto_hide_behavior); | 80 void SetAutoHideBehavior(ShelfAutoHideBehavior auto_hide_behavior); |
| 75 ShelfAutoHideBehavior auto_hide_behavior() const { | 81 ShelfAutoHideBehavior auto_hide_behavior() const { |
| 76 return auto_hide_behavior_; | 82 return auto_hide_behavior_; |
| 77 } | 83 } |
| 78 | 84 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 | 169 |
| 164 wm::ShelfAlignment alignment_ = wm::SHELF_ALIGNMENT_BOTTOM; | 170 wm::ShelfAlignment alignment_ = wm::SHELF_ALIGNMENT_BOTTOM; |
| 165 ShelfAutoHideBehavior auto_hide_behavior_ = SHELF_AUTO_HIDE_BEHAVIOR_NEVER; | 171 ShelfAutoHideBehavior auto_hide_behavior_ = SHELF_AUTO_HIDE_BEHAVIOR_NEVER; |
| 166 | 172 |
| 167 DISALLOW_COPY_AND_ASSIGN(Shelf); | 173 DISALLOW_COPY_AND_ASSIGN(Shelf); |
| 168 }; | 174 }; |
| 169 | 175 |
| 170 } // namespace ash | 176 } // namespace ash |
| 171 | 177 |
| 172 #endif // ASH_SHELF_SHELF_H_ | 178 #endif // ASH_SHELF_SHELF_H_ |
| OLD | NEW |