jamescook | 3337573 | 2016-07-14 22:09:28 | [diff] [blame] | 1 | // Copyright 2016 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 | #include "ash/mus/shell_delegate_mus.h" |
| 6 | |
| 7 | #include <utility> |
| 8 | |
James Cook | b0bf8e8 | 2017-04-09 17:01:44 | [diff] [blame] | 9 | #include "ash/gpu_support_stub.h" |
jamescook | 428f986f | 2016-07-15 19:13:25 | [diff] [blame] | 10 | #include "ash/mus/accessibility_delegate_mus.h" |
msw | 0e91d93 | 2016-08-25 22:34:09 | [diff] [blame] | 11 | #include "ash/mus/context_menu_mus.h" |
msw | 7d03b206 | 2016-09-10 00:13:21 | [diff] [blame] | 12 | #include "ash/mus/wallpaper_delegate_mus.h" |
James Cook | b0bf8e8 | 2017-04-09 17:01:44 | [diff] [blame] | 13 | #include "ash/palette_delegate.h" |
jamescook | 3337573 | 2016-07-14 22:09:28 | [diff] [blame] | 14 | #include "base/memory/ptr_util.h" |
| 15 | #include "base/strings/string16.h" |
msw | ccb5d69 | 2016-08-17 20:37:48 | [diff] [blame] | 16 | #include "base/strings/string_util.h" |
jamescook | 3337573 | 2016-07-14 22:09:28 | [diff] [blame] | 17 | #include "components/user_manager/user_info_impl.h" |
jamescook | 3337573 | 2016-07-14 22:09:28 | [diff] [blame] | 18 | #include "ui/gfx/image/image.h" |
yhanada | 8909a54 | 2017-07-11 10:06:19 | [diff] [blame] | 19 | #include "ui/keyboard/keyboard_ui.h" |
Scott Violet | 17a6172 | 2017-06-19 17:54:31 | [diff] [blame] | 20 | #include "services/ui/public/cpp/input_devices/input_device_controller_client.h" |
Scott Violet | 17a6172 | 2017-06-19 17:54:31 | [diff] [blame] | 21 | |
jamescook | 3337573 | 2016-07-14 22:09:28 | [diff] [blame] | 22 | namespace ash { |
jamescook | 3337573 | 2016-07-14 22:09:28 | [diff] [blame] | 23 | |
msw | 0bc6a07 | 2017-02-14 16:33:38 | [diff] [blame] | 24 | ShellDelegateMus::ShellDelegateMus(service_manager::Connector* connector) |
| 25 | : connector_(connector) {} |
jamescook | 3337573 | 2016-07-14 22:09:28 | [diff] [blame] | 26 | |
| 27 | ShellDelegateMus::~ShellDelegateMus() {} |
| 28 | |
rockot | 400ea35b | 2016-10-15 19:15:32 | [diff] [blame] | 29 | service_manager::Connector* ShellDelegateMus::GetShellConnector() const { |
jamescook | 2a6b869 | 2016-10-04 02:41:29 | [diff] [blame] | 30 | return connector_; |
| 31 | } |
| 32 | |
jamescook | 3337573 | 2016-07-14 22:09:28 | [diff] [blame] | 33 | bool ShellDelegateMus::IsIncognitoAllowed() const { |
| 34 | NOTIMPLEMENTED(); |
| 35 | return false; |
| 36 | } |
| 37 | |
| 38 | bool ShellDelegateMus::IsMultiProfilesEnabled() const { |
| 39 | NOTIMPLEMENTED(); |
James Cook | a1c0128 | 2017-07-10 19:01:53 | [diff] [blame] | 40 | return true; // For manual testing of multi-profile under mash. |
jamescook | 3337573 | 2016-07-14 22:09:28 | [diff] [blame] | 41 | } |
| 42 | |
| 43 | bool ShellDelegateMus::IsRunningInForcedAppMode() const { |
| 44 | NOTIMPLEMENTED(); |
| 45 | return false; |
| 46 | } |
| 47 | |
varkha | d43f5524 | 2017-05-26 20:55:58 | [diff] [blame] | 48 | bool ShellDelegateMus::CanShowWindowForUser(aura::Window* window) const { |
jamescook | 3337573 | 2016-07-14 22:09:28 | [diff] [blame] | 49 | NOTIMPLEMENTED(); |
| 50 | return true; |
| 51 | } |
| 52 | |
| 53 | bool ShellDelegateMus::IsForceMaximizeOnFirstRun() const { |
| 54 | NOTIMPLEMENTED(); |
| 55 | return false; |
| 56 | } |
| 57 | |
| 58 | void ShellDelegateMus::PreInit() { |
| 59 | NOTIMPLEMENTED(); |
| 60 | } |
| 61 | |
| 62 | void ShellDelegateMus::PreShutdown() { |
| 63 | NOTIMPLEMENTED(); |
| 64 | } |
| 65 | |
| 66 | void ShellDelegateMus::Exit() { |
| 67 | NOTIMPLEMENTED(); |
| 68 | } |
| 69 | |
yhanada | 8909a54 | 2017-07-11 10:06:19 | [diff] [blame] | 70 | std::unique_ptr<keyboard::KeyboardUI> ShellDelegateMus::CreateKeyboardUI() { |
jamescook | 3337573 | 2016-07-14 22:09:28 | [diff] [blame] | 71 | NOTIMPLEMENTED(); |
| 72 | return nullptr; |
| 73 | } |
| 74 | |
kenobi | b7af62b | 2016-07-29 21:40:16 | [diff] [blame] | 75 | void ShellDelegateMus::OpenUrlFromArc(const GURL& url) { |
jamescook | 3337573 | 2016-07-14 22:09:28 | [diff] [blame] | 76 | NOTIMPLEMENTED(); |
| 77 | } |
| 78 | |
msw | 5138f3d | 2017-04-20 00:22:07 | [diff] [blame] | 79 | void ShellDelegateMus::ShelfInit() { |
| 80 | NOTIMPLEMENTED(); |
| 81 | } |
| 82 | |
| 83 | void ShellDelegateMus::ShelfShutdown() { |
| 84 | NOTIMPLEMENTED(); |
jamescook | 3337573 | 2016-07-14 22:09:28 | [diff] [blame] | 85 | } |
| 86 | |
James Cook | 8d5b29f | 2017-08-16 21:19:06 | [diff] [blame^] | 87 | NetworkingConfigDelegate* ShellDelegateMus::GetNetworkingConfigDelegate() { |
| 88 | // TODO(mash): Provide a real implementation, perhaps by folding its behavior |
| 89 | // into an ash-side network information cache. http://crbug.com/651157 |
| 90 | NOTIMPLEMENTED(); |
| 91 | return nullptr; |
jamescook | 3337573 | 2016-07-14 22:09:28 | [diff] [blame] | 92 | } |
| 93 | |
msw | 0e91d93 | 2016-08-25 22:34:09 | [diff] [blame] | 94 | std::unique_ptr<WallpaperDelegate> ShellDelegateMus::CreateWallpaperDelegate() { |
msw | c691bf1 | 2016-10-19 17:05:39 | [diff] [blame] | 95 | return base::MakeUnique<WallpaperDelegateMus>(); |
jamescook | 3337573 | 2016-07-14 22:09:28 | [diff] [blame] | 96 | } |
| 97 | |
jamescook | 3337573 | 2016-07-14 22:09:28 | [diff] [blame] | 98 | AccessibilityDelegate* ShellDelegateMus::CreateAccessibilityDelegate() { |
jamescook | 428f986f | 2016-07-15 19:13:25 | [diff] [blame] | 99 | return new AccessibilityDelegateMus(connector_); |
jamescook | 3337573 | 2016-07-14 22:09:28 | [diff] [blame] | 100 | } |
| 101 | |
jdufault | 0f4fa6e | 2016-08-05 19:13:59 | [diff] [blame] | 102 | std::unique_ptr<PaletteDelegate> ShellDelegateMus::CreatePaletteDelegate() { |
sky | 1eb7caa | 2016-09-16 00:02:46 | [diff] [blame] | 103 | // TODO: http://crbug.com/647417. |
jdufault | 0f4fa6e | 2016-08-05 19:13:59 | [diff] [blame] | 104 | NOTIMPLEMENTED(); |
| 105 | return nullptr; |
| 106 | } |
| 107 | |
James Cook | 840177e | 2017-05-25 02:20:01 | [diff] [blame] | 108 | ui::MenuModel* ShellDelegateMus::CreateContextMenu(Shelf* shelf, |
jamescook | 3337573 | 2016-07-14 22:09:28 | [diff] [blame] | 109 | const ShelfItem* item) { |
James Cook | 840177e | 2017-05-25 02:20:01 | [diff] [blame] | 110 | return new ContextMenuMus(shelf); |
jamescook | 3337573 | 2016-07-14 22:09:28 | [diff] [blame] | 111 | } |
| 112 | |
| 113 | GPUSupport* ShellDelegateMus::CreateGPUSupport() { |
sky | 1eb7caa | 2016-09-16 00:02:46 | [diff] [blame] | 114 | // TODO: http://crbug.com/647421. |
jamescook | 3337573 | 2016-07-14 22:09:28 | [diff] [blame] | 115 | NOTIMPLEMENTED() << " Using a stub GPUSupport implementation"; |
| 116 | return new GPUSupportStub(); |
| 117 | } |
| 118 | |
| 119 | base::string16 ShellDelegateMus::GetProductName() const { |
| 120 | NOTIMPLEMENTED(); |
| 121 | return base::string16(); |
| 122 | } |
| 123 | |
| 124 | gfx::Image ShellDelegateMus::GetDeprecatedAcceleratorImage() const { |
| 125 | NOTIMPLEMENTED(); |
| 126 | return gfx::Image(); |
| 127 | } |
| 128 | |
warx | 4c8baedb | 2016-12-03 22:38:50 | [diff] [blame] | 129 | bool ShellDelegateMus::IsTouchscreenEnabledInPrefs(bool use_local_state) const { |
| 130 | NOTIMPLEMENTED(); |
| 131 | return true; |
| 132 | } |
| 133 | |
| 134 | void ShellDelegateMus::SetTouchscreenEnabledInPrefs(bool enabled, |
| 135 | bool use_local_state) { |
| 136 | NOTIMPLEMENTED(); |
| 137 | } |
| 138 | |
| 139 | void ShellDelegateMus::UpdateTouchscreenStatusFromPrefs() { |
| 140 | NOTIMPLEMENTED(); |
| 141 | } |
| 142 | |
Scott Violet | 17a6172 | 2017-06-19 17:54:31 | [diff] [blame] | 143 | ui::InputDeviceControllerClient* |
| 144 | ShellDelegateMus::GetInputDeviceControllerClient() { |
| 145 | if (!connector_) |
| 146 | return nullptr; // Happens in tests. |
| 147 | |
| 148 | if (!input_device_controller_client_) { |
| 149 | input_device_controller_client_ = |
| 150 | base::MakeUnique<ui::InputDeviceControllerClient>(connector_); |
| 151 | } |
| 152 | return input_device_controller_client_.get(); |
| 153 | } |
Scott Violet | 17a6172 | 2017-06-19 17:54:31 | [diff] [blame] | 154 | |
jamescook | 3337573 | 2016-07-14 22:09:28 | [diff] [blame] | 155 | } // namespace ash |