| 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 "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "ash/shelf/background_animator.h" | 9 #include "ash/shelf/background_animator.h" |
| 10 #include "ash/shelf/shelf_layout_manager_observer.h" | 10 #include "ash/shelf/shelf_layout_manager_observer.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 class StatusAreaWidget; | 23 class StatusAreaWidget; |
| 24 class WorkspaceController; | 24 class WorkspaceController; |
| 25 | 25 |
| 26 class ASH_EXPORT ShelfWidget : public views::Widget, | 26 class ASH_EXPORT ShelfWidget : public views::Widget, |
| 27 public views::WidgetObserver, | 27 public views::WidgetObserver, |
| 28 public ShelfLayoutManagerObserver { | 28 public ShelfLayoutManagerObserver { |
| 29 public: | 29 public: |
| 30 ShelfWidget(aura::Window* shelf_container, | 30 ShelfWidget(aura::Window* shelf_container, |
| 31 aura::Window* status_container, | 31 aura::Window* status_container, |
| 32 WorkspaceController* workspace_controller); | 32 WorkspaceController* workspace_controller); |
| 33 virtual ~ShelfWidget(); | 33 ~ShelfWidget() override; |
| 34 | 34 |
| 35 // Returns if shelf alignment option is enabled, and the user is able | 35 // Returns if shelf alignment option is enabled, and the user is able |
| 36 // to adjust the alignment (guest and supervised mode users cannot for | 36 // to adjust the alignment (guest and supervised mode users cannot for |
| 37 // example). | 37 // example). |
| 38 static bool ShelfAlignmentAllowed(); | 38 static bool ShelfAlignmentAllowed(); |
| 39 | 39 |
| 40 void SetAlignment(ShelfAlignment alignmnet); | 40 void SetAlignment(ShelfAlignment alignmnet); |
| 41 ShelfAlignment GetAlignment() const; | 41 ShelfAlignment GetAlignment() const; |
| 42 | 42 |
| 43 // Sets the shelf's background type. | 43 // Sets the shelf's background type. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 74 | 74 |
| 75 aura::Window* window_container() { return window_container_; } | 75 aura::Window* window_container() { return window_container_; } |
| 76 | 76 |
| 77 // TODO(harrym): Remove when Status Area Widget is a child view. | 77 // TODO(harrym): Remove when Status Area Widget is a child view. |
| 78 void ShutdownStatusAreaWidget(); | 78 void ShutdownStatusAreaWidget(); |
| 79 | 79 |
| 80 // Force the shelf to be presented in an undimmed state. | 80 // Force the shelf to be presented in an undimmed state. |
| 81 void ForceUndimming(bool force); | 81 void ForceUndimming(bool force); |
| 82 | 82 |
| 83 // Overridden from views::WidgetObserver: | 83 // Overridden from views::WidgetObserver: |
| 84 virtual void OnWidgetActivationChanged( | 84 void OnWidgetActivationChanged(views::Widget* widget, bool active) override; |
| 85 views::Widget* widget, bool active) override; | |
| 86 | 85 |
| 87 // A function to test the current alpha used by the dimming bar. If there is | 86 // A function to test the current alpha used by the dimming bar. If there is |
| 88 // no dimmer active, the function will return -1. | 87 // no dimmer active, the function will return -1. |
| 89 int GetDimmingAlphaForTest(); | 88 int GetDimmingAlphaForTest(); |
| 90 | 89 |
| 91 // A function to test the bounds of the dimming bar. Returns gfx::Rect() if | 90 // A function to test the bounds of the dimming bar. Returns gfx::Rect() if |
| 92 // the dimmer is inactive. | 91 // the dimmer is inactive. |
| 93 gfx::Rect GetDimmerBoundsForTest(); | 92 gfx::Rect GetDimmerBoundsForTest(); |
| 94 | 93 |
| 95 // Disable dimming animations for running tests. | 94 // Disable dimming animations for running tests. |
| 96 void DisableDimmingAnimationsForTest(); | 95 void DisableDimmingAnimationsForTest(); |
| 97 | 96 |
| 98 // ShelfLayoutManagerObserver overrides: | 97 // ShelfLayoutManagerObserver overrides: |
| 99 virtual void WillDeleteShelf() override; | 98 void WillDeleteShelf() override; |
| 100 | 99 |
| 101 private: | 100 private: |
| 102 class DelegateView; | 101 class DelegateView; |
| 103 | 102 |
| 104 ShelfLayoutManager* shelf_layout_manager_; | 103 ShelfLayoutManager* shelf_layout_manager_; |
| 105 scoped_ptr<Shelf> shelf_; | 104 scoped_ptr<Shelf> shelf_; |
| 106 StatusAreaWidget* status_area_widget_; | 105 StatusAreaWidget* status_area_widget_; |
| 107 | 106 |
| 108 // delegate_view_ is attached to window_container_ and is cleaned up | 107 // delegate_view_ is attached to window_container_ and is cleaned up |
| 109 // during CloseChildWindows of the associated RootWindowController. | 108 // during CloseChildWindows of the associated RootWindowController. |
| 110 DelegateView* delegate_view_; | 109 DelegateView* delegate_view_; |
| 111 BackgroundAnimator background_animator_; | 110 BackgroundAnimator background_animator_; |
| 112 bool activating_as_fallback_; | 111 bool activating_as_fallback_; |
| 113 aura::Window* window_container_; | 112 aura::Window* window_container_; |
| 114 }; | 113 }; |
| 115 | 114 |
| 116 } // namespace ash | 115 } // namespace ash |
| 117 | 116 |
| 118 #endif // ASH_SHELF_SHELF_WIDGET_H_ | 117 #endif // ASH_SHELF_SHELF_WIDGET_H_ |
| OLD | NEW |