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.
5 #ifndef ASH_SHELL_DELEGATE_H_
6 #define ASH_SHELL_DELEGATE_H_
10 #include "ash/ash_export.h"
11 #include "ash/shell.h"
12 #include "base/callback.h"
13 #include "base/strings/string16.h"
16 class AppListViewDelegate
;
23 class UserActionClient
;
40 class KeyboardControllerProxy
;
45 class AccessibilityDelegate
;
46 class CapsLockDelegate
;
48 class NewWindowDelegate
;
49 class WindowTreeHostFactory
;
50 class SessionStateDelegate
;
52 class ShelfItemDelegate
;
54 class SystemTrayDelegate
;
55 class UserWallpaperDelegate
;
58 // Delegate of the Shell.
59 class ASH_EXPORT ShellDelegate
{
61 // The Shell owns the delegate.
62 virtual ~ShellDelegate() {}
64 // Returns true if this is the first time that the shell has been run after
65 // the system has booted. false is returned after the shell has been
66 // restarted, typically due to logging in as a guest or logging out.
67 virtual bool IsFirstRunAfterBoot() const = 0;
69 // Returns true if multi-profiles feature is enabled.
70 virtual bool IsMultiProfilesEnabled() const = 0;
72 // Returns true if incognito mode is allowed for the user.
73 // Incognito windows are restricted for supervised users.
74 virtual bool IsIncognitoAllowed() const = 0;
76 // Returns true if we're running in forced app mode.
77 virtual bool IsRunningInForcedAppMode() const = 0;
79 // Called before processing |Shell::Init()| so that the delegate
80 // can perform tasks necessary before the shell is initialized.
81 virtual void PreInit() = 0;
83 // Shuts down the environment.
84 virtual void Shutdown() = 0;
86 // Invoked when the user uses Ctrl-Shift-Q to close chrome.
87 virtual void Exit() = 0;
89 // Create a shell-specific keyboard::KeyboardControllerProxy
90 virtual keyboard::KeyboardControllerProxy
*
91 CreateKeyboardControllerProxy() = 0;
93 // Get the active browser context. This will get us the active profile
95 virtual content::BrowserContext
* GetActiveBrowserContext() = 0;
97 // Invoked to create an AppListViewDelegate. Shell takes the ownership of
98 // the created delegate.
99 virtual app_list::AppListViewDelegate
* CreateAppListViewDelegate() = 0;
101 // Creates a new ShelfDelegate. Shell takes ownership of the returned
103 virtual ShelfDelegate
* CreateShelfDelegate(ShelfModel
* model
) = 0;
105 // Creates a system-tray delegate. Shell takes ownership of the delegate.
106 virtual SystemTrayDelegate
* CreateSystemTrayDelegate() = 0;
108 // Creates a user wallpaper delegate. Shell takes ownership of the delegate.
109 virtual UserWallpaperDelegate
* CreateUserWallpaperDelegate() = 0;
111 // Creates a caps lock delegate. Shell takes ownership of the delegate.
112 virtual CapsLockDelegate
* CreateCapsLockDelegate() = 0;
114 // Creates a session state delegate. Shell takes ownership of the delegate.
115 virtual SessionStateDelegate
* CreateSessionStateDelegate() = 0;
117 // Creates a accessibility delegate. Shell takes ownership of the delegate.
118 virtual AccessibilityDelegate
* CreateAccessibilityDelegate() = 0;
120 // Creates an application delegate. Shell takes ownership of the delegate.
121 virtual NewWindowDelegate
* CreateNewWindowDelegate() = 0;
123 // Creates a media delegate. Shell takes ownership of the delegate.
124 virtual MediaDelegate
* CreateMediaDelegate() = 0;
126 // Creates a user action client. Shell takes ownership of the object.
127 virtual aura::client::UserActionClient
* CreateUserActionClient() = 0;
129 // Creates a menu model of the context for the |root_window|.
130 // When a ContextMenu is used for an item created by ShelfWindowWatcher,
131 // passes its ShelfItemDelegate and ShelfItem.
132 virtual ui::MenuModel
* CreateContextMenu(
133 aura::Window
* root_window
,
134 ash::ShelfItemDelegate
* item_delegate
,
135 ash::ShelfItem
* item
) = 0;
137 // Creates a root window host factory. Shell takes ownership of the returned
139 virtual WindowTreeHostFactory
* CreateWindowTreeHostFactory() = 0;
141 // Creates a GPU support object. Shell takes ownership of the object.
142 virtual GPUSupport
* CreateGPUSupport() = 0;
144 // Get the product name.
145 virtual base::string16
GetProductName() const = 0;
150 #endif // ASH_SHELL_DELEGATE_H_