| 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_COMMON_SHELF_SHELF_H_ | 5 #ifndef ASH_COMMON_SHELF_SHELF_H_ |
| 6 #define ASH_COMMON_SHELF_SHELF_H_ | 6 #define ASH_COMMON_SHELF_SHELF_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "ash/common/shelf/shelf_widget.h" | 9 #include "ash/common/shelf/shelf_widget.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 | 11 |
| 12 namespace app_list { | |
| 13 class ApplicationDragAndDropHost; | |
| 14 } | |
| 15 | |
| 16 namespace gfx { | 12 namespace gfx { |
| 17 class Rect; | 13 class Rect; |
| 18 } | 14 } |
| 19 | 15 |
| 20 namespace ash { | 16 namespace ash { |
| 21 class AppListButton; | |
| 22 class ShelfView; | 17 class ShelfView; |
| 23 class WmShelf; | 18 class WmShelf; |
| 24 | 19 |
| 25 namespace test { | 20 namespace test { |
| 26 class ShelfTestAPI; | 21 class ShelfTestAPI; |
| 27 } | 22 } |
| 28 | 23 |
| 29 // Controller for shelf state. | 24 // Controller for shelf state. |
| 30 // DEPRECATED: WmShelf is replacing this class as part of the mus/mash refactor. | 25 // DEPRECATED: WmShelf is replacing this class as part of the mus/mash refactor. |
| 31 // Use WmShelf for access to state (visibility, auto-hide, etc.). | 26 // Use WmShelf for access to state (visibility, auto-hide, etc.). |
| 32 class ASH_EXPORT Shelf { | 27 class ASH_EXPORT Shelf { |
| 33 public: | 28 public: |
| 34 Shelf(WmShelf* wm_shelf, ShelfView* shelf_view, ShelfWidget* widget); | 29 Shelf(WmShelf* wm_shelf, ShelfView* shelf_view, ShelfWidget* widget); |
| 35 ~Shelf(); | 30 ~Shelf(); |
| 36 | 31 |
| 37 // Return the shelf for the primary display. NULL if no user is logged in yet. | 32 // Return the shelf for the primary display. NULL if no user is logged in yet. |
| 38 // Useful for tests. For production code use ForWindow() because the user may | 33 // Useful for tests. For production code use ForWindow() because the user may |
| 39 // have multiple displays. | 34 // have multiple displays. |
| 40 static Shelf* ForPrimaryDisplay(); | 35 static Shelf* ForPrimaryDisplay(); |
| 41 | 36 |
| 42 // Return the shelf for the display that |window| is currently on, or a shelf | 37 // Return the shelf for the display that |window| is currently on, or a shelf |
| 43 // on primary display if the shelf per display feature is disabled. NULL if no | 38 // on primary display if the shelf per display feature is disabled. NULL if no |
| 44 // user is logged in yet. | 39 // user is logged in yet. |
| 45 static Shelf* ForWindow(WmWindow* window); | 40 static Shelf* ForWindow(WmWindow* window); |
| 46 | 41 |
| 47 // For porting from Shelf to WmShelf. | 42 // For porting from Shelf to WmShelf. |
| 48 // TODO(jamescook): Remove this. | 43 // TODO(jamescook): Remove this. |
| 49 WmShelf* wm_shelf() { return wm_shelf_; } | 44 WmShelf* wm_shelf() { return wm_shelf_; } |
| 50 | 45 |
| 51 AppListButton* GetAppListButton() const; | |
| 52 | |
| 53 ShelfWidget* shelf_widget() { return shelf_widget_; } | 46 ShelfWidget* shelf_widget() { return shelf_widget_; } |
| 54 | 47 |
| 55 // TODO(msw): ShelfLayoutManager should not be accessed externally. | 48 // TODO(msw): ShelfLayoutManager should not be accessed externally. |
| 56 ShelfLayoutManager* shelf_layout_manager() { | 49 ShelfLayoutManager* shelf_layout_manager() { |
| 57 return shelf_widget_->shelf_layout_manager(); | 50 return shelf_widget_->shelf_layout_manager(); |
| 58 } | 51 } |
| 59 | 52 |
| 60 // Returns ApplicationDragAndDropHost for this shelf. | |
| 61 app_list::ApplicationDragAndDropHost* GetDragAndDropHostForAppList(); | |
| 62 | |
| 63 ShelfView* shelf_view_for_testing() { return shelf_view_; } | 53 ShelfView* shelf_view_for_testing() { return shelf_view_; } |
| 64 | 54 |
| 65 private: | 55 private: |
| 66 friend class test::ShelfTestAPI; | 56 friend class test::ShelfTestAPI; |
| 67 | 57 |
| 68 // The shelf controller. Owned by the root window controller. | 58 // The shelf controller. Owned by the root window controller. |
| 69 WmShelf* wm_shelf_; | 59 WmShelf* wm_shelf_; |
| 70 ShelfWidget* shelf_widget_; | 60 ShelfWidget* shelf_widget_; |
| 71 ShelfView* shelf_view_; | 61 ShelfView* shelf_view_; |
| 72 | 62 |
| 73 DISALLOW_COPY_AND_ASSIGN(Shelf); | 63 DISALLOW_COPY_AND_ASSIGN(Shelf); |
| 74 }; | 64 }; |
| 75 | 65 |
| 76 } // namespace ash | 66 } // namespace ash |
| 77 | 67 |
| 78 #endif // ASH_COMMON_SHELF_SHELF_H_ | 68 #endif // ASH_COMMON_SHELF_SHELF_H_ |
| OLD | NEW |