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 EventFilter; | 20 class EventFilter; |
| 21 class RootWindow; |
21 class Window; | 22 class Window; |
22 } | 23 } |
23 namespace gfx { | 24 namespace gfx { |
24 class Rect; | 25 class Rect; |
25 } | 26 } |
26 | 27 |
27 namespace aura_shell { | 28 namespace aura_shell { |
28 | 29 |
29 class Launcher; | 30 class Launcher; |
30 class ShellAcceleratorController; | 31 class ShellAcceleratorController; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 71 |
71 ShellAcceleratorController* accelerator_controller() { | 72 ShellAcceleratorController* accelerator_controller() { |
72 return accelerator_controller_.get(); | 73 return accelerator_controller_.get(); |
73 } | 74 } |
74 | 75 |
75 ShellTooltipManager* tooltip_manager() { | 76 ShellTooltipManager* tooltip_manager() { |
76 return tooltip_manager_.get(); | 77 return tooltip_manager_.get(); |
77 } | 78 } |
78 | 79 |
79 ShellDelegate* delegate() { return delegate_.get(); } | 80 ShellDelegate* delegate() { return delegate_.get(); } |
| 81 |
| 82 // May return NULL if we're not using a launcher (e.g. laptop-mode). |
80 Launcher* launcher() { return launcher_.get(); } | 83 Launcher* launcher() { return launcher_.get(); } |
81 | 84 |
82 // Made available for tests. | 85 // Made available for tests. |
83 internal::ShadowController* shadow_controller() { | 86 internal::ShadowController* shadow_controller() { |
84 return shadow_controller_.get(); | 87 return shadow_controller_.get(); |
85 } | 88 } |
86 | 89 |
87 private: | 90 private: |
88 typedef std::pair<aura::Window*, gfx::Rect> WindowAndBoundsPair; | 91 typedef std::pair<aura::Window*, gfx::Rect> WindowAndBoundsPair; |
89 | 92 |
90 explicit Shell(ShellDelegate* delegate); | 93 explicit Shell(ShellDelegate* delegate); |
91 virtual ~Shell(); | 94 virtual ~Shell(); |
92 | 95 |
93 void Init(); | 96 void Init(); |
| 97 void InitLayoutManagers(aura::RootWindow* root_window); |
94 | 98 |
95 // Enables WorkspaceManager. | 99 // Enables WorkspaceManager. |
96 void EnableWorkspaceManager(); | 100 void EnableWorkspaceManager(); |
97 | 101 |
98 static Shell* instance_; | 102 static Shell* instance_; |
99 | 103 |
100 std::vector<WindowAndBoundsPair> to_restore_; | 104 std::vector<WindowAndBoundsPair> to_restore_; |
101 | 105 |
102 base::WeakPtrFactory<Shell> method_factory_; | 106 base::WeakPtrFactory<Shell> method_factory_; |
103 | 107 |
(...skipping 13 matching lines...) Expand all Loading... |
117 scoped_ptr<internal::ShellAcceleratorFilter> accelerator_filter_; | 121 scoped_ptr<internal::ShellAcceleratorFilter> accelerator_filter_; |
118 | 122 |
119 scoped_ptr<ShellTooltipManager> tooltip_manager_; | 123 scoped_ptr<ShellTooltipManager> tooltip_manager_; |
120 | 124 |
121 DISALLOW_COPY_AND_ASSIGN(Shell); | 125 DISALLOW_COPY_AND_ASSIGN(Shell); |
122 }; | 126 }; |
123 | 127 |
124 } // namespace aura_shell | 128 } // namespace aura_shell |
125 | 129 |
126 #endif // UI_AURA_SHELL_SHELL_H_ | 130 #endif // UI_AURA_SHELL_SHELL_H_ |
OLD | NEW |