OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_WIDGET_H_ | 5 #ifndef ASH_COMMON_SHELF_SHELF_WIDGET_H_ |
6 #define ASH_COMMON_SHELF_SHELF_WIDGET_H_ | 6 #define ASH_COMMON_SHELF_SHELF_WIDGET_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
11 #include "ash/common/shelf/shelf_background_animator.h" | 11 #include "ash/common/shelf/shelf_background_animator.h" |
12 #include "ash/common/shelf/shelf_background_animator_observer.h" | 12 #include "ash/common/shelf/shelf_background_animator_observer.h" |
13 #include "ash/common/shelf/shelf_layout_manager_observer.h" | 13 #include "ash/common/shelf/shelf_layout_manager_observer.h" |
14 #include "ash/common/shelf/shelf_types.h" | 14 #include "ash/common/shelf/shelf_types.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "ui/views/widget/widget.h" | 16 #include "ui/views/widget/widget.h" |
17 #include "ui/views/widget/widget_observer.h" | 17 #include "ui/views/widget/widget_observer.h" |
18 | 18 |
19 namespace app_list { | 19 namespace app_list { |
20 class ApplicationDragAndDropHost; | 20 class ApplicationDragAndDropHost; |
21 } | 21 } |
22 | 22 |
23 namespace ash { | 23 namespace ash { |
24 class AppListButton; | 24 class AppListButton; |
25 class FocusCycler; | 25 class FocusCycler; |
26 class Shelf; | |
27 class ShelfLayoutManager; | 26 class ShelfLayoutManager; |
28 class ShelfView; | 27 class ShelfView; |
29 class StatusAreaWidget; | 28 class StatusAreaWidget; |
30 class WmShelf; | 29 class WmShelf; |
31 class WmWindow; | 30 class WmWindow; |
32 | 31 |
33 class ASH_EXPORT ShelfWidget : public views::Widget, | 32 class ASH_EXPORT ShelfWidget : public views::Widget, |
34 public views::WidgetObserver, | 33 public views::WidgetObserver, |
35 public ShelfBackgroundAnimatorObserver, | 34 public ShelfBackgroundAnimatorObserver, |
36 public ShelfLayoutManagerObserver { | 35 public ShelfLayoutManagerObserver { |
(...skipping 19 matching lines...) Expand all Loading... |
56 | 55 |
57 // Hide the shelf behind a black bar during e.g. a user transition when |hide| | 56 // Hide the shelf behind a black bar during e.g. a user transition when |hide| |
58 // is true. The |animation_time_ms| will be used as animation duration. | 57 // is true. The |animation_time_ms| will be used as animation duration. |
59 void HideShelfBehindBlackBar(bool hide, int animation_time_ms); | 58 void HideShelfBehindBlackBar(bool hide, int animation_time_ms); |
60 bool IsShelfHiddenBehindBlackBar() const; | 59 bool IsShelfHiddenBehindBlackBar() const; |
61 | 60 |
62 // Causes shelf items to be slightly dimmed (e.g. when a window is maximized). | 61 // Causes shelf items to be slightly dimmed (e.g. when a window is maximized). |
63 void SetDimsShelf(bool dimming); | 62 void SetDimsShelf(bool dimming); |
64 bool GetDimsShelf() const; | 63 bool GetDimsShelf() const; |
65 | 64 |
66 // TODO(jamescook): Eliminate these. | |
67 Shelf* shelf() { return shelf_; } | |
68 void set_shelf(Shelf* shelf) { shelf_ = shelf; } | |
69 | |
70 ShelfLayoutManager* shelf_layout_manager() { return shelf_layout_manager_; } | 65 ShelfLayoutManager* shelf_layout_manager() { return shelf_layout_manager_; } |
71 StatusAreaWidget* status_area_widget() const { return status_area_widget_; } | 66 StatusAreaWidget* status_area_widget() const { return status_area_widget_; } |
72 | 67 |
73 ShelfView* CreateShelfView(); | 68 ShelfView* CreateShelfView(); |
74 void PostCreateShelf(); | 69 void PostCreateShelf(); |
75 | 70 |
76 // Set visibility of the shelf. | 71 // Set visibility of the shelf. |
77 void SetShelfVisibility(bool visible); | 72 void SetShelfVisibility(bool visible); |
78 bool IsShelfVisible() const; | 73 bool IsShelfVisible() const; |
79 | 74 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 void WillDeleteShelfLayoutManager() override; | 123 void WillDeleteShelfLayoutManager() override; |
129 | 124 |
130 private: | 125 private: |
131 class DelegateView; | 126 class DelegateView; |
132 friend class DelegateView; | 127 friend class DelegateView; |
133 | 128 |
134 WmShelf* wm_shelf_; | 129 WmShelf* wm_shelf_; |
135 | 130 |
136 // Owned by the shelf container's window. | 131 // Owned by the shelf container's window. |
137 ShelfLayoutManager* shelf_layout_manager_; | 132 ShelfLayoutManager* shelf_layout_manager_; |
138 // Owned by the root window controller. | |
139 Shelf* shelf_; | |
140 StatusAreaWidget* status_area_widget_; | 133 StatusAreaWidget* status_area_widget_; |
141 | 134 |
142 // |delegate_view_| is the contents view of this widget and is cleaned up | 135 // |delegate_view_| is the contents view of this widget and is cleaned up |
143 // during CloseChildWindows of the associated RootWindowController. | 136 // during CloseChildWindows of the associated RootWindowController. |
144 DelegateView* delegate_view_; | 137 DelegateView* delegate_view_; |
145 // View containing the shelf items. Owned by the views hierarchy. | 138 // View containing the shelf items. Owned by the views hierarchy. |
146 ShelfView* shelf_view_; | 139 ShelfView* shelf_view_; |
147 ShelfBackgroundAnimator background_animator_; | 140 ShelfBackgroundAnimator background_animator_; |
148 bool activating_as_fallback_; | 141 bool activating_as_fallback_; |
149 | 142 |
150 DISALLOW_COPY_AND_ASSIGN(ShelfWidget); | 143 DISALLOW_COPY_AND_ASSIGN(ShelfWidget); |
151 }; | 144 }; |
152 | 145 |
153 } // namespace ash | 146 } // namespace ash |
154 | 147 |
155 #endif // ASH_COMMON_SHELF_SHELF_WIDGET_H_ | 148 #endif // ASH_COMMON_SHELF_SHELF_WIDGET_H_ |
OLD | NEW |