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