| OLD | NEW | 
|---|
|  | (Empty) | 
| 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_COMMON_SHELL_DELEGATE_H_ |  | 
| 6 #define ASH_COMMON_SHELL_DELEGATE_H_ |  | 
| 7 |  | 
| 8 #include <memory> |  | 
| 9 #include <string> |  | 
| 10 |  | 
| 11 #include "ash/ash_export.h" |  | 
| 12 #include "base/callback.h" |  | 
| 13 #include "base/strings/string16.h" |  | 
| 14 |  | 
| 15 class GURL; |  | 
| 16 |  | 
| 17 namespace gfx { |  | 
| 18 class Image; |  | 
| 19 } |  | 
| 20 |  | 
| 21 namespace keyboard { |  | 
| 22 class KeyboardUI; |  | 
| 23 } |  | 
| 24 |  | 
| 25 namespace service_manager { |  | 
| 26 class Connector; |  | 
| 27 } |  | 
| 28 |  | 
| 29 namespace ui { |  | 
| 30 class MenuModel; |  | 
| 31 } |  | 
| 32 |  | 
| 33 namespace ash { |  | 
| 34 |  | 
| 35 class AccessibilityDelegate; |  | 
| 36 class GPUSupport; |  | 
| 37 class PaletteDelegate; |  | 
| 38 class SessionStateDelegate; |  | 
| 39 class ShelfDelegate; |  | 
| 40 class ShelfModel; |  | 
| 41 class SystemTrayDelegate; |  | 
| 42 struct ShelfItem; |  | 
| 43 class WallpaperDelegate; |  | 
| 44 class WmShelf; |  | 
| 45 class WmWindow; |  | 
| 46 |  | 
| 47 // Delegate of the Shell. |  | 
| 48 class ASH_EXPORT ShellDelegate { |  | 
| 49  public: |  | 
| 50   // The Shell owns the delegate. |  | 
| 51   virtual ~ShellDelegate() {} |  | 
| 52 |  | 
| 53   // Returns the connector for the mojo service manager. Returns null in tests. |  | 
| 54   virtual service_manager::Connector* GetShellConnector() const = 0; |  | 
| 55 |  | 
| 56   // Returns true if multi-profiles feature is enabled. |  | 
| 57   virtual bool IsMultiProfilesEnabled() const = 0; |  | 
| 58 |  | 
| 59   // Returns true if incognito mode is allowed for the user. |  | 
| 60   // Incognito windows are restricted for supervised users. |  | 
| 61   virtual bool IsIncognitoAllowed() const = 0; |  | 
| 62 |  | 
| 63   // Returns true if we're running in forced app mode. |  | 
| 64   virtual bool IsRunningInForcedAppMode() const = 0; |  | 
| 65 |  | 
| 66   // Returns true if |window| can be shown for the delegate's concept of current |  | 
| 67   // user. |  | 
| 68   virtual bool CanShowWindowForUser(WmWindow* window) const = 0; |  | 
| 69 |  | 
| 70   // Returns true if the first window shown on first run should be |  | 
| 71   // unconditionally maximized, overriding the heuristic that normally chooses |  | 
| 72   // the window size. |  | 
| 73   virtual bool IsForceMaximizeOnFirstRun() const = 0; |  | 
| 74 |  | 
| 75   // Called before processing |Shell::Init()| so that the delegate |  | 
| 76   // can perform tasks necessary before the shell is initialized. |  | 
| 77   virtual void PreInit() = 0; |  | 
| 78 |  | 
| 79   // Called at the beginninig of Shell destructor so that |  | 
| 80   // delegate can use Shell instance to perform cleanup tasks. |  | 
| 81   virtual void PreShutdown() = 0; |  | 
| 82 |  | 
| 83   // Invoked when the user uses Ctrl-Shift-Q to close chrome. |  | 
| 84   virtual void Exit() = 0; |  | 
| 85 |  | 
| 86   // Create a shell-specific keyboard::KeyboardUI |  | 
| 87   virtual keyboard::KeyboardUI* CreateKeyboardUI() = 0; |  | 
| 88 |  | 
| 89   // Opens the |url| in a new browser tab. |  | 
| 90   virtual void OpenUrlFromArc(const GURL& url) = 0; |  | 
| 91 |  | 
| 92   // Creates a new ShelfDelegate. Shell takes ownership of the returned value. |  | 
| 93   virtual ShelfDelegate* CreateShelfDelegate(ShelfModel* model) = 0; |  | 
| 94 |  | 
| 95   // Creates a system-tray delegate. Shell takes ownership of the delegate. |  | 
| 96   virtual SystemTrayDelegate* CreateSystemTrayDelegate() = 0; |  | 
| 97 |  | 
| 98   // Creates a wallpaper delegate. Shell takes ownership of the delegate. |  | 
| 99   virtual std::unique_ptr<WallpaperDelegate> CreateWallpaperDelegate() = 0; |  | 
| 100 |  | 
| 101   // Creates a session state delegate. Shell takes ownership of the delegate. |  | 
| 102   virtual SessionStateDelegate* CreateSessionStateDelegate() = 0; |  | 
| 103 |  | 
| 104   // Creates a accessibility delegate. Shell takes ownership of the delegate. |  | 
| 105   virtual AccessibilityDelegate* CreateAccessibilityDelegate() = 0; |  | 
| 106 |  | 
| 107   virtual std::unique_ptr<PaletteDelegate> CreatePaletteDelegate() = 0; |  | 
| 108 |  | 
| 109   // Creates a menu model for the |wm_shelf| and optional shelf |item|. |  | 
| 110   // If |item| is null, this creates a context menu for the wallpaper or shelf. |  | 
| 111   virtual ui::MenuModel* CreateContextMenu(WmShelf* wm_shelf, |  | 
| 112                                            const ShelfItem* item) = 0; |  | 
| 113 |  | 
| 114   // Creates a GPU support object. Shell takes ownership of the object. |  | 
| 115   virtual GPUSupport* CreateGPUSupport() = 0; |  | 
| 116 |  | 
| 117   // Get the product name. |  | 
| 118   virtual base::string16 GetProductName() const = 0; |  | 
| 119 |  | 
| 120   virtual void OpenKeyboardShortcutHelpPage() const {} |  | 
| 121 |  | 
| 122   virtual gfx::Image GetDeprecatedAcceleratorImage() const = 0; |  | 
| 123 |  | 
| 124   // If |use_local_state| is true, returns the touchscreen status from local |  | 
| 125   // state, otherwise from user prefs. |  | 
| 126   virtual bool IsTouchscreenEnabledInPrefs(bool use_local_state) const = 0; |  | 
| 127 |  | 
| 128   // Sets the status of touchscreen to |enabled| in prefs. If |use_local_state|, |  | 
| 129   // pref is set in local state, otherwise in user prefs. |  | 
| 130   virtual void SetTouchscreenEnabledInPrefs(bool enabled, |  | 
| 131                                             bool use_local_state) = 0; |  | 
| 132 |  | 
| 133   // Updates the enabled/disabled status of the touchscreen from prefs. Enabled |  | 
| 134   // if both local state and user prefs are enabled, otherwise disabled. |  | 
| 135   virtual void UpdateTouchscreenStatusFromPrefs() = 0; |  | 
| 136 |  | 
| 137   // Toggles the status of touchpad between enabled and disabled. |  | 
| 138   virtual void ToggleTouchpad() {} |  | 
| 139 }; |  | 
| 140 |  | 
| 141 }  // namespace ash |  | 
| 142 |  | 
| 143 #endif  // ASH_COMMON_SHELL_DELEGATE_H_ |  | 
| OLD | NEW | 
|---|