| 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" |
| 11 #include "ash/shelf/shelf_types.h" | 11 #include "ash/shelf/shelf_types.h" |
| 12 #include "ui/views/widget/widget.h" | 12 #include "ui/views/widget/widget.h" |
| 13 #include "ui/views/widget/widget_observer.h" | 13 #include "ui/views/widget/widget_observer.h" |
| 14 | 14 |
| 15 namespace aura { | 15 namespace aura { |
| 16 class Window; | 16 class Window; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace ash { | 19 namespace ash { |
| 20 class Launcher; | 20 class Shelf; |
| 21 | 21 |
| 22 namespace internal { | 22 namespace internal { |
| 23 class FocusCycler; | 23 class FocusCycler; |
| 24 class StatusAreaWidget; | 24 class StatusAreaWidget; |
| 25 class ShelfLayoutManager; | 25 class ShelfLayoutManager; |
| 26 class WorkspaceController; | 26 class WorkspaceController; |
| 27 } | 27 } |
| 28 | 28 |
| 29 class ASH_EXPORT ShelfWidget : public views::Widget, | 29 class ASH_EXPORT ShelfWidget : public views::Widget, |
| 30 public views::WidgetObserver, | 30 public views::WidgetObserver, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 49 BackgroundAnimatorChangeType change_type); | 49 BackgroundAnimatorChangeType change_type); |
| 50 ShelfBackgroundType GetBackgroundType() const; | 50 ShelfBackgroundType GetBackgroundType() const; |
| 51 | 51 |
| 52 // Causes shelf items to be slightly dimmed (e.g. when a window is maximized). | 52 // Causes shelf items to be slightly dimmed (e.g. when a window is maximized). |
| 53 void SetDimsShelf(bool dimming); | 53 void SetDimsShelf(bool dimming); |
| 54 bool GetDimsShelf() const; | 54 bool GetDimsShelf() const; |
| 55 | 55 |
| 56 internal::ShelfLayoutManager* shelf_layout_manager() { | 56 internal::ShelfLayoutManager* shelf_layout_manager() { |
| 57 return shelf_layout_manager_; | 57 return shelf_layout_manager_; |
| 58 } | 58 } |
| 59 Launcher* launcher() const { return launcher_.get(); } | 59 Shelf* shelf() const { return shelf_.get(); } |
| 60 internal::StatusAreaWidget* status_area_widget() const { | 60 internal::StatusAreaWidget* status_area_widget() const { |
| 61 return status_area_widget_; | 61 return status_area_widget_; |
| 62 } | 62 } |
| 63 | 63 |
| 64 void CreateLauncher(); | 64 void CreateShelf(); |
| 65 | 65 |
| 66 // Set visibility of the launcher component of the shelf. | 66 // Set visibility of the shelf. |
| 67 void SetLauncherVisibility(bool visible); | 67 void SetShelfVisibility(bool visible); |
| 68 bool IsLauncherVisible() const; | 68 bool IsShelfVisible() const; |
| 69 | 69 |
| 70 // Sets the focus cycler. Also adds the launcher to the cycle. | 70 // Sets the focus cycler. Also adds the shelf to the cycle. |
| 71 void SetFocusCycler(internal::FocusCycler* focus_cycler); | 71 void SetFocusCycler(internal::FocusCycler* focus_cycler); |
| 72 internal::FocusCycler* GetFocusCycler(); | 72 internal::FocusCycler* GetFocusCycler(); |
| 73 | 73 |
| 74 // Called by the activation delegate, before the launcher is activated | 74 // Called by the activation delegate, before the shelf is activated |
| 75 // when no other windows are visible. | 75 // when no other windows are visible. |
| 76 void WillActivateAsFallback() { activating_as_fallback_ = true; } | 76 void WillActivateAsFallback() { activating_as_fallback_ = true; } |
| 77 | 77 |
| 78 aura::Window* window_container() { return window_container_; } | 78 aura::Window* window_container() { return window_container_; } |
| 79 | 79 |
| 80 // TODO(harrym): Remove when Status Area Widget is a child view. | 80 // TODO(harrym): Remove when Status Area Widget is a child view. |
| 81 void ShutdownStatusAreaWidget(); | 81 void ShutdownStatusAreaWidget(); |
| 82 | 82 |
| 83 // Force the shelf to be presented in an undimmed state. | 83 // Force the shelf to be presented in an undimmed state. |
| 84 void ForceUndimming(bool force); | 84 void ForceUndimming(bool force); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 98 // Disable dimming animations for running tests. | 98 // Disable dimming animations for running tests. |
| 99 void DisableDimmingAnimationsForTest(); | 99 void DisableDimmingAnimationsForTest(); |
| 100 | 100 |
| 101 // ShelfLayoutManagerObserver overrides: | 101 // ShelfLayoutManagerObserver overrides: |
| 102 virtual void WillDeleteShelf() OVERRIDE; | 102 virtual void WillDeleteShelf() OVERRIDE; |
| 103 | 103 |
| 104 private: | 104 private: |
| 105 class DelegateView; | 105 class DelegateView; |
| 106 | 106 |
| 107 internal::ShelfLayoutManager* shelf_layout_manager_; | 107 internal::ShelfLayoutManager* shelf_layout_manager_; |
| 108 scoped_ptr<Launcher> launcher_; | 108 scoped_ptr<Shelf> shelf_; |
| 109 internal::StatusAreaWidget* status_area_widget_; | 109 internal::StatusAreaWidget* status_area_widget_; |
| 110 | 110 |
| 111 // delegate_view_ is attached to window_container_ and is cleaned up | 111 // delegate_view_ is attached to window_container_ and is cleaned up |
| 112 // during CloseChildWindows of the associated RootWindowController. | 112 // during CloseChildWindows of the associated RootWindowController. |
| 113 DelegateView* delegate_view_; | 113 DelegateView* delegate_view_; |
| 114 internal::BackgroundAnimator background_animator_; | 114 internal::BackgroundAnimator background_animator_; |
| 115 bool activating_as_fallback_; | 115 bool activating_as_fallback_; |
| 116 aura::Window* window_container_; | 116 aura::Window* window_container_; |
| 117 }; | 117 }; |
| 118 | 118 |
| 119 } // namespace ash | 119 } // namespace ash |
| 120 | 120 |
| 121 #endif // ASH_SHELF_SHELF_WIDGET_H_ | 121 #endif // ASH_SHELF_SHELF_WIDGET_H_ |
| OLD | NEW |