Chromium Code Reviews| 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/public/cpp/shelf_types.h" | 14 #include "ash/public/cpp/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 ShelfLayoutManager; | 26 class ShelfLayoutManager; |
| 27 class ShelfView; | 27 class ShelfView; |
| 28 class SmsObserver; | |
| 28 class StatusAreaWidget; | 29 class StatusAreaWidget; |
| 29 class WmShelf; | 30 class WmShelf; |
| 30 class WmWindow; | 31 class WmWindow; |
| 31 | 32 |
| 33 namespace test { | |
| 34 class SmsObserverTest; | |
| 35 } | |
| 36 | |
| 32 // The ShelfWidget manages the shelf view (which contains the shelf icons) and | 37 // The ShelfWidget manages the shelf view (which contains the shelf icons) and |
| 33 // the status area widget. There is one ShelfWidget per display. It is created | 38 // the status area widget. There is one ShelfWidget per display. It is created |
| 34 // early during RootWindowController initialization. | 39 // early during RootWindowController initialization. |
| 35 class ASH_EXPORT ShelfWidget : public views::Widget, | 40 class ASH_EXPORT ShelfWidget : public views::Widget, |
| 36 public views::WidgetObserver, | 41 public views::WidgetObserver, |
| 37 public ShelfBackgroundAnimatorObserver, | 42 public ShelfBackgroundAnimatorObserver, |
| 38 public ShelfLayoutManagerObserver { | 43 public ShelfLayoutManagerObserver { |
| 39 public: | 44 public: |
| 40 ShelfWidget(WmWindow* shelf_container, WmShelf* wm_shelf); | 45 ShelfWidget(WmWindow* shelf_container, WmShelf* wm_shelf); |
| 41 ~ShelfWidget() override; | 46 ~ShelfWidget() override; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 99 | 104 |
| 100 // ShelfBackgroundAnimatorObserver overrides: | 105 // ShelfBackgroundAnimatorObserver overrides: |
| 101 void UpdateShelfItemBackground(int alpha) override; | 106 void UpdateShelfItemBackground(int alpha) override; |
| 102 | 107 |
| 103 // ShelfLayoutManagerObserver overrides: | 108 // ShelfLayoutManagerObserver overrides: |
| 104 void WillDeleteShelfLayoutManager() override; | 109 void WillDeleteShelfLayoutManager() override; |
| 105 | 110 |
| 106 private: | 111 private: |
| 107 class DelegateView; | 112 class DelegateView; |
| 108 friend class DelegateView; | 113 friend class DelegateView; |
| 114 friend class ash::test::SmsObserverTest; | |
| 109 | 115 |
| 110 WmShelf* wm_shelf_; | 116 WmShelf* wm_shelf_; |
| 111 | 117 |
| 112 // Owned by the shelf container's window. | 118 // Owned by the shelf container's window. |
| 113 ShelfLayoutManager* shelf_layout_manager_; | 119 ShelfLayoutManager* shelf_layout_manager_; |
| 114 | 120 |
| 115 // Owned by the native widget. | 121 // Owned by the native widget. |
| 116 StatusAreaWidget* status_area_widget_; | 122 StatusAreaWidget* status_area_widget_; |
| 117 | 123 |
| 118 // |delegate_view_| is the contents view of this widget and is cleaned up | 124 // |delegate_view_| is the contents view of this widget and is cleaned up |
| 119 // during CloseChildWindows of the associated RootWindowController. | 125 // during CloseChildWindows of the associated RootWindowController. |
| 120 DelegateView* delegate_view_; | 126 DelegateView* delegate_view_; |
| 121 // View containing the shelf items. Owned by the views hierarchy. Null when | 127 // View containing the shelf items. Owned by the views hierarchy. Null when |
| 122 // at the login screen. | 128 // at the login screen. |
| 123 ShelfView* shelf_view_; | 129 ShelfView* shelf_view_; |
| 124 ShelfBackgroundAnimator background_animator_; | 130 ShelfBackgroundAnimator background_animator_; |
| 131 SmsObserver* sms_observer_; | |
|
tdanderson
2017/01/26 22:19:06
Who owns |sms_observer_|? (Should the owner be She
yiyix
2017/02/02 20:43:55
I think the owner is ShelfWidget as well.
tdanderson
2017/02/07 00:15:45
Great, thanks for clarifying.
| |
| 125 bool activating_as_fallback_; | 132 bool activating_as_fallback_; |
| 126 | 133 |
| 127 DISALLOW_COPY_AND_ASSIGN(ShelfWidget); | 134 DISALLOW_COPY_AND_ASSIGN(ShelfWidget); |
| 128 }; | 135 }; |
| 129 | 136 |
| 130 } // namespace ash | 137 } // namespace ash |
| 131 | 138 |
| 132 #endif // ASH_COMMON_SHELF_SHELF_WIDGET_H_ | 139 #endif // ASH_COMMON_SHELF_SHELF_WIDGET_H_ |
| OLD | NEW |