| 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_LAUNCHER_LAUNCHER_H_ | 5 #ifndef ASH_LAUNCHER_LAUNCHER_H_ |
| 6 #define ASH_LAUNCHER_LAUNCHER_H_ | 6 #define ASH_LAUNCHER_LAUNCHER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "ash/ash_export.h" | 11 #include "ash/ash_export.h" |
| 12 | 12 |
| 13 namespace aura { | 13 namespace aura { |
| 14 class Window; | 14 class Window; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace gfx { |
| 18 class Rect; |
| 19 } |
| 20 |
| 17 namespace views { | 21 namespace views { |
| 18 class Widget; | 22 class Widget; |
| 19 } | 23 } |
| 20 | 24 |
| 21 namespace ash { | 25 namespace ash { |
| 22 | 26 |
| 23 namespace internal { | 27 namespace internal { |
| 24 class FocusCycler; | 28 class FocusCycler; |
| 29 class LauncherView; |
| 25 } | 30 } |
| 26 | 31 |
| 27 class LauncherDelegate; | 32 class LauncherDelegate; |
| 28 class LauncherModel; | 33 class LauncherModel; |
| 29 | 34 |
| 30 class ASH_EXPORT Launcher { | 35 class ASH_EXPORT Launcher { |
| 31 public: | 36 public: |
| 32 explicit Launcher(aura::Window* window_container); | 37 explicit Launcher(aura::Window* window_container); |
| 33 ~Launcher(); | 38 ~Launcher(); |
| 34 | 39 |
| 35 // Sets the focus cycler. | 40 // Sets the focus cycler. |
| 36 void SetFocusCycler(const internal::FocusCycler* focus_cycler); | 41 void SetFocusCycler(const internal::FocusCycler* focus_cycler); |
| 37 | 42 |
| 38 // Sets the width of the status area. | 43 // Sets the width of the status area. |
| 39 void SetStatusWidth(int width); | 44 void SetStatusWidth(int width); |
| 40 int GetStatusWidth(); | 45 int GetStatusWidth(); |
| 41 | 46 |
| 47 // Returns the screen bounds of the item for the specified window. If there is |
| 48 // no item for the specified window an empty rect is returned. |
| 49 gfx::Rect GetScreenBoundsOfItemIconForWindow(aura::Window* window); |
| 50 |
| 42 LauncherDelegate* delegate() { return delegate_.get(); } | 51 LauncherDelegate* delegate() { return delegate_.get(); } |
| 43 | 52 |
| 44 LauncherModel* model() { return model_.get(); } | 53 LauncherModel* model() { return model_.get(); } |
| 45 views::Widget* widget() { return widget_.get(); } | 54 views::Widget* widget() { return widget_.get(); } |
| 46 | 55 |
| 47 aura::Window* window_container() { return window_container_; } | 56 aura::Window* window_container() { return window_container_; } |
| 48 | 57 |
| 49 private: | 58 private: |
| 50 class DelegateView; | 59 class DelegateView; |
| 51 | 60 |
| 52 // If necessary asks the delegate if an entry should be created in the | |
| 53 // launcher for |window|. This only asks the delegate once for a window. | |
| 54 void MaybeAdd(aura::Window* window); | |
| 55 | |
| 56 scoped_ptr<LauncherModel> model_; | 61 scoped_ptr<LauncherModel> model_; |
| 57 | 62 |
| 58 // Widget hosting the view. | 63 // Widget hosting the view. |
| 59 scoped_ptr<views::Widget> widget_; | 64 scoped_ptr<views::Widget> widget_; |
| 60 | 65 |
| 61 aura::Window* window_container_; | 66 aura::Window* window_container_; |
| 62 | 67 |
| 63 // Contents view of the widget. Houses the LauncherView. | 68 // Contents view of the widget. Houses the LauncherView. |
| 64 DelegateView* delegate_view_; | 69 DelegateView* delegate_view_; |
| 65 | 70 |
| 71 internal::LauncherView* launcher_view_; |
| 72 |
| 66 scoped_ptr<LauncherDelegate> delegate_; | 73 scoped_ptr<LauncherDelegate> delegate_; |
| 67 | 74 |
| 68 DISALLOW_COPY_AND_ASSIGN(Launcher); | 75 DISALLOW_COPY_AND_ASSIGN(Launcher); |
| 69 }; | 76 }; |
| 70 | 77 |
| 71 } // namespace ash | 78 } // namespace ash |
| 72 | 79 |
| 73 #endif // ASH_LAUNCHER_LAUNCHER_H_ | 80 #endif // ASH_LAUNCHER_LAUNCHER_H_ |
| OLD | NEW |