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