| 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> |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 namespace aura { | 22 namespace aura { |
| 23 class EventFilter; | 23 class EventFilter; |
| 24 class RootWindow; | 24 class RootWindow; |
| 25 class Window; | 25 class Window; |
| 26 } | 26 } |
| 27 namespace gfx { | 27 namespace gfx { |
| 28 class Point; | 28 class Point; |
| 29 class Rect; | 29 class Rect; |
| 30 } | 30 } |
| 31 namespace ui { |
| 32 class Layer; |
| 33 } |
| 31 namespace views { | 34 namespace views { |
| 32 class NonClientFrameView; | 35 class NonClientFrameView; |
| 33 class Widget; | 36 class Widget; |
| 34 } | 37 } |
| 35 | 38 |
| 36 namespace ash { | 39 namespace ash { |
| 37 | 40 |
| 38 class AcceleratorController; | 41 class AcceleratorController; |
| 39 class Launcher; | 42 class Launcher; |
| 40 class NestedDispatcherController; | 43 class NestedDispatcherController; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 71 public: | 74 public: |
| 72 // In compact window mode we fill the screen with a single maximized window, | 75 // In compact window mode we fill the screen with a single maximized window, |
| 73 // similar to ChromeOS R17 and earlier. In overlapping mode we have draggable | 76 // similar to ChromeOS R17 and earlier. In overlapping mode we have draggable |
| 74 // windows. In managed mode the workspace arranges windows for the user. | 77 // windows. In managed mode the workspace arranges windows for the user. |
| 75 enum WindowMode { | 78 enum WindowMode { |
| 76 MODE_COMPACT, | 79 MODE_COMPACT, |
| 77 MODE_MANAGED, | 80 MODE_MANAGED, |
| 78 MODE_OVERLAPPING, | 81 MODE_OVERLAPPING, |
| 79 }; | 82 }; |
| 80 | 83 |
| 84 enum BackgroundMode { |
| 85 BACKGROUND_IMAGE, |
| 86 BACKGROUND_SOLID_COLOR |
| 87 }; |
| 88 |
| 81 enum Direction { | 89 enum Direction { |
| 82 FORWARD, | 90 FORWARD, |
| 83 BACKWARD | 91 BACKWARD |
| 84 }; | 92 }; |
| 85 | 93 |
| 86 // A shell must be explicitly created so that it can call |Init()| with the | 94 // A shell must be explicitly created so that it can call |Init()| with the |
| 87 // delegate set. |delegate| can be NULL (if not required for initialization). | 95 // delegate set. |delegate| can be NULL (if not required for initialization). |
| 88 static Shell* CreateInstance(ShellDelegate* delegate); | 96 static Shell* CreateInstance(ShellDelegate* delegate); |
| 89 | 97 |
| 90 // Should never be called before |CreateInstance()|. | 98 // Should never be called before |CreateInstance()|. |
| 91 static Shell* GetInstance(); | 99 static Shell* GetInstance(); |
| 92 | 100 |
| 93 static void DeleteInstance(); | 101 static void DeleteInstance(); |
| 94 | 102 |
| 95 const gfx::Size& compact_status_area_offset() const { | 103 const gfx::Size& compact_status_area_offset() const { |
| 96 return compact_status_area_offset_; | 104 return compact_status_area_offset_; |
| 97 } | 105 } |
| 98 | 106 |
| 107 BackgroundMode desktop_background_mode() const { |
| 108 return desktop_background_mode_; |
| 109 } |
| 110 |
| 99 aura::Window* GetContainer(int container_id); | 111 aura::Window* GetContainer(int container_id); |
| 100 const aura::Window* GetContainer(int container_id) const; | 112 const aura::Window* GetContainer(int container_id) const; |
| 101 | 113 |
| 102 // Adds or removes |filter| from the RootWindowEventFilter. | 114 // Adds or removes |filter| from the RootWindowEventFilter. |
| 103 void AddRootWindowEventFilter(aura::EventFilter* filter); | 115 void AddRootWindowEventFilter(aura::EventFilter* filter); |
| 104 void RemoveRootWindowEventFilter(aura::EventFilter* filter); | 116 void RemoveRootWindowEventFilter(aura::EventFilter* filter); |
| 105 size_t GetRootWindowEventFilterCount() const; | 117 size_t GetRootWindowEventFilterCount() const; |
| 106 | 118 |
| 107 // Shows the background menu over |widget|. | 119 // Shows the background menu over |widget|. |
| 108 void ShowBackgroundMenu(views::Widget* widget, const gfx::Point& location); | 120 void ShowBackgroundMenu(views::Widget* widget, const gfx::Point& location); |
| 109 | 121 |
| 110 // Toggles app list. | 122 // Toggles app list. |
| 111 void ToggleAppList(); | 123 void ToggleAppList(); |
| 112 | 124 |
| 113 // Dynamic window mode chooses between MODE_OVERLAPPING and MODE_COMPACT | 125 // Dynamic window mode chooses between MODE_OVERLAPPING and MODE_COMPACT |
| 114 // based on screen resolution and dynamically changes modes when the screen | 126 // based on screen resolution and dynamically changes modes when the screen |
| 115 // resolution changes (e.g. plugging in a monitor). | 127 // resolution changes (e.g. plugging in a monitor). |
| 116 void set_dynamic_window_mode(bool value) { dynamic_window_mode_ = value; } | 128 void set_dynamic_window_mode(bool value) { dynamic_window_mode_ = value; } |
| 117 | 129 |
| 118 // Changes the current window mode, which will cause all the open windows | 130 // Changes the current window mode, which will cause all the open windows |
| 119 // to be laid out in the new mode and layout managers and event filters to be | 131 // to be laid out in the new mode and layout managers and event filters to be |
| 120 // installed or removed. | 132 // installed or removed. |
| 121 void ChangeWindowMode(WindowMode mode); | 133 void ChangeWindowMode(WindowMode mode); |
| 122 | 134 |
| 123 // Sets an appropriate window mode for the given screen resolution. | 135 // Sets an appropriate window mode for the given screen resolution. |
| 124 void SetWindowModeForMonitorSize(const gfx::Size& monitor_size); | 136 void SetWindowModeForMonitorSize(const gfx::Size& monitor_size); |
| 125 | 137 |
| 138 // Sets the desktop background mode. |
| 139 void SetDesktopBackgroundMode(BackgroundMode mode); |
| 140 |
| 126 // Returns true if the screen is locked. | 141 // Returns true if the screen is locked. |
| 127 bool IsScreenLocked() const; | 142 bool IsScreenLocked() const; |
| 128 | 143 |
| 129 // Returns true if a modal dialog window is currently open. | 144 // Returns true if a modal dialog window is currently open. |
| 130 bool IsModalWindowOpen() const; | 145 bool IsModalWindowOpen() const; |
| 131 | 146 |
| 132 // See enum WindowMode for details. | 147 // See enum WindowMode for details. |
| 133 bool IsWindowModeCompact() const { return window_mode_ == MODE_COMPACT; } | 148 bool IsWindowModeCompact() const { return window_mode_ == MODE_COMPACT; } |
| 134 | 149 |
| 135 // Sets the offset between the corner of the status area and the corner of the | 150 // Sets the offset between the corner of the status area and the corner of the |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 // mode. Shell does not own the shelf. Instead, it is owned by container of | 269 // mode. Shell does not own the shelf. Instead, it is owned by container of |
| 255 // the status area. | 270 // the status area. |
| 256 internal::ShelfLayoutManager* shelf_; | 271 internal::ShelfLayoutManager* shelf_; |
| 257 | 272 |
| 258 // Change window mode based on screen resolution. | 273 // Change window mode based on screen resolution. |
| 259 bool dynamic_window_mode_; | 274 bool dynamic_window_mode_; |
| 260 | 275 |
| 261 // Can change at runtime. | 276 // Can change at runtime. |
| 262 WindowMode window_mode_; | 277 WindowMode window_mode_; |
| 263 | 278 |
| 279 // Can change at runtime. |
| 280 BackgroundMode desktop_background_mode_; |
| 281 |
| 264 // Owned by aura::RootWindow, cached here for type safety. | 282 // Owned by aura::RootWindow, cached here for type safety. |
| 265 internal::RootWindowLayoutManager* root_window_layout_; | 283 internal::RootWindowLayoutManager* root_window_layout_; |
| 266 | 284 |
| 267 // Status area with clock, Wi-Fi signal, etc. | 285 // Status area with clock, Wi-Fi signal, etc. |
| 268 views::Widget* status_widget_; | 286 views::Widget* status_widget_; |
| 269 | 287 |
| 270 // Offset between the corner of the status area and the corner of the screen | 288 // Offset between the corner of the status area and the corner of the screen |
| 271 // when in the compact window mode. | 289 // when in the compact window mode. |
| 272 gfx::Size compact_status_area_offset_; | 290 gfx::Size compact_status_area_offset_; |
| 273 | 291 |
| 274 DISALLOW_COPY_AND_ASSIGN(Shell); | 292 DISALLOW_COPY_AND_ASSIGN(Shell); |
| 275 }; | 293 }; |
| 276 | 294 |
| 277 } // namespace ash | 295 } // namespace ash |
| 278 | 296 |
| 279 #endif // ASH_SHELL_H_ | 297 #endif // ASH_SHELL_H_ |
| OLD | NEW |