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