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_SHELL_H_ | 5 #ifndef ASH_SHELL_H_ |
6 #define ASH_SHELL_H_ | 6 #define ASH_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 "ash/ash_export.h" | 12 #include "ash/ash_export.h" |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/compiler_specific.h" | 16 #include "base/compiler_specific.h" |
17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
| 18 #include "ui/aura/root_window_observer.h" |
18 | 19 |
19 class CommandLine; | 20 class CommandLine; |
20 | 21 |
21 namespace aura { | 22 namespace aura { |
22 class EventFilter; | 23 class EventFilter; |
23 class RootWindow; | 24 class RootWindow; |
24 class Window; | 25 class Window; |
25 } | 26 } |
26 namespace gfx { | 27 namespace gfx { |
27 class Point; | 28 class Point; |
(...skipping 27 matching lines...) Expand all Loading... |
55 class VisibilityController; | 56 class VisibilityController; |
56 class WindowModalityController; | 57 class WindowModalityController; |
57 class WorkspaceController; | 58 class WorkspaceController; |
58 } | 59 } |
59 | 60 |
60 // Shell is a singleton object that presents the Shell API and implements the | 61 // Shell is a singleton object that presents the Shell API and implements the |
61 // RootWindow's delegate interface. | 62 // RootWindow's delegate interface. |
62 // | 63 // |
63 // Upon creation, the Shell sets itself as the RootWindow's delegate, which | 64 // Upon creation, the Shell sets itself as the RootWindow's delegate, which |
64 // takes ownership of the Shell. | 65 // takes ownership of the Shell. |
65 class ASH_EXPORT Shell { | 66 class ASH_EXPORT Shell : public aura::RootWindowObserver { |
66 public: | 67 public: |
67 // In compact window mode we fill the screen with a single maximized window, | 68 // In compact window mode we fill the screen with a single maximized window, |
68 // similar to ChromeOS R17 and earlier. In overlapping mode we have draggable | 69 // similar to ChromeOS R17 and earlier. In overlapping mode we have draggable |
69 // windows. In managed mode the workspace arranges windows for the user. | 70 // windows. In managed mode the workspace arranges windows for the user. |
70 enum WindowMode { | 71 enum WindowMode { |
71 MODE_COMPACT, | 72 MODE_COMPACT, |
72 MODE_MANAGED, | 73 MODE_MANAGED, |
73 MODE_OVERLAPPING, | 74 MODE_OVERLAPPING, |
74 }; | 75 }; |
75 | 76 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 | 134 |
134 ShellDelegate* delegate() { return delegate_.get(); } | 135 ShellDelegate* delegate() { return delegate_.get(); } |
135 | 136 |
136 Launcher* launcher() { return launcher_.get(); } | 137 Launcher* launcher() { return launcher_.get(); } |
137 | 138 |
138 // Made available for tests. | 139 // Made available for tests. |
139 internal::ShadowController* shadow_controller() { | 140 internal::ShadowController* shadow_controller() { |
140 return shadow_controller_.get(); | 141 return shadow_controller_.get(); |
141 } | 142 } |
142 | 143 |
| 144 // aura::RootWindowObserver overrides: |
| 145 virtual void OnRootWindowResized(const gfx::Size& new_size) OVERRIDE; |
| 146 |
143 private: | 147 private: |
144 FRIEND_TEST_ALL_PREFIXES(ShellTest, ComputeWindowMode); | 148 FRIEND_TEST_ALL_PREFIXES(ShellTest, ComputeWindowMode); |
145 FRIEND_TEST_ALL_PREFIXES(ShellTest, ChangeWindowMode); | 149 FRIEND_TEST_ALL_PREFIXES(ShellTest, ChangeWindowMode); |
146 | 150 |
147 typedef std::pair<aura::Window*, gfx::Rect> WindowAndBoundsPair; | 151 typedef std::pair<aura::Window*, gfx::Rect> WindowAndBoundsPair; |
148 | 152 |
149 explicit Shell(ShellDelegate* delegate); | 153 explicit Shell(ShellDelegate* delegate); |
150 virtual ~Shell(); | 154 virtual ~Shell(); |
151 | 155 |
152 void Init(); | 156 void Init(); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 | 208 |
205 // Status area with clock, Wi-Fi signal, etc. | 209 // Status area with clock, Wi-Fi signal, etc. |
206 views::Widget* status_widget_; | 210 views::Widget* status_widget_; |
207 | 211 |
208 DISALLOW_COPY_AND_ASSIGN(Shell); | 212 DISALLOW_COPY_AND_ASSIGN(Shell); |
209 }; | 213 }; |
210 | 214 |
211 } // namespace ash | 215 } // namespace ash |
212 | 216 |
213 #endif // ASH_SHELL_H_ | 217 #endif // ASH_SHELL_H_ |
OLD | NEW |