| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ASH_COMMON_SHELL_DELEGATE_H_ | 5 #ifndef ASH_COMMON_SHELL_DELEGATE_H_ |
| 6 #define ASH_COMMON_SHELL_DELEGATE_H_ | 6 #define ASH_COMMON_SHELL_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "ash/ash_export.h" | 11 #include "ash/ash_export.h" |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
| 14 | 14 |
| 15 class GURL; | 15 class GURL; |
| 16 | 16 |
| 17 namespace content { |
| 18 class WebContents; |
| 19 } |
| 20 |
| 17 namespace gfx { | 21 namespace gfx { |
| 18 class Image; | 22 class Image; |
| 19 } | 23 } |
| 20 | 24 |
| 21 namespace keyboard { | 25 namespace keyboard { |
| 22 class KeyboardUI; | 26 class KeyboardUI; |
| 23 } | 27 } |
| 24 | 28 |
| 25 namespace service_manager { | 29 namespace service_manager { |
| 26 class Connector; | 30 class Connector; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 // can perform tasks necessary before the shell is initialized. | 80 // can perform tasks necessary before the shell is initialized. |
| 77 virtual void PreInit() = 0; | 81 virtual void PreInit() = 0; |
| 78 | 82 |
| 79 // Called at the beginninig of Shell destructor so that | 83 // Called at the beginninig of Shell destructor so that |
| 80 // delegate can use Shell instance to perform cleanup tasks. | 84 // delegate can use Shell instance to perform cleanup tasks. |
| 81 virtual void PreShutdown() = 0; | 85 virtual void PreShutdown() = 0; |
| 82 | 86 |
| 83 // Invoked when the user uses Ctrl-Shift-Q to close chrome. | 87 // Invoked when the user uses Ctrl-Shift-Q to close chrome. |
| 84 virtual void Exit() = 0; | 88 virtual void Exit() = 0; |
| 85 | 89 |
| 86 // Create a shell-specific keyboard::KeyboardUI | 90 // Creates a shell-specific keyboard::KeyboardUI |
| 87 virtual keyboard::KeyboardUI* CreateKeyboardUI() = 0; | 91 virtual keyboard::KeyboardUI* CreateKeyboardUI() = 0; |
| 88 | 92 |
| 89 // Opens the |url| in a new browser tab. | 93 // Opens the |url| in a new browser tab. |
| 90 virtual void OpenUrlFromArc(const GURL& url) = 0; | 94 virtual void OpenUrlFromArc(const GURL& url) = 0; |
| 91 | 95 |
| 92 // Creates a new ShelfDelegate. Shell takes ownership of the returned value. | 96 // Creates a new ShelfDelegate. Shell takes ownership of the returned value. |
| 93 virtual ShelfDelegate* CreateShelfDelegate(ShelfModel* model) = 0; | 97 virtual ShelfDelegate* CreateShelfDelegate(ShelfModel* model) = 0; |
| 94 | 98 |
| 95 // Creates a system-tray delegate. Shell takes ownership of the delegate. | 99 // Creates a system-tray delegate. Shell takes ownership of the delegate. |
| 96 virtual SystemTrayDelegate* CreateSystemTrayDelegate() = 0; | 100 virtual SystemTrayDelegate* CreateSystemTrayDelegate() = 0; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 107 virtual std::unique_ptr<PaletteDelegate> CreatePaletteDelegate() = 0; | 111 virtual std::unique_ptr<PaletteDelegate> CreatePaletteDelegate() = 0; |
| 108 | 112 |
| 109 // Creates a menu model for the |wm_shelf| and optional shelf |item|. | 113 // 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. | 114 // If |item| is null, this creates a context menu for the wallpaper or shelf. |
| 111 virtual ui::MenuModel* CreateContextMenu(WmShelf* wm_shelf, | 115 virtual ui::MenuModel* CreateContextMenu(WmShelf* wm_shelf, |
| 112 const ShelfItem* item) = 0; | 116 const ShelfItem* item) = 0; |
| 113 | 117 |
| 114 // Creates a GPU support object. Shell takes ownership of the object. | 118 // Creates a GPU support object. Shell takes ownership of the object. |
| 115 virtual GPUSupport* CreateGPUSupport() = 0; | 119 virtual GPUSupport* CreateGPUSupport() = 0; |
| 116 | 120 |
| 117 // Get the product name. | 121 // Gets the product name. |
| 118 virtual base::string16 GetProductName() const = 0; | 122 virtual base::string16 GetProductName() const = 0; |
| 119 | 123 |
| 120 virtual void OpenKeyboardShortcutHelpPage() const {} | 124 virtual void OpenKeyboardShortcutHelpPage() const {} |
| 121 | 125 |
| 122 virtual gfx::Image GetDeprecatedAcceleratorImage() const = 0; | 126 virtual gfx::Image GetDeprecatedAcceleratorImage() const = 0; |
| 123 | 127 |
| 124 // If |use_local_state| is true, returns the touchscreen status from local | 128 // If |use_local_state| is true, returns the touchscreen status from local |
| 125 // state, otherwise from user prefs. | 129 // state, otherwise from user prefs. |
| 126 virtual bool IsTouchscreenEnabledInPrefs(bool use_local_state) const = 0; | 130 virtual bool IsTouchscreenEnabledInPrefs(bool use_local_state) const = 0; |
| 127 | 131 |
| 128 // Sets the status of touchscreen to |enabled| in prefs. If |use_local_state|, | 132 // Sets the status of touchscreen to |enabled| in prefs. If |use_local_state|, |
| 129 // pref is set in local state, otherwise in user prefs. | 133 // pref is set in local state, otherwise in user prefs. |
| 130 virtual void SetTouchscreenEnabledInPrefs(bool enabled, | 134 virtual void SetTouchscreenEnabledInPrefs(bool enabled, |
| 131 bool use_local_state) = 0; | 135 bool use_local_state) = 0; |
| 132 | 136 |
| 133 // Updates the enabled/disabled status of the touchscreen from prefs. Enabled | 137 // Updates the enabled/disabled status of the touchscreen from prefs. Enabled |
| 134 // if both local state and user prefs are enabled, otherwise disabled. | 138 // if both local state and user prefs are enabled, otherwise disabled. |
| 135 virtual void UpdateTouchscreenStatusFromPrefs() = 0; | 139 virtual void UpdateTouchscreenStatusFromPrefs() = 0; |
| 136 | 140 |
| 137 // Toggles the status of touchpad between enabled and disabled. | 141 // Toggles the status of touchpad between enabled and disabled. |
| 138 virtual void ToggleTouchpad() {} | 142 virtual void ToggleTouchpad() {} |
| 143 |
| 144 // Gets the WebContents. |
| 145 virtual content::WebContents* GetWebContents() = 0; |
| 139 }; | 146 }; |
| 140 | 147 |
| 141 } // namespace ash | 148 } // namespace ash |
| 142 | 149 |
| 143 #endif // ASH_COMMON_SHELL_DELEGATE_H_ | 150 #endif // ASH_COMMON_SHELL_DELEGATE_H_ |
| OLD | NEW |