Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(844)

Side by Side Diff: ash/common/shelf/shelf_widget.h

Issue 2304443002: ash: Move ShelfWidget ownership to WmShelf and refactor access to it (Closed)
Patch Set: review comments Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/common/accelerators/accelerator_controller.cc ('k') | ash/common/shelf/shelf_widget.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
(...skipping 16 matching lines...) Expand all
27 class ShelfView; 27 class ShelfView;
28 class StatusAreaWidget; 28 class StatusAreaWidget;
29 class WmShelf; 29 class WmShelf;
30 class WmWindow; 30 class WmWindow;
31 31
32 class ASH_EXPORT ShelfWidget : public views::Widget, 32 class ASH_EXPORT ShelfWidget : public views::Widget,
33 public views::WidgetObserver, 33 public views::WidgetObserver,
34 public ShelfBackgroundAnimatorObserver, 34 public ShelfBackgroundAnimatorObserver,
35 public ShelfLayoutManagerObserver { 35 public ShelfLayoutManagerObserver {
36 public: 36 public:
37 ShelfWidget(WmWindow* shelf_container, 37 ShelfWidget(WmWindow* shelf_container, WmShelf* wm_shelf);
38 WmWindow* status_container,
39 WmShelf* wm_shelf);
40 ~ShelfWidget() override; 38 ~ShelfWidget() override;
41 39
40 void CreateStatusAreaWidget(WmWindow* status_container);
41
42 // Returns if shelf alignment option is enabled, and the user is able to 42 // Returns if shelf alignment option is enabled, and the user is able to
43 // adjust the alignment (guest and supervised mode users cannot for example). 43 // adjust the alignment (guest and supervised mode users cannot for example).
44 static bool ShelfAlignmentAllowed(); 44 static bool ShelfAlignmentAllowed();
45 45
46 void OnShelfAlignmentChanged(); 46 void OnShelfAlignmentChanged();
47 47
48 // DEPRECATED: Prefer WmShelf::GetAlignment(). 48 // DEPRECATED: Prefer WmShelf::GetAlignment().
49 ShelfAlignment GetAlignment() const; 49 ShelfAlignment GetAlignment() const;
50 50
51 // Sets the shelf's background type. 51 // Sets the shelf's background type.
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 void WillDeleteShelfLayoutManager() override; 123 void WillDeleteShelfLayoutManager() override;
124 124
125 private: 125 private:
126 class DelegateView; 126 class DelegateView;
127 friend class DelegateView; 127 friend class DelegateView;
128 128
129 WmShelf* wm_shelf_; 129 WmShelf* wm_shelf_;
130 130
131 // Owned by the shelf container's window. 131 // Owned by the shelf container's window.
132 ShelfLayoutManager* shelf_layout_manager_; 132 ShelfLayoutManager* shelf_layout_manager_;
133
134 // Owned by the native widget.
133 StatusAreaWidget* status_area_widget_; 135 StatusAreaWidget* status_area_widget_;
134 136
135 // |delegate_view_| is the contents view of this widget and is cleaned up 137 // |delegate_view_| is the contents view of this widget and is cleaned up
136 // during CloseChildWindows of the associated RootWindowController. 138 // during CloseChildWindows of the associated RootWindowController.
137 DelegateView* delegate_view_; 139 DelegateView* delegate_view_;
138 // View containing the shelf items. Owned by the views hierarchy. 140 // View containing the shelf items. Owned by the views hierarchy.
139 ShelfView* shelf_view_; 141 ShelfView* shelf_view_;
140 ShelfBackgroundAnimator background_animator_; 142 ShelfBackgroundAnimator background_animator_;
141 bool activating_as_fallback_; 143 bool activating_as_fallback_;
142 144
143 DISALLOW_COPY_AND_ASSIGN(ShelfWidget); 145 DISALLOW_COPY_AND_ASSIGN(ShelfWidget);
144 }; 146 };
145 147
146 } // namespace ash 148 } // namespace ash
147 149
148 #endif // ASH_COMMON_SHELF_SHELF_WIDGET_H_ 150 #endif // ASH_COMMON_SHELF_SHELF_WIDGET_H_
OLDNEW
« no previous file with comments | « ash/common/accelerators/accelerator_controller.cc ('k') | ash/common/shelf/shelf_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698