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 | |
Mitsuru Oshima | 04b54d0 | 2017-10-09 14:22:45 | [diff] [blame^] | 7 | #include <memory> |
jamescook | 3337573 | 2016-07-14 22:09:28 | [diff] [blame] | 8 | #include <utility> |
| 9 | |
James Cook | 37b7d10 | 2017-10-06 04:35:19 | [diff] [blame] | 10 | #include "ash/accessibility/default_accessibility_delegate.h" |
James Cook | b0bf8e8 | 2017-04-09 17:01:44 | [diff] [blame] | 11 | #include "ash/gpu_support_stub.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/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" |
James Cook | 5fbdccb | 2017-09-01 21:17:55 | [diff] [blame] | 17 | #include "services/ui/public/cpp/input_devices/input_device_controller_client.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 | |
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::IsRunningInForcedAppMode() const { |
| 33 | NOTIMPLEMENTED(); |
| 34 | return false; |
| 35 | } |
| 36 | |
varkha | d43f5524 | 2017-05-26 20:55:58 | [diff] [blame] | 37 | bool ShellDelegateMus::CanShowWindowForUser(aura::Window* window) const { |
jamescook | 3337573 | 2016-07-14 22:09:28 | [diff] [blame] | 38 | NOTIMPLEMENTED(); |
| 39 | return true; |
| 40 | } |
| 41 | |
| 42 | bool ShellDelegateMus::IsForceMaximizeOnFirstRun() const { |
| 43 | NOTIMPLEMENTED(); |
| 44 | return false; |
| 45 | } |
| 46 | |
| 47 | void ShellDelegateMus::PreInit() { |
| 48 | NOTIMPLEMENTED(); |
| 49 | } |
| 50 | |
| 51 | void ShellDelegateMus::PreShutdown() { |
| 52 | NOTIMPLEMENTED(); |
| 53 | } |
| 54 | |
yhanada | 8909a54 | 2017-07-11 10:06:19 | [diff] [blame] | 55 | std::unique_ptr<keyboard::KeyboardUI> ShellDelegateMus::CreateKeyboardUI() { |
jamescook | 3337573 | 2016-07-14 22:09:28 | [diff] [blame] | 56 | NOTIMPLEMENTED(); |
| 57 | return nullptr; |
| 58 | } |
| 59 | |
kenobi | b7af62b | 2016-07-29 21:40:16 | [diff] [blame] | 60 | void ShellDelegateMus::OpenUrlFromArc(const GURL& url) { |
jamescook | 3337573 | 2016-07-14 22:09:28 | [diff] [blame] | 61 | NOTIMPLEMENTED(); |
| 62 | } |
| 63 | |
James Cook | 8d5b29f | 2017-08-16 21:19:06 | [diff] [blame] | 64 | NetworkingConfigDelegate* ShellDelegateMus::GetNetworkingConfigDelegate() { |
| 65 | // TODO(mash): Provide a real implementation, perhaps by folding its behavior |
| 66 | // into an ash-side network information cache. http://crbug.com/651157 |
| 67 | NOTIMPLEMENTED(); |
| 68 | return nullptr; |
jamescook | 3337573 | 2016-07-14 22:09:28 | [diff] [blame] | 69 | } |
| 70 | |
msw | 0e91d93 | 2016-08-25 22:34:09 | [diff] [blame] | 71 | std::unique_ptr<WallpaperDelegate> ShellDelegateMus::CreateWallpaperDelegate() { |
Mitsuru Oshima | 04b54d0 | 2017-10-09 14:22:45 | [diff] [blame^] | 72 | return std::make_unique<WallpaperDelegateMus>(); |
jamescook | 3337573 | 2016-07-14 22:09:28 | [diff] [blame] | 73 | } |
| 74 | |
jamescook | 3337573 | 2016-07-14 22:09:28 | [diff] [blame] | 75 | AccessibilityDelegate* ShellDelegateMus::CreateAccessibilityDelegate() { |
James Cook | 5fbdccb | 2017-09-01 21:17:55 | [diff] [blame] | 76 | return new DefaultAccessibilityDelegate; |
jamescook | 3337573 | 2016-07-14 22:09:28 | [diff] [blame] | 77 | } |
| 78 | |
jdufault | 0f4fa6e | 2016-08-05 19:13:59 | [diff] [blame] | 79 | std::unique_ptr<PaletteDelegate> ShellDelegateMus::CreatePaletteDelegate() { |
sky | 1eb7caa | 2016-09-16 00:02:46 | [diff] [blame] | 80 | // TODO: http://crbug.com/647417. |
jdufault | 0f4fa6e | 2016-08-05 19:13:59 | [diff] [blame] | 81 | NOTIMPLEMENTED(); |
| 82 | return nullptr; |
| 83 | } |
| 84 | |
jamescook | 3337573 | 2016-07-14 22:09:28 | [diff] [blame] | 85 | GPUSupport* ShellDelegateMus::CreateGPUSupport() { |
sky | 1eb7caa | 2016-09-16 00:02:46 | [diff] [blame] | 86 | // TODO: http://crbug.com/647421. |
jamescook | 3337573 | 2016-07-14 22:09:28 | [diff] [blame] | 87 | NOTIMPLEMENTED() << " Using a stub GPUSupport implementation"; |
| 88 | return new GPUSupportStub(); |
| 89 | } |
| 90 | |
| 91 | base::string16 ShellDelegateMus::GetProductName() const { |
| 92 | NOTIMPLEMENTED(); |
| 93 | return base::string16(); |
| 94 | } |
| 95 | |
| 96 | gfx::Image ShellDelegateMus::GetDeprecatedAcceleratorImage() const { |
| 97 | NOTIMPLEMENTED(); |
| 98 | return gfx::Image(); |
| 99 | } |
| 100 | |
Scott Violet | 17a6172 | 2017-06-19 17:54:31 | [diff] [blame] | 101 | ui::InputDeviceControllerClient* |
| 102 | ShellDelegateMus::GetInputDeviceControllerClient() { |
| 103 | if (!connector_) |
| 104 | return nullptr; // Happens in tests. |
| 105 | |
| 106 | if (!input_device_controller_client_) { |
| 107 | input_device_controller_client_ = |
Mitsuru Oshima | 04b54d0 | 2017-10-09 14:22:45 | [diff] [blame^] | 108 | std::make_unique<ui::InputDeviceControllerClient>(connector_); |
Scott Violet | 17a6172 | 2017-06-19 17:54:31 | [diff] [blame] | 109 | } |
| 110 | return input_device_controller_client_.get(); |
| 111 | } |
Scott Violet | 17a6172 | 2017-06-19 17:54:31 | [diff] [blame] | 112 | |
jamescook | 3337573 | 2016-07-14 22:09:28 | [diff] [blame] | 113 | } // namespace ash |