| 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> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 | 11 |
| 12 #include "ash/ash_export.h" | 12 #include "ash/ash_export.h" |
| 13 #include "ash/common/shelf/shelf_constants.h" | 13 #include "ash/common/shelf/shelf_constants.h" |
| 14 #include "ash/common/shelf/shelf_locking_manager.h" | 14 #include "ash/common/shelf/shelf_locking_manager.h" |
| 15 #include "ash/common/shelf/shelf_types.h" | 15 #include "ash/common/shelf/shelf_types.h" |
| 16 #include "ash/shelf/shelf_widget.h" | 16 #include "ash/shelf/shelf_widget.h" |
| 17 #include "base/macros.h" | 17 #include "base/macros.h" |
| 18 #include "ui/gfx/geometry/size.h" | 18 #include "ui/gfx/geometry/size.h" |
| 19 #include "ui/views/widget/widget_observer.h" | 19 #include "ui/views/widget/widget_observer.h" |
| 20 | 20 |
| 21 namespace app_list { | 21 namespace app_list { |
| 22 class ApplicationDragAndDropHost; | 22 class ApplicationDragAndDropHost; |
| 23 } | 23 } |
| 24 | 24 |
| 25 namespace aura { | |
| 26 class Window; | |
| 27 } | |
| 28 | |
| 29 namespace gfx { | 25 namespace gfx { |
| 30 class Rect; | 26 class Rect; |
| 31 } | 27 } |
| 32 | 28 |
| 33 namespace views { | 29 namespace views { |
| 34 class View; | 30 class View; |
| 35 } | 31 } |
| 36 | 32 |
| 37 namespace ash { | 33 namespace ash { |
| 38 class AppListButton; | 34 class AppListButton; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 59 ~Shelf(); | 55 ~Shelf(); |
| 60 | 56 |
| 61 // Return the shelf for the primary display. NULL if no user is logged in yet. | 57 // Return the shelf for the primary display. NULL if no user is logged in yet. |
| 62 // Useful for tests. For production code use ForWindow() because the user may | 58 // Useful for tests. For production code use ForWindow() because the user may |
| 63 // have multiple displays. | 59 // have multiple displays. |
| 64 static Shelf* ForPrimaryDisplay(); | 60 static Shelf* ForPrimaryDisplay(); |
| 65 | 61 |
| 66 // Return the shelf for the display that |window| is currently on, or a shelf | 62 // Return the shelf for the display that |window| is currently on, or a shelf |
| 67 // on primary display if the shelf per display feature is disabled. NULL if no | 63 // on primary display if the shelf per display feature is disabled. NULL if no |
| 68 // user is logged in yet. | 64 // user is logged in yet. |
| 69 static Shelf* ForWindow(const aura::Window* window); | 65 static Shelf* ForWindow(const WmWindow* window); |
| 70 | 66 |
| 71 void SetAlignment(ShelfAlignment alignment); | 67 void SetAlignment(ShelfAlignment alignment); |
| 72 ShelfAlignment alignment() const { return alignment_; } | 68 ShelfAlignment alignment() const { return alignment_; } |
| 73 | 69 |
| 74 // Sets the ShelfAutoHideBehavior. See enum description for details. | 70 // Sets the ShelfAutoHideBehavior. See enum description for details. |
| 75 void SetAutoHideBehavior(ShelfAutoHideBehavior auto_hide_behavior); | 71 void SetAutoHideBehavior(ShelfAutoHideBehavior auto_hide_behavior); |
| 76 ShelfAutoHideBehavior auto_hide_behavior() const { | 72 ShelfAutoHideBehavior auto_hide_behavior() const { |
| 77 return auto_hide_behavior_; | 73 return auto_hide_behavior_; |
| 78 } | 74 } |
| 79 | 75 |
| 80 ShelfAutoHideState GetAutoHideState() const; | 76 ShelfAutoHideState GetAutoHideState() const; |
| 81 | 77 |
| 82 ShelfVisibilityState GetVisibilityState() const; | 78 ShelfVisibilityState GetVisibilityState() const; |
| 83 | 79 |
| 84 // Returns the screen bounds of the item for the specified window. If there is | 80 // Returns the screen bounds of the item for the specified window. If there is |
| 85 // no item for the specified window an empty rect is returned. | 81 // no item for the specified window an empty rect is returned. |
| 86 gfx::Rect GetScreenBoundsOfItemIconForWindow(const aura::Window* window); | 82 gfx::Rect GetScreenBoundsOfItemIconForWindow(WmWindow* window); |
| 87 | 83 |
| 88 // Updates the icon position given the current window bounds. This is used | 84 // Updates the icon position given the current window bounds. This is used |
| 89 // when dragging panels to reposition them with respect to the other panels. | 85 // when dragging panels to reposition them with respect to the other panels. |
| 90 void UpdateIconPositionForWindow(aura::Window* window); | 86 void UpdateIconPositionForWindow(WmWindow* window); |
| 91 | 87 |
| 92 // Activates the the shelf item specified by the index in the list of shelf | 88 // Activates the the shelf item specified by the index in the list of shelf |
| 93 // items. | 89 // items. |
| 94 void ActivateShelfItem(int index); | 90 void ActivateShelfItem(int index); |
| 95 | 91 |
| 96 // Cycles the window focus linearly over the current shelf items. | 92 // Cycles the window focus linearly over the current shelf items. |
| 97 void CycleWindowLinear(CycleDirection direction); | 93 void CycleWindowLinear(CycleDirection direction); |
| 98 | 94 |
| 99 void AddIconObserver(ShelfIconObserver* observer); | 95 void AddIconObserver(ShelfIconObserver* observer); |
| 100 void RemoveIconObserver(ShelfIconObserver* observer); | 96 void RemoveIconObserver(ShelfIconObserver* observer); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 | 146 |
| 151 ShelfAlignment alignment_ = SHELF_ALIGNMENT_BOTTOM; | 147 ShelfAlignment alignment_ = SHELF_ALIGNMENT_BOTTOM; |
| 152 ShelfAutoHideBehavior auto_hide_behavior_ = SHELF_AUTO_HIDE_BEHAVIOR_NEVER; | 148 ShelfAutoHideBehavior auto_hide_behavior_ = SHELF_AUTO_HIDE_BEHAVIOR_NEVER; |
| 153 | 149 |
| 154 DISALLOW_COPY_AND_ASSIGN(Shelf); | 150 DISALLOW_COPY_AND_ASSIGN(Shelf); |
| 155 }; | 151 }; |
| 156 | 152 |
| 157 } // namespace ash | 153 } // namespace ash |
| 158 | 154 |
| 159 #endif // ASH_SHELF_SHELF_H_ | 155 #endif // ASH_SHELF_SHELF_H_ |
| OLD | NEW |