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

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

Issue 2889673002: chromeos: Refactor shelf to create ShelfView earlier in startup (Closed)
Patch Set: rebase Created 3 years, 7 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
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_SHELF_SHELF_WIDGET_H_ 5 #ifndef ASH_SHELF_SHELF_WIDGET_H_
6 #define ASH_SHELF_SHELF_WIDGET_H_ 6 #define ASH_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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 ShelfBackgroundType GetBackgroundType() const; 51 ShelfBackgroundType GetBackgroundType() const;
52 52
53 // Hide the shelf behind a black bar during e.g. a user transition when |hide| 53 // Hide the shelf behind a black bar during e.g. a user transition when |hide|
54 // is true. The |animation_time_ms| will be used as animation duration. 54 // is true. The |animation_time_ms| will be used as animation duration.
55 void HideShelfBehindBlackBar(bool hide, int animation_time_ms); 55 void HideShelfBehindBlackBar(bool hide, int animation_time_ms);
56 bool IsShelfHiddenBehindBlackBar() const; 56 bool IsShelfHiddenBehindBlackBar() const;
57 57
58 ShelfLayoutManager* shelf_layout_manager() { return shelf_layout_manager_; } 58 ShelfLayoutManager* shelf_layout_manager() { return shelf_layout_manager_; }
59 StatusAreaWidget* status_area_widget() const { return status_area_widget_; } 59 StatusAreaWidget* status_area_widget() const { return status_area_widget_; }
60 60
61 // Creates the shelf view and populates it with icons. Called after the user
62 // session is active (and hence the user profile is available).
63 ShelfView* CreateShelfView();
64 void PostCreateShelf(); 61 void PostCreateShelf();
65 62
66 bool IsShelfVisible() const;
67
68 bool IsShowingAppList() const; 63 bool IsShowingAppList() const;
69 bool IsShowingContextMenu() const; 64 bool IsShowingContextMenu() const;
70 bool IsShowingOverflowBubble() const; 65 bool IsShowingOverflowBubble() const;
71 66
72 // Sets the focus cycler. Also adds the shelf to the cycle. 67 // Sets the focus cycler. Also adds the shelf to the cycle.
73 void SetFocusCycler(FocusCycler* focus_cycler); 68 void SetFocusCycler(FocusCycler* focus_cycler);
74 FocusCycler* GetFocusCycler(); 69 FocusCycler* GetFocusCycler();
75 70
76 // Called by the activation delegate, before the shelf is activated 71 // Called by the activation delegate, before the shelf is activated
77 // when no other windows are visible. 72 // when no other windows are visible.
(...skipping 16 matching lines...) Expand all
94 89
95 // Overridden from views::WidgetObserver: 90 // Overridden from views::WidgetObserver:
96 void OnWidgetActivationChanged(views::Widget* widget, bool active) override; 91 void OnWidgetActivationChanged(views::Widget* widget, bool active) override;
97 92
98 // ShelfBackgroundAnimatorObserver overrides: 93 // ShelfBackgroundAnimatorObserver overrides:
99 void UpdateShelfItemBackground(SkColor color) override; 94 void UpdateShelfItemBackground(SkColor color) override;
100 95
101 // ShelfLayoutManagerObserver overrides: 96 // ShelfLayoutManagerObserver overrides:
102 void WillDeleteShelfLayoutManager() override; 97 void WillDeleteShelfLayoutManager() override;
103 98
99 // Internal implementation detail. Do not expose outside of tests.
100 ShelfView* shelf_view_for_testing() const { return shelf_view_; }
101
104 private: 102 private:
105 class DelegateView; 103 class DelegateView;
106 friend class DelegateView; 104 friend class DelegateView;
107 105
108 WmShelf* wm_shelf_; 106 WmShelf* wm_shelf_;
109 107
110 // Owned by the shelf container's window. 108 // Owned by the shelf container's window.
111 ShelfLayoutManager* shelf_layout_manager_; 109 ShelfLayoutManager* shelf_layout_manager_;
112 110
113 // Owned by the native widget. 111 // Owned by the native widget.
114 StatusAreaWidget* status_area_widget_; 112 StatusAreaWidget* status_area_widget_;
115 113
116 // |delegate_view_| is the contents view of this widget and is cleaned up 114 // |delegate_view_| is the contents view of this widget and is cleaned up
117 // during CloseChildWindows of the associated RootWindowController. 115 // during CloseChildWindows of the associated RootWindowController.
118 DelegateView* delegate_view_; 116 DelegateView* delegate_view_;
119 // View containing the shelf items. Owned by the views hierarchy. Null when 117 // View containing the shelf items. Owned by the views hierarchy.
120 // at the login screen. 118 ShelfView* const shelf_view_;
121 ShelfView* shelf_view_;
122 ShelfBackgroundAnimator background_animator_; 119 ShelfBackgroundAnimator background_animator_;
123 bool activating_as_fallback_; 120 bool activating_as_fallback_;
124 121
125 DISALLOW_COPY_AND_ASSIGN(ShelfWidget); 122 DISALLOW_COPY_AND_ASSIGN(ShelfWidget);
126 }; 123 };
127 124
128 } // namespace ash 125 } // namespace ash
129 126
130 #endif // ASH_SHELF_SHELF_WIDGET_H_ 127 #endif // ASH_SHELF_SHELF_WIDGET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698