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" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // Sets the shelf's background type. | 47 // Sets the shelf's background type. |
48 void SetPaintsBackground(ShelfBackgroundType background_type, | 48 void SetPaintsBackground(ShelfBackgroundType background_type, |
49 BackgroundAnimatorChangeType change_type); | 49 BackgroundAnimatorChangeType change_type); |
50 ShelfBackgroundType GetBackgroundType() const; | 50 ShelfBackgroundType GetBackgroundType() const; |
51 | 51 |
52 // Hide the shelf behind a black bar during e.g. a user transition when |hide| | 52 // Hide the shelf behind a black bar during e.g. a user transition when |hide| |
53 // is true. The |animation_time_ms| will be used as animation duration. | 53 // is true. The |animation_time_ms| will be used as animation duration. |
54 void HideShelfBehindBlackBar(bool hide, int animation_time_ms); | 54 void HideShelfBehindBlackBar(bool hide, int animation_time_ms); |
55 bool IsShelfHiddenBehindBlackBar() const; | 55 bool IsShelfHiddenBehindBlackBar() const; |
56 | 56 |
57 // Causes shelf items to be slightly dimmed (e.g. when a window is maximized). | |
58 void SetDimsShelf(bool dimming); | |
59 bool GetDimsShelf() const; | |
60 | |
61 ShelfLayoutManager* shelf_layout_manager() { return shelf_layout_manager_; } | 57 ShelfLayoutManager* shelf_layout_manager() { return shelf_layout_manager_; } |
62 StatusAreaWidget* status_area_widget() const { return status_area_widget_; } | 58 StatusAreaWidget* status_area_widget() const { return status_area_widget_; } |
63 | 59 |
64 ShelfView* CreateShelfView(); | 60 ShelfView* CreateShelfView(); |
65 void PostCreateShelf(); | 61 void PostCreateShelf(); |
66 | 62 |
67 // Set visibility of the shelf. | 63 // Set visibility of the shelf. |
68 void SetShelfVisibility(bool visible); | 64 void SetShelfVisibility(bool visible); |
69 bool IsShelfVisible() const; | 65 bool IsShelfVisible() const; |
70 | 66 |
71 bool IsShowingAppList() const; | 67 bool IsShowingAppList() const; |
72 bool IsShowingContextMenu() const; | 68 bool IsShowingContextMenu() const; |
73 bool IsShowingOverflowBubble() const; | 69 bool IsShowingOverflowBubble() const; |
74 | 70 |
75 // Sets the focus cycler. Also adds the shelf to the cycle. | 71 // Sets the focus cycler. Also adds the shelf to the cycle. |
76 void SetFocusCycler(FocusCycler* focus_cycler); | 72 void SetFocusCycler(FocusCycler* focus_cycler); |
77 FocusCycler* GetFocusCycler(); | 73 FocusCycler* GetFocusCycler(); |
78 | 74 |
79 // Called by the activation delegate, before the shelf is activated | 75 // Called by the activation delegate, before the shelf is activated |
80 // when no other windows are visible. | 76 // when no other windows are visible. |
81 void WillActivateAsFallback() { activating_as_fallback_ = true; } | 77 void WillActivateAsFallback() { activating_as_fallback_ = true; } |
82 | 78 |
83 // Clean up prior to deletion. | 79 // Clean up prior to deletion. |
84 void Shutdown(); | 80 void Shutdown(); |
85 | 81 |
86 // Force the shelf to be presented in an undimmed state. | |
87 void ForceUndimming(bool force); | |
88 | |
89 // See WmShelf::UpdateIconPositionForPanel(). | 82 // See WmShelf::UpdateIconPositionForPanel(). |
90 void UpdateIconPositionForPanel(WmWindow* panel); | 83 void UpdateIconPositionForPanel(WmWindow* panel); |
91 | 84 |
92 // See WmShelf::GetScreenBoundsOfItemIconForWindow(). | 85 // See WmShelf::GetScreenBoundsOfItemIconForWindow(). |
93 gfx::Rect GetScreenBoundsOfItemIconForWindow(WmWindow* window); | 86 gfx::Rect GetScreenBoundsOfItemIconForWindow(WmWindow* window); |
94 | 87 |
95 // Returns the button that opens the app launcher. | 88 // Returns the button that opens the app launcher. |
96 AppListButton* GetAppListButton() const; | 89 AppListButton* GetAppListButton() const; |
97 | 90 |
98 // Returns the ApplicationDragAndDropHost for this shelf. | 91 // Returns the ApplicationDragAndDropHost for this shelf. |
99 app_list::ApplicationDragAndDropHost* GetDragAndDropHostForAppList(); | 92 app_list::ApplicationDragAndDropHost* GetDragAndDropHostForAppList(); |
100 | 93 |
101 // Overridden from views::WidgetObserver: | 94 // Overridden from views::WidgetObserver: |
102 void OnWidgetActivationChanged(views::Widget* widget, bool active) override; | 95 void OnWidgetActivationChanged(views::Widget* widget, bool active) override; |
103 | 96 |
104 // A function to test the current alpha used by the dimming bar. If there is | |
105 // no dimmer active, the function will return -1. | |
106 int GetDimmingAlphaForTest(); | |
107 | |
108 // A function to test the bounds of the dimming bar. Returns gfx::Rect() if | |
109 // the dimmer is inactive. | |
110 gfx::Rect GetDimmerBoundsForTest(); | |
111 | |
112 // Disable dimming animations for running tests. | |
113 void DisableDimmingAnimationsForTest(); | |
114 | |
115 // ShelfBackgroundAnimatorObserver overrides: | 97 // ShelfBackgroundAnimatorObserver overrides: |
116 void UpdateShelfItemBackground(int alpha) override; | 98 void UpdateShelfItemBackground(int alpha) override; |
117 | 99 |
118 // ShelfLayoutManagerObserver overrides: | 100 // ShelfLayoutManagerObserver overrides: |
119 void WillDeleteShelfLayoutManager() override; | 101 void WillDeleteShelfLayoutManager() override; |
120 | 102 |
121 private: | 103 private: |
122 class DelegateView; | 104 class DelegateView; |
123 friend class DelegateView; | 105 friend class DelegateView; |
124 | 106 |
(...skipping 12 matching lines...) Expand all Loading... |
137 ShelfView* shelf_view_; | 119 ShelfView* shelf_view_; |
138 ShelfBackgroundAnimator background_animator_; | 120 ShelfBackgroundAnimator background_animator_; |
139 bool activating_as_fallback_; | 121 bool activating_as_fallback_; |
140 | 122 |
141 DISALLOW_COPY_AND_ASSIGN(ShelfWidget); | 123 DISALLOW_COPY_AND_ASSIGN(ShelfWidget); |
142 }; | 124 }; |
143 | 125 |
144 } // namespace ash | 126 } // namespace ash |
145 | 127 |
146 #endif // ASH_COMMON_SHELF_SHELF_WIDGET_H_ | 128 #endif // ASH_COMMON_SHELF_SHELF_WIDGET_H_ |
OLD | NEW |