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_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 Loading... | |
| 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; | 63 bool IsShelfVisible() const; |
| 67 | 64 |
| 68 bool IsShowingAppList() const; | 65 bool IsShowingAppList() const; |
| 69 bool IsShowingContextMenu() const; | 66 bool IsShowingContextMenu() const; |
| 70 bool IsShowingOverflowBubble() const; | 67 bool IsShowingOverflowBubble() const; |
| 71 | 68 |
| 72 // Sets the focus cycler. Also adds the shelf to the cycle. | 69 // Sets the focus cycler. Also adds the shelf to the cycle. |
| 73 void SetFocusCycler(FocusCycler* focus_cycler); | 70 void SetFocusCycler(FocusCycler* focus_cycler); |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 94 | 91 |
| 95 // Overridden from views::WidgetObserver: | 92 // Overridden from views::WidgetObserver: |
| 96 void OnWidgetActivationChanged(views::Widget* widget, bool active) override; | 93 void OnWidgetActivationChanged(views::Widget* widget, bool active) override; |
| 97 | 94 |
| 98 // ShelfBackgroundAnimatorObserver overrides: | 95 // ShelfBackgroundAnimatorObserver overrides: |
| 99 void UpdateShelfItemBackground(SkColor color) override; | 96 void UpdateShelfItemBackground(SkColor color) override; |
| 100 | 97 |
| 101 // ShelfLayoutManagerObserver overrides: | 98 // ShelfLayoutManagerObserver overrides: |
| 102 void WillDeleteShelfLayoutManager() override; | 99 void WillDeleteShelfLayoutManager() override; |
| 103 | 100 |
| 101 // Internal implementation detail. Do not expose outside of tests. | |
| 102 ShelfView* shelf_view_for_testing() { return shelf_view_; } | |
|
msw
2017/05/16 22:42:00
nit: const?
James Cook
2017/05/17 16:16:12
Done.
| |
| 103 | |
| 104 private: | 104 private: |
| 105 class DelegateView; | 105 class DelegateView; |
| 106 friend class DelegateView; | 106 friend class DelegateView; |
| 107 | 107 |
| 108 WmShelf* wm_shelf_; | 108 WmShelf* wm_shelf_; |
| 109 | 109 |
| 110 // Owned by the shelf container's window. | 110 // Owned by the shelf container's window. |
| 111 ShelfLayoutManager* shelf_layout_manager_; | 111 ShelfLayoutManager* shelf_layout_manager_; |
| 112 | 112 |
| 113 // Owned by the native widget. | 113 // Owned by the native widget. |
| 114 StatusAreaWidget* status_area_widget_; | 114 StatusAreaWidget* status_area_widget_; |
| 115 | 115 |
| 116 // |delegate_view_| is the contents view of this widget and is cleaned up | 116 // |delegate_view_| is the contents view of this widget and is cleaned up |
| 117 // during CloseChildWindows of the associated RootWindowController. | 117 // during CloseChildWindows of the associated RootWindowController. |
| 118 DelegateView* delegate_view_; | 118 DelegateView* delegate_view_; |
| 119 // View containing the shelf items. Owned by the views hierarchy. Null when | 119 // View containing the shelf items. Owned by the views hierarchy. |
| 120 // at the login screen. | 120 ShelfView* const shelf_view_; |
|
James Cook
2017/05/16 21:32:35
This "const" is basically the whole point of this
msw
2017/05/16 22:42:00
Acknowledged.
| |
| 121 ShelfView* shelf_view_; | |
| 122 ShelfBackgroundAnimator background_animator_; | 121 ShelfBackgroundAnimator background_animator_; |
| 123 bool activating_as_fallback_; | 122 bool activating_as_fallback_; |
| 124 | 123 |
| 125 DISALLOW_COPY_AND_ASSIGN(ShelfWidget); | 124 DISALLOW_COPY_AND_ASSIGN(ShelfWidget); |
| 126 }; | 125 }; |
| 127 | 126 |
| 128 } // namespace ash | 127 } // namespace ash |
| 129 | 128 |
| 130 #endif // ASH_SHELF_SHELF_WIDGET_H_ | 129 #endif // ASH_SHELF_SHELF_WIDGET_H_ |
| OLD | NEW |