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