| 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 enum class AnimationChangeType; |
| 24 class AppListButton; | 25 class AppListButton; |
| 25 class FocusCycler; | 26 class FocusCycler; |
| 26 class ShelfLayoutManager; | 27 class ShelfLayoutManager; |
| 27 class ShelfView; | 28 class ShelfView; |
| 28 class StatusAreaWidget; | 29 class StatusAreaWidget; |
| 29 class WmShelf; | 30 class WmShelf; |
| 30 class WmWindow; | 31 class WmWindow; |
| 31 | 32 |
| 32 // The ShelfWidget manages the shelf view (which contains the shelf icons) and | 33 // 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 | 34 // the status area widget. There is one ShelfWidget per display. It is created |
| 34 // early during RootWindowController initialization. | 35 // early during RootWindowController initialization. |
| 35 class ASH_EXPORT ShelfWidget : public views::Widget, | 36 class ASH_EXPORT ShelfWidget : public views::Widget, |
| 36 public views::WidgetObserver, | 37 public views::WidgetObserver, |
| 37 public ShelfBackgroundAnimatorObserver, | 38 public ShelfBackgroundAnimatorObserver, |
| 38 public ShelfLayoutManagerObserver { | 39 public ShelfLayoutManagerObserver { |
| 39 public: | 40 public: |
| 40 ShelfWidget(WmWindow* shelf_container, WmShelf* wm_shelf); | 41 ShelfWidget(WmWindow* shelf_container, WmShelf* wm_shelf); |
| 41 ~ShelfWidget() override; | 42 ~ShelfWidget() override; |
| 42 | 43 |
| 43 void CreateStatusAreaWidget(WmWindow* status_container); | 44 void CreateStatusAreaWidget(WmWindow* status_container); |
| 44 | 45 |
| 45 void OnShelfAlignmentChanged(); | 46 void OnShelfAlignmentChanged(); |
| 46 | 47 |
| 47 // Sets the shelf's background type. | 48 // Sets the shelf's background type. |
| 48 void SetPaintsBackground(ShelfBackgroundType background_type, | 49 void SetPaintsBackground(ShelfBackgroundType background_type, |
| 49 BackgroundAnimatorChangeType change_type); | 50 AnimationChangeType change_type); |
| 50 ShelfBackgroundType GetBackgroundType() const; | 51 ShelfBackgroundType GetBackgroundType() const; |
| 51 | 52 |
| 52 // 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| |
| 53 // 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. |
| 54 void HideShelfBehindBlackBar(bool hide, int animation_time_ms); | 55 void HideShelfBehindBlackBar(bool hide, int animation_time_ms); |
| 55 bool IsShelfHiddenBehindBlackBar() const; | 56 bool IsShelfHiddenBehindBlackBar() const; |
| 56 | 57 |
| 57 ShelfLayoutManager* shelf_layout_manager() { return shelf_layout_manager_; } | 58 ShelfLayoutManager* shelf_layout_manager() { return shelf_layout_manager_; } |
| 58 StatusAreaWidget* status_area_widget() const { return status_area_widget_; } | 59 StatusAreaWidget* status_area_widget() const { return status_area_widget_; } |
| 59 | 60 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 ShelfView* shelf_view_; | 121 ShelfView* shelf_view_; |
| 121 ShelfBackgroundAnimator background_animator_; | 122 ShelfBackgroundAnimator background_animator_; |
| 122 bool activating_as_fallback_; | 123 bool activating_as_fallback_; |
| 123 | 124 |
| 124 DISALLOW_COPY_AND_ASSIGN(ShelfWidget); | 125 DISALLOW_COPY_AND_ASSIGN(ShelfWidget); |
| 125 }; | 126 }; |
| 126 | 127 |
| 127 } // namespace ash | 128 } // namespace ash |
| 128 | 129 |
| 129 #endif // ASH_COMMON_SHELF_SHELF_WIDGET_H_ | 130 #endif // ASH_COMMON_SHELF_SHELF_WIDGET_H_ |
| OLD | NEW |