OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 UI_AURA_SHELL_SHELL_H_ | 5 #ifndef UI_AURA_SHELL_SHELL_H_ |
6 #define UI_AURA_SHELL_SHELL_H_ | 6 #define UI_AURA_SHELL_SHELL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/task.h" | 14 #include "base/task.h" |
15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
17 #include "ui/aura_shell/aura_shell_export.h" | 17 #include "ui/aura_shell/aura_shell_export.h" |
18 | 18 |
19 namespace aura { | 19 namespace aura { |
20 class Window; | 20 class Window; |
21 } | 21 } |
22 namespace gfx { | 22 namespace gfx { |
23 class Rect; | 23 class Rect; |
24 } | 24 } |
| 25 namespace ui { |
| 26 class AcceleratorManager; |
| 27 } |
25 | 28 |
26 namespace aura_shell { | 29 namespace aura_shell { |
27 | 30 |
28 class Launcher; | 31 class Launcher; |
29 class ShellDelegate; | 32 class ShellDelegate; |
30 | 33 |
31 namespace internal { | 34 namespace internal { |
32 class ShelfLayoutController; | 35 class ShelfLayoutController; |
33 class WorkspaceController; | 36 class WorkspaceController; |
34 } | 37 } |
(...skipping 16 matching lines...) Expand all Loading... |
51 | 54 |
52 aura::Window* GetContainer(int container_id); | 55 aura::Window* GetContainer(int container_id); |
53 const aura::Window* GetContainer(int container_id) const; | 56 const aura::Window* GetContainer(int container_id) const; |
54 | 57 |
55 // Toggles between overview mode and normal mode. | 58 // Toggles between overview mode and normal mode. |
56 void ToggleOverview(); | 59 void ToggleOverview(); |
57 | 60 |
58 ShellDelegate* delegate() { return delegate_.get(); } | 61 ShellDelegate* delegate() { return delegate_.get(); } |
59 Launcher* launcher() { return launcher_.get(); } | 62 Launcher* launcher() { return launcher_.get(); } |
60 | 63 |
| 64 // Returns the AcceleratorManager that managers global keyboard shortcuts. |
| 65 ui::AcceleratorManager* accelerator_manager() { |
| 66 return accelerator_manager_.get(); |
| 67 } |
| 68 |
61 private: | 69 private: |
62 typedef std::pair<aura::Window*, gfx::Rect> WindowAndBoundsPair; | 70 typedef std::pair<aura::Window*, gfx::Rect> WindowAndBoundsPair; |
63 | 71 |
64 explicit Shell(ShellDelegate* delegate); | 72 explicit Shell(ShellDelegate* delegate); |
65 virtual ~Shell(); | 73 virtual ~Shell(); |
66 | 74 |
67 void Init(); | 75 void Init(); |
68 | 76 |
69 // Enables WorkspaceManager. | 77 // Enables WorkspaceManager. |
70 void EnableWorkspaceManager(); | 78 void EnableWorkspaceManager(); |
71 | 79 |
72 static Shell* instance_; | 80 static Shell* instance_; |
73 | 81 |
74 std::vector<WindowAndBoundsPair> to_restore_; | 82 std::vector<WindowAndBoundsPair> to_restore_; |
75 | 83 |
76 base::WeakPtrFactory<Shell> method_factory_; | 84 base::WeakPtrFactory<Shell> method_factory_; |
77 | 85 |
78 scoped_ptr<ShellDelegate> delegate_; | 86 scoped_ptr<ShellDelegate> delegate_; |
79 | 87 |
80 scoped_ptr<Launcher> launcher_; | 88 scoped_ptr<Launcher> launcher_; |
81 | 89 |
82 scoped_ptr<internal::WorkspaceController> workspace_controller_; | 90 scoped_ptr<internal::WorkspaceController> workspace_controller_; |
83 scoped_ptr<internal::ShelfLayoutController> shelf_layout_controller_; | 91 scoped_ptr<internal::ShelfLayoutController> shelf_layout_controller_; |
84 | 92 |
| 93 scoped_ptr<ui::AcceleratorManager> accelerator_manager_; |
| 94 |
85 DISALLOW_COPY_AND_ASSIGN(Shell); | 95 DISALLOW_COPY_AND_ASSIGN(Shell); |
86 }; | 96 }; |
87 | 97 |
88 } // namespace aura_shell | 98 } // namespace aura_shell |
89 | 99 |
90 #endif // UI_AURA_SHELL_SHELL_H_ | 100 #endif // UI_AURA_SHELL_SHELL_H_ |
OLD | NEW |