Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef ASH_SHELL_H_ |
| 6 | #define ASH_SHELL_H_ |
| 7 | |
| 8 | #include <utility> |
| 9 | #include <vector> |
| 10 | |
| 11 | #include "ash/ash_export.h" |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 12 | #include "ash/shelf/shelf_types.h" |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 13 | #include "ash/system/user/login_status.h" |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 14 | #include "ash/wm/system_modal_container_event_filter_delegate.h" |
| 15 | #include "base/basictypes.h" |
| 16 | #include "base/compiler_specific.h" |
| 17 | #include "base/gtest_prod_util.h" |
| 18 | #include "base/memory/scoped_ptr.h" |
Torne (Richard Coles) | 1e9bf3e | 2013-10-31 11:16:26 +0000 | [diff] [blame] | 19 | #include "base/memory/weak_ptr.h" |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 20 | #include "base/observer_list.h" |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 21 | #include "ui/aura/client/activation_change_observer.h" |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 22 | #include "ui/base/ui_base_types.h" |
Torne (Richard Coles) | d0247b1 | 2013-09-19 22:36:51 +0100 | [diff] [blame] | 23 | #include "ui/events/event_target.h" |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 24 | #include "ui/gfx/insets.h" |
| 25 | #include "ui/gfx/screen.h" |
| 26 | #include "ui/gfx/size.h" |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 27 | #include "ui/views/corewm/cursor_manager.h" |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 28 | |
| 29 | class CommandLine; |
| 30 | |
Torne (Richard Coles) | 8bcbed8 | 2013-10-22 16:41:35 +0100 | [diff] [blame] | 31 | namespace app_list { |
| 32 | class AppListView; |
| 33 | } |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 34 | namespace aura { |
| 35 | class EventFilter; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 36 | class RootWindow; |
| 37 | class Window; |
| 38 | namespace client { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 39 | class ActivationClient; |
| 40 | class FocusClient; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 41 | class UserActionClient; |
| 42 | } |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 43 | } |
| 44 | namespace chromeos { |
| 45 | class OutputConfigurator; |
| 46 | } |
| 47 | namespace content { |
| 48 | class BrowserContext; |
| 49 | } |
| 50 | |
| 51 | namespace gfx { |
| 52 | class ImageSkia; |
| 53 | class Point; |
| 54 | class Rect; |
| 55 | } |
Torne (Richard Coles) | 4e180b6 | 2013-10-18 15:46:22 +0100 | [diff] [blame] | 56 | |
| 57 | namespace keyboard { |
| 58 | class KeyboardController; |
| 59 | } |
| 60 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 61 | namespace ui { |
| 62 | class Layer; |
| 63 | } |
| 64 | namespace views { |
| 65 | class NonClientFrameView; |
| 66 | class Widget; |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 67 | namespace corewm { |
| 68 | class CompoundEventFilter; |
| 69 | class InputMethodEventFilter; |
| 70 | class ShadowController; |
| 71 | class TooltipController; |
| 72 | class VisibilityController; |
| 73 | class WindowModalityController; |
| 74 | } |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 75 | } |
| 76 | |
| 77 | namespace ash { |
| 78 | |
| 79 | class AcceleratorController; |
Torne (Richard Coles) | 1e9bf3e | 2013-10-31 11:16:26 +0000 | [diff] [blame] | 80 | class AccessibilityDelegate; |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 81 | class AshNativeCursorManager; |
Torne (Richard Coles) | 4e180b6 | 2013-10-18 15:46:22 +0100 | [diff] [blame] | 82 | class AutoclickController; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 83 | class CapsLockDelegate; |
| 84 | class DesktopBackgroundController; |
| 85 | class DisplayController; |
Torne (Richard Coles) | 8bcbed8 | 2013-10-22 16:41:35 +0100 | [diff] [blame] | 86 | class FirstRunHelper; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 87 | class HighContrastController; |
| 88 | class Launcher; |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 89 | class LauncherDelegate; |
Torne (Richard Coles) | 4e180b6 | 2013-10-18 15:46:22 +0100 | [diff] [blame] | 90 | class LauncherItemDelegate; |
Torne (Richard Coles) | 424c4d7 | 2013-08-30 15:14:49 +0100 | [diff] [blame] | 91 | class LauncherItemDelegateManager; |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 92 | class LauncherModel; |
Torne (Richard Coles) | 1e9bf3e | 2013-10-31 11:16:26 +0000 | [diff] [blame] | 93 | class LockStateController; |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 94 | class MagnificationController; |
Torne (Richard Coles) | 0f1bc08 | 2013-11-06 12:27:47 +0000 | [diff] [blame^] | 95 | class MediaDelegate; |
Torne (Richard Coles) | a36e592 | 2013-08-05 13:57:33 +0100 | [diff] [blame] | 96 | class MruWindowTracker; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 97 | class NestedDispatcherController; |
Torne (Richard Coles) | 1e9bf3e | 2013-10-31 11:16:26 +0000 | [diff] [blame] | 98 | class NewWindowDelegate; |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 99 | class PartialMagnificationController; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 100 | class PowerButtonController; |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 101 | class RootWindowHostFactory; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 102 | class ScreenAsh; |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 103 | class SessionStateDelegate; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 104 | class ShellDelegate; |
| 105 | class ShellObserver; |
| 106 | class SystemTray; |
| 107 | class SystemTrayDelegate; |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 108 | class SystemTrayNotifier; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 109 | class UserActivityDetector; |
| 110 | class UserWallpaperDelegate; |
| 111 | class VideoDetector; |
| 112 | class WebNotificationTray; |
| 113 | class WindowCycleController; |
Torne (Richard Coles) | 4e180b6 | 2013-10-18 15:46:22 +0100 | [diff] [blame] | 114 | class WindowPositioner; |
Torne (Richard Coles) | a36e592 | 2013-08-05 13:57:33 +0100 | [diff] [blame] | 115 | class WindowSelectorController; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 116 | |
| 117 | namespace internal { |
| 118 | class AcceleratorFilter; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 119 | class AppListController; |
| 120 | class CaptureController; |
Torne (Richard Coles) | 3551c9c | 2013-08-23 16:39:15 +0100 | [diff] [blame] | 121 | class DisplayChangeObserver; |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 122 | class DisplayErrorObserver; |
| 123 | class DisplayManager; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 124 | class DragDropController; |
| 125 | class EventClientImpl; |
| 126 | class EventRewriterEventFilter; |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 127 | class EventTransformationHandler; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 128 | class FocusCycler; |
Torne (Richard Coles) | 4e180b6 | 2013-10-18 15:46:22 +0100 | [diff] [blame] | 129 | class KeyboardUMAEventFilter; |
Torne (Richard Coles) | a36e592 | 2013-08-05 13:57:33 +0100 | [diff] [blame] | 130 | class LocaleNotificationController; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 131 | class MouseCursorEventFilter; |
| 132 | class OutputConfiguratorAnimation; |
| 133 | class OverlayEventFilter; |
Torne (Richard Coles) | 4e180b6 | 2013-10-18 15:46:22 +0100 | [diff] [blame] | 134 | class PowerEventObserver; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 135 | class ResizeShadowController; |
Ben Murdoch | ba5b9a6 | 2013-08-12 14:20:17 +0100 | [diff] [blame] | 136 | class ResolutionNotificationController; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 137 | class RootWindowController; |
Torne (Richard Coles) | a36e592 | 2013-08-05 13:57:33 +0100 | [diff] [blame] | 138 | class ScopedTargetRootWindow; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 139 | class ScreenPositionController; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 140 | class SlowAnimationEventFilter; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 141 | class StatusAreaWidget; |
| 142 | class SystemGestureEventFilter; |
| 143 | class SystemModalContainerEventFilter; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 144 | class TouchObserverHUD; |
Torne (Richard Coles) | 4e180b6 | 2013-10-18 15:46:22 +0100 | [diff] [blame] | 145 | class UserActivityNotifier; |
| 146 | class VideoActivityNotifier; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 147 | } |
| 148 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 149 | namespace shell { |
| 150 | class WindowWatcher; |
| 151 | } |
| 152 | |
| 153 | namespace test { |
| 154 | class ShellTestApi; |
| 155 | } |
| 156 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 157 | // Shell is a singleton object that presents the Shell API and implements the |
| 158 | // RootWindow's delegate interface. |
| 159 | // |
| 160 | // Upon creation, the Shell sets itself as the RootWindow's delegate, which |
| 161 | // takes ownership of the Shell. |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 162 | class ASH_EXPORT Shell |
| 163 | : public internal::SystemModalContainerEventFilterDelegate, |
| 164 | public ui::EventTarget, |
| 165 | public aura::client::ActivationChangeObserver { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 166 | public: |
| 167 | typedef std::vector<aura::RootWindow*> RootWindowList; |
| 168 | typedef std::vector<internal::RootWindowController*> RootWindowControllerList; |
| 169 | |
| 170 | enum Direction { |
| 171 | FORWARD, |
| 172 | BACKWARD |
| 173 | }; |
| 174 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 175 | // A shell must be explicitly created so that it can call |Init()| with the |
| 176 | // delegate set. |delegate| can be NULL (if not required for initialization). |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 177 | // Takes ownership of |delegate|. |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 178 | static Shell* CreateInstance(ShellDelegate* delegate); |
| 179 | |
| 180 | // Should never be called before |CreateInstance()|. |
| 181 | static Shell* GetInstance(); |
| 182 | |
| 183 | // Returns true if the ash shell has been instantiated. |
| 184 | static bool HasInstance(); |
| 185 | |
| 186 | static void DeleteInstance(); |
| 187 | |
| 188 | // Returns the root window controller for the primary root window. |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 189 | // TODO(oshima): move this to |RootWindowController| |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 190 | static internal::RootWindowController* GetPrimaryRootWindowController(); |
| 191 | |
| 192 | // Returns all root window controllers. |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 193 | // TODO(oshima): move this to |RootWindowController| |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 194 | static RootWindowControllerList GetAllRootWindowControllers(); |
| 195 | |
Torne (Richard Coles) | 1e9bf3e | 2013-10-31 11:16:26 +0000 | [diff] [blame] | 196 | // Returns the primary root Window. The primary root Window is the one that |
| 197 | // has a launcher. |
| 198 | static aura::Window* GetPrimaryRootWindow(); |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 199 | |
Torne (Richard Coles) | 1e9bf3e | 2013-10-31 11:16:26 +0000 | [diff] [blame] | 200 | // Returns a root Window when used as a target when creating a new window. |
Torne (Richard Coles) | a36e592 | 2013-08-05 13:57:33 +0100 | [diff] [blame] | 201 | // The root window of the active window is used in most cases, but can |
| 202 | // be overridden by using ScopedTargetRootWindow(). |
Torne (Richard Coles) | 1e9bf3e | 2013-10-31 11:16:26 +0000 | [diff] [blame] | 203 | // If you want to get the root Window of the active window, just use |
Torne (Richard Coles) | a36e592 | 2013-08-05 13:57:33 +0100 | [diff] [blame] | 204 | // |wm::GetActiveWindow()->GetRootWindow()|. |
Torne (Richard Coles) | 1e9bf3e | 2013-10-31 11:16:26 +0000 | [diff] [blame] | 205 | static aura::Window* GetTargetRootWindow(); |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 206 | |
| 207 | // Returns the global Screen object that's always active in ash. |
| 208 | static gfx::Screen* GetScreen(); |
| 209 | |
| 210 | // Returns all root windows. |
| 211 | static RootWindowList GetAllRootWindows(); |
| 212 | |
Torne (Richard Coles) | 1e9bf3e | 2013-10-31 11:16:26 +0000 | [diff] [blame] | 213 | static aura::Window* GetContainer(aura::Window* root_window, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 214 | int container_id); |
Torne (Richard Coles) | 1e9bf3e | 2013-10-31 11:16:26 +0000 | [diff] [blame] | 215 | static const aura::Window* GetContainer(const aura::Window* root_window, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 216 | int container_id); |
| 217 | |
| 218 | // Returns the list of containers that match |container_id| in |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 219 | // all root windows. If |priority_root| is given, the container |
| 220 | // in the |priority_root| will be inserted at the top of the list. |
| 221 | static std::vector<aura::Window*> GetContainersFromAllRootWindows( |
| 222 | int container_id, |
Torne (Richard Coles) | 1e9bf3e | 2013-10-31 11:16:26 +0000 | [diff] [blame] | 223 | aura::Window* priority_root); |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 224 | |
Torne (Richard Coles) | 1e9bf3e | 2013-10-31 11:16:26 +0000 | [diff] [blame] | 225 | void set_target_root_window(aura::Window* target_root_window) { |
Torne (Richard Coles) | a36e592 | 2013-08-05 13:57:33 +0100 | [diff] [blame] | 226 | target_root_window_ = target_root_window; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 227 | } |
| 228 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 229 | // Shows the context menu for the background and launcher at |
| 230 | // |location_in_screen| (in screen coordinates). |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 231 | void ShowContextMenu(const gfx::Point& location_in_screen, |
| 232 | ui::MenuSourceType source_type); |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 233 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 234 | // Toggles the app list. |window| specifies in which display the app |
| 235 | // list should be shown. If this is NULL, the active root window |
| 236 | // will be used. |
| 237 | void ToggleAppList(aura::Window* anchor); |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 238 | |
| 239 | // Returns app list target visibility. |
| 240 | bool GetAppListTargetVisibility() const; |
| 241 | |
| 242 | // Returns app list window or NULL if it is not visible. |
| 243 | aura::Window* GetAppListWindow(); |
| 244 | |
Torne (Richard Coles) | 8bcbed8 | 2013-10-22 16:41:35 +0100 | [diff] [blame] | 245 | // Returns app list view or NULL if it is not visible. |
| 246 | app_list::AppListView* GetAppListView(); |
| 247 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 248 | // Returns true if a system-modal dialog window is currently open. |
| 249 | bool IsSystemModalWindowOpen() const; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 250 | |
| 251 | // For testing only: set simulation that a modal window is open |
| 252 | void SimulateModalWindowOpenForTesting(bool modal_window_open) { |
| 253 | simulate_modal_window_open_for_testing_ = modal_window_open; |
| 254 | } |
| 255 | |
| 256 | // Creates a default views::NonClientFrameView for use by windows in the |
| 257 | // Ash environment. |
| 258 | views::NonClientFrameView* CreateDefaultNonClientFrameView( |
| 259 | views::Widget* widget); |
| 260 | |
| 261 | // Rotates focus through containers that can receive focus. |
| 262 | void RotateFocus(Direction direction); |
| 263 | |
| 264 | // Sets the work area insets of the display that contains |window|, |
| 265 | // this notifies observers too. |
| 266 | // TODO(sky): this no longer really replicates what happens and is unreliable. |
| 267 | // Remove this. |
| 268 | void SetDisplayWorkAreaInsets(aura::Window* window, |
| 269 | const gfx::Insets& insets); |
| 270 | |
| 271 | // Called when the user logs in. |
| 272 | void OnLoginStateChanged(user::LoginStatus status); |
| 273 | |
| 274 | // Called when the login status changes. |
| 275 | // TODO(oshima): Investigate if we can merge this and |OnLoginStateChanged|. |
| 276 | void UpdateAfterLoginStatusChange(user::LoginStatus status); |
| 277 | |
| 278 | // Called when the application is exiting. |
| 279 | void OnAppTerminating(); |
| 280 | |
| 281 | // Called when the screen is locked (after the lock window is visible) or |
| 282 | // unlocked. |
| 283 | void OnLockStateChanged(bool locked); |
| 284 | |
| 285 | // Initializes |launcher_|. Does nothing if it's already initialized. |
| 286 | void CreateLauncher(); |
| 287 | |
Torne (Richard Coles) | 8bcbed8 | 2013-10-22 16:41:35 +0100 | [diff] [blame] | 288 | // Show shelf view if it was created hidden (before session has started). |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 289 | void ShowLauncher(); |
| 290 | |
| 291 | // Adds/removes observer. |
| 292 | void AddShellObserver(ShellObserver* observer); |
| 293 | void RemoveShellObserver(ShellObserver* observer); |
| 294 | |
Torne (Richard Coles) | 4e180b6 | 2013-10-18 15:46:22 +0100 | [diff] [blame] | 295 | keyboard::KeyboardController* keyboard_controller() { |
| 296 | return keyboard_controller_.get(); |
| 297 | } |
| 298 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 299 | AcceleratorController* accelerator_controller() { |
| 300 | return accelerator_controller_.get(); |
| 301 | } |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 302 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 303 | internal::DisplayManager* display_manager() { |
| 304 | return display_manager_.get(); |
| 305 | } |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 306 | views::corewm::InputMethodEventFilter* input_method_filter() { |
| 307 | return input_method_filter_.get(); |
| 308 | } |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 309 | views::corewm::CompoundEventFilter* env_filter() { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 310 | return env_filter_.get(); |
| 311 | } |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 312 | views::corewm::TooltipController* tooltip_controller() { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 313 | return tooltip_controller_.get(); |
| 314 | } |
| 315 | internal::EventRewriterEventFilter* event_rewriter_filter() { |
| 316 | return event_rewriter_filter_.get(); |
| 317 | } |
| 318 | internal::OverlayEventFilter* overlay_filter() { |
| 319 | return overlay_filter_.get(); |
| 320 | } |
| 321 | DesktopBackgroundController* desktop_background_controller() { |
| 322 | return desktop_background_controller_.get(); |
| 323 | } |
| 324 | PowerButtonController* power_button_controller() { |
| 325 | return power_button_controller_.get(); |
| 326 | } |
Torne (Richard Coles) | 868fa2f | 2013-06-11 10:57:03 +0100 | [diff] [blame] | 327 | LockStateController* lock_state_controller() { |
| 328 | return lock_state_controller_.get(); |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 329 | } |
Torne (Richard Coles) | a36e592 | 2013-08-05 13:57:33 +0100 | [diff] [blame] | 330 | MruWindowTracker* mru_window_tracker() { |
| 331 | return mru_window_tracker_.get(); |
| 332 | } |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 333 | UserActivityDetector* user_activity_detector() { |
| 334 | return user_activity_detector_.get(); |
| 335 | } |
| 336 | VideoDetector* video_detector() { |
| 337 | return video_detector_.get(); |
| 338 | } |
| 339 | WindowCycleController* window_cycle_controller() { |
| 340 | return window_cycle_controller_.get(); |
| 341 | } |
Torne (Richard Coles) | a36e592 | 2013-08-05 13:57:33 +0100 | [diff] [blame] | 342 | WindowSelectorController* window_selector_controller() { |
| 343 | return window_selector_controller_.get(); |
| 344 | } |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 345 | internal::FocusCycler* focus_cycler() { |
| 346 | return focus_cycler_.get(); |
| 347 | } |
| 348 | DisplayController* display_controller() { |
| 349 | return display_controller_.get(); |
| 350 | } |
| 351 | internal::MouseCursorEventFilter* mouse_cursor_filter() { |
| 352 | return mouse_cursor_filter_.get(); |
| 353 | } |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 354 | internal::EventTransformationHandler* event_transformation_handler() { |
| 355 | return event_transformation_handler_.get(); |
| 356 | } |
| 357 | views::corewm::CursorManager* cursor_manager() { return &cursor_manager_; } |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 358 | |
| 359 | ShellDelegate* delegate() { return delegate_.get(); } |
| 360 | |
| 361 | UserWallpaperDelegate* user_wallpaper_delegate() { |
| 362 | return user_wallpaper_delegate_.get(); |
| 363 | } |
| 364 | |
| 365 | CapsLockDelegate* caps_lock_delegate() { |
| 366 | return caps_lock_delegate_.get(); |
| 367 | } |
| 368 | |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 369 | SessionStateDelegate* session_state_delegate() { |
| 370 | return session_state_delegate_.get(); |
| 371 | } |
| 372 | |
Torne (Richard Coles) | 1e9bf3e | 2013-10-31 11:16:26 +0000 | [diff] [blame] | 373 | AccessibilityDelegate* accessibility_delegate() { |
| 374 | return accessibility_delegate_.get(); |
| 375 | } |
| 376 | |
| 377 | NewWindowDelegate* new_window_delegate() { |
| 378 | return new_window_delegate_.get(); |
| 379 | } |
| 380 | |
Torne (Richard Coles) | 0f1bc08 | 2013-11-06 12:27:47 +0000 | [diff] [blame^] | 381 | MediaDelegate* media_delegate() { |
| 382 | return media_delegate_.get(); |
| 383 | } |
| 384 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 385 | HighContrastController* high_contrast_controller() { |
| 386 | return high_contrast_controller_.get(); |
| 387 | } |
| 388 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 389 | MagnificationController* magnification_controller() { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 390 | return magnification_controller_.get(); |
| 391 | } |
| 392 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 393 | PartialMagnificationController* partial_magnification_controller() { |
| 394 | return partial_magnification_controller_.get(); |
| 395 | } |
Torne (Richard Coles) | 4e180b6 | 2013-10-18 15:46:22 +0100 | [diff] [blame] | 396 | |
| 397 | AutoclickController* autoclick_controller() { |
| 398 | return autoclick_controller_.get(); |
| 399 | } |
| 400 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 401 | aura::client::ActivationClient* activation_client() { |
| 402 | return activation_client_; |
| 403 | } |
| 404 | |
Torne (Richard Coles) | 424c4d7 | 2013-08-30 15:14:49 +0100 | [diff] [blame] | 405 | LauncherItemDelegateManager* launcher_item_delegate_manager() { |
| 406 | return launcher_item_delegate_manager_.get(); |
| 407 | } |
| 408 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 409 | ScreenAsh* screen() { return screen_; } |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 410 | |
| 411 | // Force the shelf to query for it's current visibility state. |
| 412 | void UpdateShelfVisibility(); |
| 413 | |
| 414 | // TODO(oshima): Define an interface to access shelf/launcher |
| 415 | // state, or just use Launcher. |
| 416 | |
| 417 | // Sets/gets the shelf auto-hide behavior on |root_window|. |
| 418 | void SetShelfAutoHideBehavior(ShelfAutoHideBehavior behavior, |
Torne (Richard Coles) | 1e9bf3e | 2013-10-31 11:16:26 +0000 | [diff] [blame] | 419 | aura::Window* root_window); |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 420 | ShelfAutoHideBehavior GetShelfAutoHideBehavior( |
Torne (Richard Coles) | 1e9bf3e | 2013-10-31 11:16:26 +0000 | [diff] [blame] | 421 | aura::Window* root_window) const; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 422 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 423 | // Sets/gets shelf's alignment on |root_window|. |
| 424 | void SetShelfAlignment(ShelfAlignment alignment, |
Torne (Richard Coles) | 1e9bf3e | 2013-10-31 11:16:26 +0000 | [diff] [blame] | 425 | aura::Window* root_window); |
| 426 | ShelfAlignment GetShelfAlignment(aura::Window* root_window); |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 427 | |
| 428 | // Dims or undims the screen. |
| 429 | void SetDimming(bool should_dim); |
| 430 | |
Torne (Richard Coles) | 4e180b6 | 2013-10-18 15:46:22 +0100 | [diff] [blame] | 431 | // Notifies |observers_| when entering or exiting fullscreen mode in |
| 432 | // |root_window|. |
| 433 | void NotifyFullscreenStateChange(bool is_fullscreen, |
Torne (Richard Coles) | 1e9bf3e | 2013-10-31 11:16:26 +0000 | [diff] [blame] | 434 | aura::Window* root_window); |
Torne (Richard Coles) | 4e180b6 | 2013-10-18 15:46:22 +0100 | [diff] [blame] | 435 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 436 | // Creates a modal background (a partially-opaque fullscreen window) |
| 437 | // on all displays for |window|. |
| 438 | void CreateModalBackground(aura::Window* window); |
| 439 | |
| 440 | // Called when a modal window is removed. It will activate |
| 441 | // another modal window if any, or remove modal screens |
| 442 | // on all displays. |
| 443 | void OnModalWindowRemoved(aura::Window* removed); |
| 444 | |
| 445 | // Returns WebNotificationTray on the primary root window. |
| 446 | WebNotificationTray* GetWebNotificationTray(); |
| 447 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 448 | // Does the primary display have status area? |
| 449 | bool HasPrimaryStatusArea(); |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 450 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 451 | // Returns the system tray on primary display. |
| 452 | SystemTray* GetPrimarySystemTray(); |
| 453 | |
| 454 | SystemTrayDelegate* system_tray_delegate() { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 455 | return system_tray_delegate_.get(); |
| 456 | } |
| 457 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 458 | SystemTrayNotifier* system_tray_notifier() { |
| 459 | return system_tray_notifier_.get(); |
| 460 | } |
| 461 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 462 | static void set_initially_hide_cursor(bool hide) { |
| 463 | initially_hide_cursor_ = hide; |
| 464 | } |
| 465 | |
| 466 | internal::ResizeShadowController* resize_shadow_controller() { |
| 467 | return resize_shadow_controller_.get(); |
| 468 | } |
| 469 | |
| 470 | // Made available for tests. |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 471 | views::corewm::ShadowController* shadow_controller() { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 472 | return shadow_controller_.get(); |
| 473 | } |
| 474 | |
| 475 | content::BrowserContext* browser_context() { return browser_context_; } |
| 476 | void set_browser_context(content::BrowserContext* browser_context) { |
| 477 | browser_context_ = browser_context; |
| 478 | } |
| 479 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 480 | // Starts the animation that occurs on first login. |
| 481 | void DoInitialWorkspaceAnimation(); |
| 482 | |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 483 | #if defined(OS_CHROMEOS) && defined(USE_X11) |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 484 | // TODO(oshima): Move these objects to DisplayController. |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 485 | chromeos::OutputConfigurator* output_configurator() { |
| 486 | return output_configurator_.get(); |
| 487 | } |
| 488 | internal::OutputConfiguratorAnimation* output_configurator_animation() { |
| 489 | return output_configurator_animation_.get(); |
| 490 | } |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 491 | internal::DisplayErrorObserver* display_error_observer() { |
| 492 | return display_error_observer_.get(); |
| 493 | } |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 494 | #endif // defined(OS_CHROMEOS) && defined(USE_X11) |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 495 | |
Ben Murdoch | ba5b9a6 | 2013-08-12 14:20:17 +0100 | [diff] [blame] | 496 | internal::ResolutionNotificationController* |
| 497 | resolution_notification_controller() { |
| 498 | return resolution_notification_controller_.get(); |
| 499 | } |
| 500 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 501 | RootWindowHostFactory* root_window_host_factory() { |
| 502 | return root_window_host_factory_.get(); |
| 503 | } |
| 504 | |
| 505 | LauncherModel* launcher_model() { |
| 506 | return launcher_model_.get(); |
| 507 | } |
| 508 | |
Torne (Richard Coles) | 4e180b6 | 2013-10-18 15:46:22 +0100 | [diff] [blame] | 509 | WindowPositioner* window_positioner() { |
| 510 | return window_positioner_.get(); |
| 511 | } |
| 512 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 513 | // Returns the launcher delegate, creating if necesary. |
| 514 | LauncherDelegate* GetLauncherDelegate(); |
| 515 | |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 516 | void SetTouchHudProjectionEnabled(bool enabled); |
| 517 | |
| 518 | bool is_touch_hud_projection_enabled() const { |
| 519 | return is_touch_hud_projection_enabled_; |
| 520 | } |
| 521 | |
Torne (Richard Coles) | 8bcbed8 | 2013-10-22 16:41:35 +0100 | [diff] [blame] | 522 | #if defined(OS_CHROMEOS) |
| 523 | // Creates instance of FirstRunHelper. Caller is responsible for deleting |
| 524 | // returned object. |
| 525 | ash::FirstRunHelper* CreateFirstRunHelper(); |
| 526 | #endif // defined(OS_CHROMEOS) |
| 527 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 528 | private: |
| 529 | FRIEND_TEST_ALL_PREFIXES(ExtendedDesktopTest, TestCursor); |
| 530 | FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, MouseEventCursors); |
| 531 | FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, TransformActivate); |
| 532 | friend class internal::RootWindowController; |
Torne (Richard Coles) | a36e592 | 2013-08-05 13:57:33 +0100 | [diff] [blame] | 533 | friend class internal::ScopedTargetRootWindow; |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 534 | friend class test::ShellTestApi; |
| 535 | friend class shell::WindowWatcher; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 536 | |
| 537 | typedef std::pair<aura::Window*, gfx::Rect> WindowAndBoundsPair; |
| 538 | |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 539 | // Takes ownership of |delegate|. |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 540 | explicit Shell(ShellDelegate* delegate); |
| 541 | virtual ~Shell(); |
| 542 | |
| 543 | void Init(); |
| 544 | |
Torne (Richard Coles) | 4e180b6 | 2013-10-18 15:46:22 +0100 | [diff] [blame] | 545 | // Initializes virtual keyboard controller and attaches it to |root|. |
| 546 | void InitKeyboard(internal::RootWindowController* root); |
| 547 | |
Torne (Richard Coles) | 8bcbed8 | 2013-10-22 16:41:35 +0100 | [diff] [blame] | 548 | // Initializes the root window so that it can host browser windows. |
| 549 | void InitRootWindow(aura::RootWindow* root_window); |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 550 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 551 | // ash::internal::SystemModalContainerEventFilterDelegate overrides: |
| 552 | virtual bool CanWindowReceiveEvents(aura::Window* window) OVERRIDE; |
| 553 | |
| 554 | // Overridden from ui::EventTarget: |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 555 | virtual bool CanAcceptEvent(const ui::Event& event) OVERRIDE; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 556 | virtual EventTarget* GetParentTarget() OVERRIDE; |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 557 | virtual void OnEvent(ui::Event* event) OVERRIDE; |
| 558 | |
| 559 | // Overridden from aura::client::ActivationChangeObserver: |
| 560 | virtual void OnWindowActivated(aura::Window* gained_active, |
| 561 | aura::Window* lost_active) OVERRIDE; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 562 | |
| 563 | static Shell* instance_; |
| 564 | |
| 565 | // If set before the Shell is initialized, the mouse cursor will be hidden |
| 566 | // when the screen is initially created. |
| 567 | static bool initially_hide_cursor_; |
| 568 | |
| 569 | ScreenAsh* screen_; |
| 570 | |
Torne (Richard Coles) | a36e592 | 2013-08-05 13:57:33 +0100 | [diff] [blame] | 571 | // When no explicit target display/RootWindow is given, new windows are |
| 572 | // created on |scoped_target_root_window_| , unless NULL in |
| 573 | // which case they are created on |target_root_window_|. |
| 574 | // |target_root_window_| never becomes NULL during the session. |
Torne (Richard Coles) | 1e9bf3e | 2013-10-31 11:16:26 +0000 | [diff] [blame] | 575 | aura::Window* target_root_window_; |
| 576 | aura::Window* scoped_target_root_window_; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 577 | |
| 578 | // The CompoundEventFilter owned by aura::Env object. |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 579 | scoped_ptr<views::corewm::CompoundEventFilter> env_filter_; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 580 | |
| 581 | std::vector<WindowAndBoundsPair> to_restore_; |
| 582 | |
Torne (Richard Coles) | 4e180b6 | 2013-10-18 15:46:22 +0100 | [diff] [blame] | 583 | scoped_ptr<keyboard::KeyboardController> keyboard_controller_; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 584 | scoped_ptr<NestedDispatcherController> nested_dispatcher_controller_; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 585 | scoped_ptr<AcceleratorController> accelerator_controller_; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 586 | scoped_ptr<ShellDelegate> delegate_; |
| 587 | scoped_ptr<SystemTrayDelegate> system_tray_delegate_; |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 588 | scoped_ptr<SystemTrayNotifier> system_tray_notifier_; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 589 | scoped_ptr<UserWallpaperDelegate> user_wallpaper_delegate_; |
| 590 | scoped_ptr<CapsLockDelegate> caps_lock_delegate_; |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 591 | scoped_ptr<SessionStateDelegate> session_state_delegate_; |
Torne (Richard Coles) | 1e9bf3e | 2013-10-31 11:16:26 +0000 | [diff] [blame] | 592 | scoped_ptr<AccessibilityDelegate> accessibility_delegate_; |
| 593 | scoped_ptr<NewWindowDelegate> new_window_delegate_; |
Torne (Richard Coles) | 0f1bc08 | 2013-11-06 12:27:47 +0000 | [diff] [blame^] | 594 | scoped_ptr<MediaDelegate> media_delegate_; |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 595 | scoped_ptr<LauncherDelegate> launcher_delegate_; |
Torne (Richard Coles) | 424c4d7 | 2013-08-30 15:14:49 +0100 | [diff] [blame] | 596 | scoped_ptr<LauncherItemDelegateManager> launcher_item_delegate_manager_; |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 597 | |
| 598 | scoped_ptr<LauncherModel> launcher_model_; |
Torne (Richard Coles) | 4e180b6 | 2013-10-18 15:46:22 +0100 | [diff] [blame] | 599 | scoped_ptr<ash::WindowPositioner> window_positioner_; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 600 | |
| 601 | scoped_ptr<internal::AppListController> app_list_controller_; |
| 602 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 603 | scoped_ptr<internal::DragDropController> drag_drop_controller_; |
| 604 | scoped_ptr<internal::ResizeShadowController> resize_shadow_controller_; |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 605 | scoped_ptr<views::corewm::ShadowController> shadow_controller_; |
| 606 | scoped_ptr<views::corewm::VisibilityController> visibility_controller_; |
| 607 | scoped_ptr<views::corewm::WindowModalityController> |
| 608 | window_modality_controller_; |
| 609 | scoped_ptr<views::corewm::TooltipController> tooltip_controller_; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 610 | scoped_ptr<DesktopBackgroundController> desktop_background_controller_; |
| 611 | scoped_ptr<PowerButtonController> power_button_controller_; |
Torne (Richard Coles) | 868fa2f | 2013-06-11 10:57:03 +0100 | [diff] [blame] | 612 | scoped_ptr<LockStateController> lock_state_controller_; |
Torne (Richard Coles) | a36e592 | 2013-08-05 13:57:33 +0100 | [diff] [blame] | 613 | scoped_ptr<MruWindowTracker> mru_window_tracker_; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 614 | scoped_ptr<UserActivityDetector> user_activity_detector_; |
| 615 | scoped_ptr<VideoDetector> video_detector_; |
| 616 | scoped_ptr<WindowCycleController> window_cycle_controller_; |
Torne (Richard Coles) | a36e592 | 2013-08-05 13:57:33 +0100 | [diff] [blame] | 617 | scoped_ptr<WindowSelectorController> window_selector_controller_; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 618 | scoped_ptr<internal::FocusCycler> focus_cycler_; |
| 619 | scoped_ptr<DisplayController> display_controller_; |
| 620 | scoped_ptr<HighContrastController> high_contrast_controller_; |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 621 | scoped_ptr<MagnificationController> magnification_controller_; |
| 622 | scoped_ptr<PartialMagnificationController> partial_magnification_controller_; |
Torne (Richard Coles) | 4e180b6 | 2013-10-18 15:46:22 +0100 | [diff] [blame] | 623 | scoped_ptr<AutoclickController> autoclick_controller_; |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 624 | scoped_ptr<aura::client::FocusClient> focus_client_; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 625 | scoped_ptr<aura::client::UserActionClient> user_action_client_; |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 626 | aura::client::ActivationClient* activation_client_; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 627 | scoped_ptr<internal::MouseCursorEventFilter> mouse_cursor_filter_; |
| 628 | scoped_ptr<internal::ScreenPositionController> screen_position_controller_; |
| 629 | scoped_ptr<internal::SystemModalContainerEventFilter> modality_filter_; |
| 630 | scoped_ptr<internal::EventClientImpl> event_client_; |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 631 | scoped_ptr<internal::EventTransformationHandler> |
| 632 | event_transformation_handler_; |
| 633 | scoped_ptr<RootWindowHostFactory> root_window_host_factory_; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 634 | |
| 635 | // An event filter that rewrites or drops an event. |
| 636 | scoped_ptr<internal::EventRewriterEventFilter> event_rewriter_filter_; |
| 637 | |
| 638 | // An event filter that pre-handles key events while the partial |
| 639 | // screenshot UI or the keyboard overlay is active. |
| 640 | scoped_ptr<internal::OverlayEventFilter> overlay_filter_; |
| 641 | |
Torne (Richard Coles) | 4e180b6 | 2013-10-18 15:46:22 +0100 | [diff] [blame] | 642 | // An event filter for logging keyboard-related metrics. |
| 643 | scoped_ptr<internal::KeyboardUMAEventFilter> keyboard_metrics_filter_; |
| 644 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 645 | // An event filter which handles system level gestures |
| 646 | scoped_ptr<internal::SystemGestureEventFilter> system_gesture_filter_; |
| 647 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 648 | // An event filter that pre-handles global accelerators. |
| 649 | scoped_ptr<internal::AcceleratorFilter> accelerator_filter_; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 650 | |
| 651 | // An event filter that pre-handles all key events to send them to an IME. |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 652 | scoped_ptr<views::corewm::InputMethodEventFilter> input_method_filter_; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 653 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 654 | scoped_ptr<internal::DisplayManager> display_manager_; |
Torne (Richard Coles) | 1e9bf3e | 2013-10-31 11:16:26 +0000 | [diff] [blame] | 655 | scoped_ptr<base::WeakPtrFactory<internal::DisplayManager> > |
| 656 | weak_display_manager_factory_; |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 657 | |
Torne (Richard Coles) | a36e592 | 2013-08-05 13:57:33 +0100 | [diff] [blame] | 658 | scoped_ptr<internal::LocaleNotificationController> |
| 659 | locale_notification_controller_; |
| 660 | |
Torne (Richard Coles) | 4e180b6 | 2013-10-18 15:46:22 +0100 | [diff] [blame] | 661 | #if defined(OS_CHROMEOS) |
| 662 | scoped_ptr<internal::PowerEventObserver> power_event_observer_; |
| 663 | scoped_ptr<internal::UserActivityNotifier> user_activity_notifier_; |
| 664 | scoped_ptr<internal::VideoActivityNotifier> video_activity_notifier_; |
| 665 | #if defined(USE_X11) |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 666 | // Controls video output device state. |
| 667 | scoped_ptr<chromeos::OutputConfigurator> output_configurator_; |
| 668 | scoped_ptr<internal::OutputConfiguratorAnimation> |
| 669 | output_configurator_animation_; |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 670 | scoped_ptr<internal::DisplayErrorObserver> display_error_observer_; |
| 671 | |
Torne (Richard Coles) | 3551c9c | 2013-08-23 16:39:15 +0100 | [diff] [blame] | 672 | // Listens for output changes and updates the display manager. |
| 673 | scoped_ptr<internal::DisplayChangeObserver> display_change_observer_; |
Torne (Richard Coles) | 4e180b6 | 2013-10-18 15:46:22 +0100 | [diff] [blame] | 674 | #endif // defined(USE_X11) |
| 675 | #endif // defined(OS_CHROMEOS) |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 676 | |
Ben Murdoch | ba5b9a6 | 2013-08-12 14:20:17 +0100 | [diff] [blame] | 677 | scoped_ptr<internal::ResolutionNotificationController> |
| 678 | resolution_notification_controller_; |
| 679 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 680 | // |native_cursor_manager_| is owned by |cursor_manager_|, but we keep a |
| 681 | // pointer to vend to test code. |
| 682 | AshNativeCursorManager* native_cursor_manager_; |
| 683 | views::corewm::CursorManager cursor_manager_; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 684 | |
| 685 | ObserverList<ShellObserver> observers_; |
| 686 | |
| 687 | // Used by ash/shell. |
| 688 | content::BrowserContext* browser_context_; |
| 689 | |
| 690 | // For testing only: simulate that a modal window is open |
| 691 | bool simulate_modal_window_open_for_testing_; |
| 692 | |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 693 | bool is_touch_hud_projection_enabled_; |
| 694 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 695 | DISALLOW_COPY_AND_ASSIGN(Shell); |
| 696 | }; |
| 697 | |
| 698 | } // namespace ash |
| 699 | |
| 700 | #endif // ASH_SHELL_H_ |