Use SCHEME_HTTP for HTTPS proxies on Android.
[chromium-blink-merge.git] / ash / shell_delegate.h
bloba7eb83872619d35e0552ef59b52707c29420f0bc
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_
8 #include <vector>
10 #include "ash/ash_export.h"
11 #include "ash/magnifier/magnifier_constants.h"
12 #include "ash/shell.h"
13 #include "base/callback.h"
14 #include "base/string16.h"
15 #include "base/time.h"
17 namespace app_list {
18 class AppListViewDelegate;
21 namespace aura {
22 class RootWindow;
23 class Window;
24 namespace client {
25 class StackingClient;
26 class UserActionClient;
30 namespace ui {
31 class MenuModel;
34 namespace views {
35 class Widget;
38 namespace ash {
40 class CapsLockDelegate;
41 class LauncherDelegate;
42 class LauncherModel;
43 struct LauncherItem;
44 class SystemTrayDelegate;
45 class UserWallpaperDelegate;
47 enum UserMetricsAction {
48 UMA_ACCEL_KEYBOARD_BRIGHTNESS_DOWN_F6,
49 UMA_ACCEL_KEYBOARD_BRIGHTNESS_UP_F7,
50 UMA_ACCEL_MAXIMIZE_RESTORE_F4,
51 UMA_ACCEL_NEWTAB_T,
52 UMA_ACCEL_NEXTWINDOW_F5,
53 UMA_ACCEL_NEXTWINDOW_TAB,
54 UMA_ACCEL_PREVWINDOW_F5,
55 UMA_ACCEL_PREVWINDOW_TAB,
56 UMA_ACCEL_SEARCH_LWIN,
57 UMA_LAUNCHER_CLICK_ON_APP,
58 UMA_LAUNCHER_CLICK_ON_APPLIST_BUTTON,
59 UMA_MOUSE_DOWN,
60 UMA_TOUCHSCREEN_TAP_DOWN,
63 // Delegate of the Shell.
64 class ASH_EXPORT ShellDelegate {
65 public:
66 // The Shell owns the delegate.
67 virtual ~ShellDelegate() {}
69 // Returns true if user has logged in.
70 virtual bool IsUserLoggedIn() const = 0;
72 // Returns true if we're logged in and browser has been started
73 virtual bool IsSessionStarted() const = 0;
75 // Returns true if this is the first time that the shell has been run after
76 // the system has booted. false is returned after the shell has been
77 // restarted, typically due to logging in as a guest or logging out.
78 virtual bool IsFirstRunAfterBoot() const = 0;
80 // Returns true if a user is logged in whose session can be locked (i.e. the
81 // user has a password with which to unlock the session).
82 virtual bool CanLockScreen() const = 0;
84 // Invoked when a user locks the screen.
85 virtual void LockScreen() = 0;
87 // Unlock the screen. Currently used only for tests.
88 virtual void UnlockScreen() = 0;
90 // Returns true if the screen is currently locked.
91 virtual bool IsScreenLocked() const = 0;
93 // Shuts down the environment.
94 virtual void Shutdown() = 0;
96 // Invoked when the user uses Ctrl-Shift-Q to close chrome.
97 virtual void Exit() = 0;
99 // Invoked when the user uses Ctrl+T to open a new tab.
100 virtual void NewTab() = 0;
102 // Invoked when the user uses Ctrl-N or Ctrl-Shift-N to open a new window.
103 virtual void NewWindow(bool incognito) = 0;
105 // Invoked when the user uses F4 to toggle window maximized state.
106 virtual void ToggleMaximized() = 0;
108 // Invoked when the user uses Ctrl-M or Ctrl-O to open file manager.
109 virtual void OpenFileManager(bool as_dialog) = 0;
111 // Invoked when the user opens Crosh.
112 virtual void OpenCrosh() = 0;
114 // Invoked when the user needs to set up mobile networking.
115 virtual void OpenMobileSetup(const std::string& service_path) = 0;
117 // Invoked when the user uses Shift+Ctrl+T to restore the closed tab.
118 virtual void RestoreTab() = 0;
120 // Moves keyboard focus to the next pane. Returns false if no browser window
121 // is created.
122 virtual bool RotatePaneFocus(Shell::Direction direction) = 0;
124 // Shows the keyboard shortcut overlay.
125 virtual void ShowKeyboardOverlay() = 0;
127 // Shows the task manager window.
128 virtual void ShowTaskManager() = 0;
130 // Get the current browser context. This will get us the current profile.
131 virtual content::BrowserContext* GetCurrentBrowserContext() = 0;
133 // Invoked to toggle spoken feedback for accessibility
134 virtual void ToggleSpokenFeedback() = 0;
136 // Returns true if spoken feedback is enabled.
137 virtual bool IsSpokenFeedbackEnabled() const = 0;
139 // Invoked to toggle high contrast for accessibility.
140 virtual void ToggleHighContrast() = 0;
142 // Returns true if high contrast mode is enabled.
143 virtual bool IsHighContrastEnabled() const = 0;
145 // Invoked to change the mode of the screen magnifier.
146 virtual void SetMagnifier(MagnifierType type) = 0;
148 // Returns the current screen magnifier mode.
149 virtual MagnifierType GetMagnifierType() const = 0;
151 // Returns true if the user want to show accesibility menu even when all the
152 // accessibility features are disabled.
153 virtual bool ShouldAlwaysShowAccessibilityMenu() const = 0;
155 // Invoked to create an AppListViewDelegate. Shell takes the ownership of
156 // the created delegate.
157 virtual app_list::AppListViewDelegate* CreateAppListViewDelegate() = 0;
159 // Creates a new LauncherDelegate. Shell takes ownership of the returned
160 // value.
161 virtual LauncherDelegate* CreateLauncherDelegate(
162 ash::LauncherModel* model) = 0;
164 // Creates a system-tray delegate. Shell takes ownership of the delegate.
165 virtual SystemTrayDelegate* CreateSystemTrayDelegate() = 0;
167 // Creates a user wallpaper delegate. Shell takes ownership of the delegate.
168 virtual UserWallpaperDelegate* CreateUserWallpaperDelegate() = 0;
170 // Creates a caps lock delegate. Shell takes ownership of the delegate.
171 virtual CapsLockDelegate* CreateCapsLockDelegate() = 0;
173 // Creates a user action client. Shell takes ownership of the object.
174 virtual aura::client::UserActionClient* CreateUserActionClient() = 0;
176 // Opens the feedback page for "Report Issue".
177 virtual void OpenFeedbackPage() = 0;
179 // Records that the user performed an action.
180 virtual void RecordUserMetricsAction(UserMetricsAction action) = 0;
182 // Handles the Next Track Media shortcut key.
183 virtual void HandleMediaNextTrack() = 0;
185 // Handles the Play/Pause Toggle Media shortcut key.
186 virtual void HandleMediaPlayPause() = 0;
188 // Handles the Previous Track Media shortcut key.
189 virtual void HandleMediaPrevTrack() = 0;
191 // Produces l10n-ed text of remaining time, e.g.: "13 minutes left" or
192 // "13 Minuten übrig".
193 // Used, for example, to display the remaining battery life.
194 virtual string16 GetTimeRemainingString(base::TimeDelta delta) = 0;
196 // Produces l10n-ed text for time duration, e.g.: "13 minutes" or "2 hours".
197 virtual string16 GetTimeDurationLongString(base::TimeDelta delta) = 0;
199 // Saves the zoom scale of the full screen magnifier.
200 virtual void SaveScreenMagnifierScale(double scale) = 0;
202 // Gets a saved value of the zoom scale of full screen magnifier. If a value
203 // is not saved, return a negative value.
204 virtual double GetSavedScreenMagnifierScale() = 0;
206 // Creates a menu model of the context for the |root_window|.
207 virtual ui::MenuModel* CreateContextMenu(aura::RootWindow* root_window) = 0;
209 // Creates the stacking client. Shell takes ownership of the object.
210 virtual aura::client::StackingClient* CreateStackingClient() = 0;
212 // True if the user's preferences have the Search key acting as a Function key
213 // modifier for accessing extended keyboard shortcuts.
214 virtual bool IsSearchKeyActingAsFunctionKey() const = 0;
217 } // namespace ash
219 #endif // ASH_SHELL_DELEGATE_H_