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

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

Issue 2679333002: [ash-md] Remove the number of animators used for the Shelf animations. (Closed)
Patch Set: Addressed review comments and updated ShelfBackgroundAnimator::animator_ lifetime. Created 3 years, 10 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_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 gfx {
24 enum class AnimationChangeType;
25 }
26
23 namespace ash { 27 namespace ash {
24 class AppListButton; 28 class AppListButton;
25 class FocusCycler; 29 class FocusCycler;
26 class ShelfLayoutManager; 30 class ShelfLayoutManager;
27 class ShelfView; 31 class ShelfView;
28 class StatusAreaWidget; 32 class StatusAreaWidget;
29 class WmShelf; 33 class WmShelf;
30 class WmWindow; 34 class WmWindow;
31 35
32 // The ShelfWidget manages the shelf view (which contains the shelf icons) and 36 // 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 37 // the status area widget. There is one ShelfWidget per display. It is created
34 // early during RootWindowController initialization. 38 // early during RootWindowController initialization.
35 class ASH_EXPORT ShelfWidget : public views::Widget, 39 class ASH_EXPORT ShelfWidget : public views::Widget,
36 public views::WidgetObserver, 40 public views::WidgetObserver,
37 public ShelfBackgroundAnimatorObserver, 41 public ShelfBackgroundAnimatorObserver,
38 public ShelfLayoutManagerObserver { 42 public ShelfLayoutManagerObserver {
39 public: 43 public:
40 ShelfWidget(WmWindow* shelf_container, WmShelf* wm_shelf); 44 ShelfWidget(WmWindow* shelf_container, WmShelf* wm_shelf);
41 ~ShelfWidget() override; 45 ~ShelfWidget() override;
42 46
43 void CreateStatusAreaWidget(WmWindow* status_container); 47 void CreateStatusAreaWidget(WmWindow* status_container);
44 48
45 void OnShelfAlignmentChanged(); 49 void OnShelfAlignmentChanged();
46 50
47 // Sets the shelf's background type. 51 // Sets the shelf's background type.
48 void SetPaintsBackground(ShelfBackgroundType background_type, 52 void SetPaintsBackground(ShelfBackgroundType background_type,
49 BackgroundAnimatorChangeType change_type); 53 gfx::AnimationChangeType change_type);
50 ShelfBackgroundType GetBackgroundType() const; 54 ShelfBackgroundType GetBackgroundType() const;
51 55
52 // Hide the shelf behind a black bar during e.g. a user transition when |hide| 56 // 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. 57 // is true. The |animation_time_ms| will be used as animation duration.
54 void HideShelfBehindBlackBar(bool hide, int animation_time_ms); 58 void HideShelfBehindBlackBar(bool hide, int animation_time_ms);
55 bool IsShelfHiddenBehindBlackBar() const; 59 bool IsShelfHiddenBehindBlackBar() const;
56 60
57 ShelfLayoutManager* shelf_layout_manager() { return shelf_layout_manager_; } 61 ShelfLayoutManager* shelf_layout_manager() { return shelf_layout_manager_; }
58 StatusAreaWidget* status_area_widget() const { return status_area_widget_; } 62 StatusAreaWidget* status_area_widget() const { return status_area_widget_; }
59 63
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 ShelfView* shelf_view_; 124 ShelfView* shelf_view_;
121 ShelfBackgroundAnimator background_animator_; 125 ShelfBackgroundAnimator background_animator_;
122 bool activating_as_fallback_; 126 bool activating_as_fallback_;
123 127
124 DISALLOW_COPY_AND_ASSIGN(ShelfWidget); 128 DISALLOW_COPY_AND_ASSIGN(ShelfWidget);
125 }; 129 };
126 130
127 } // namespace ash 131 } // namespace ash
128 132
129 #endif // ASH_COMMON_SHELF_SHELF_WIDGET_H_ 133 #endif // ASH_COMMON_SHELF_SHELF_WIDGET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698