Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_COMMON_SHELF_WM_SHELF_H_ | 5 #ifndef ASH_COMMON_SHELF_WM_SHELF_H_ |
| 6 #define ASH_COMMON_SHELF_WM_SHELF_H_ | 6 #define ASH_COMMON_SHELF_WM_SHELF_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "ash/common/shelf/shelf_types.h" | 9 #include "ash/common/shelf/shelf_types.h" |
| 10 | 10 |
| 11 namespace gfx { | 11 namespace gfx { |
| 12 class Rect; | 12 class Rect; |
| 13 } | 13 } |
| 14 | 14 |
| 15 namespace ui { | 15 namespace ui { |
| 16 class GestureEvent; | 16 class GestureEvent; |
| 17 class MouseEvent; | 17 class MouseEvent; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace ash { | 20 namespace ash { |
| 21 | 21 |
| 22 class WmShelfObserver; | 22 class WmShelfObserver; |
| 23 class WmWindow; | 23 class WmWindow; |
| 24 | 24 |
| 25 // Used for accessing global state. | 25 // Used for accessing global state. |
| 26 class ASH_EXPORT WmShelf { | 26 class ASH_EXPORT WmShelf { |
| 27 public: | 27 public: |
| 28 // Returns the shelf for the primary display. Useful in tests that only use | |
| 29 // a single display. In production code use WmRootWindowController::GetShelf() | |
| 30 // with the appropriate display's root window controller. | |
| 31 static WmShelf* ForPrimaryDisplay(); | |
|
msw
2016/06/25 00:18:29
q: would you like to make this ForTesting?
(based
James Cook
2016/06/25 01:20:58
As discussed offline, eliminated this in favor of
| |
| 32 | |
| 28 // Returns the window showing the shelf. | 33 // Returns the window showing the shelf. |
| 29 virtual WmWindow* GetWindow() = 0; | 34 virtual WmWindow* GetWindow() = 0; |
| 30 | 35 |
| 31 virtual ShelfAlignment GetAlignment() const = 0; | 36 virtual ShelfAlignment GetAlignment() const = 0; |
| 32 virtual void SetAlignment(ShelfAlignment alignment) = 0; | 37 virtual void SetAlignment(ShelfAlignment alignment) = 0; |
| 33 | 38 |
| 34 virtual ShelfAutoHideBehavior GetAutoHideBehavior() const = 0; | 39 virtual ShelfAutoHideBehavior GetAutoHideBehavior() const = 0; |
| 35 virtual void SetAutoHideBehavior(ShelfAutoHideBehavior behavior) = 0; | 40 virtual void SetAutoHideBehavior(ShelfAutoHideBehavior behavior) = 0; |
| 36 | 41 |
| 37 virtual ShelfAutoHideState GetAutoHideState() const = 0; | 42 virtual ShelfAutoHideState GetAutoHideState() const = 0; |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 64 // no item for the specified window an empty rect is returned. | 69 // no item for the specified window an empty rect is returned. |
| 65 virtual gfx::Rect GetScreenBoundsOfItemIconForWindow(WmWindow* window) = 0; | 70 virtual gfx::Rect GetScreenBoundsOfItemIconForWindow(WmWindow* window) = 0; |
| 66 | 71 |
| 67 // TODO(jamescook): Nuke when ash_sysui is removed. http://crbug.com/621112 | 72 // TODO(jamescook): Nuke when ash_sysui is removed. http://crbug.com/621112 |
| 68 virtual void UpdateAutoHideForMouseEvent(ui::MouseEvent* event) = 0; | 73 virtual void UpdateAutoHideForMouseEvent(ui::MouseEvent* event) = 0; |
| 69 virtual void UpdateAutoHideForGestureEvent(ui::GestureEvent* event) = 0; | 74 virtual void UpdateAutoHideForGestureEvent(ui::GestureEvent* event) = 0; |
| 70 | 75 |
| 71 virtual void AddObserver(WmShelfObserver* observer) = 0; | 76 virtual void AddObserver(WmShelfObserver* observer) = 0; |
| 72 virtual void RemoveObserver(WmShelfObserver* observer) = 0; | 77 virtual void RemoveObserver(WmShelfObserver* observer) = 0; |
| 73 | 78 |
| 79 // Simulates a virtual keyboard bounds update. | |
| 80 virtual void SetKeyboardBoundsForTesting(const gfx::Rect& bounds) = 0; | |
| 81 | |
| 74 protected: | 82 protected: |
| 75 virtual ~WmShelf() {} | 83 virtual ~WmShelf() {} |
| 76 }; | 84 }; |
| 77 | 85 |
| 78 } // namespace ash | 86 } // namespace ash |
| 79 | 87 |
| 80 #endif // ASH_COMMON_SHELF_WM_SHELF_H_ | 88 #endif // ASH_COMMON_SHELF_WM_SHELF_H_ |
| OLD | NEW |