blob: 342cf8955715977000b7d1642227bb7a7b6983e4 [file] [log] [blame]
jamescook33375732016-07-14 22:09:281// 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 Cookb0bf8e82017-04-09 17:01:449#include "ash/gpu_support_stub.h"
jamescook428f986f2016-07-15 19:13:2510#include "ash/mus/accessibility_delegate_mus.h"
msw0e91d932016-08-25 22:34:0911#include "ash/mus/context_menu_mus.h"
msw7d03b2062016-09-10 00:13:2112#include "ash/mus/wallpaper_delegate_mus.h"
James Cookb0bf8e82017-04-09 17:01:4413#include "ash/palette_delegate.h"
jamescook33375732016-07-14 22:09:2814#include "base/memory/ptr_util.h"
15#include "base/strings/string16.h"
mswccb5d692016-08-17 20:37:4816#include "base/strings/string_util.h"
jamescook33375732016-07-14 22:09:2817#include "components/user_manager/user_info_impl.h"
jamescook33375732016-07-14 22:09:2818#include "ui/gfx/image/image.h"
yhanada8909a542017-07-11 10:06:1919#include "ui/keyboard/keyboard_ui.h"
Scott Violet17a61722017-06-19 17:54:3120#include "services/ui/public/cpp/input_devices/input_device_controller_client.h"
Scott Violet17a61722017-06-19 17:54:3121
jamescook33375732016-07-14 22:09:2822namespace ash {
jamescook33375732016-07-14 22:09:2823
msw0bc6a072017-02-14 16:33:3824ShellDelegateMus::ShellDelegateMus(service_manager::Connector* connector)
25 : connector_(connector) {}
jamescook33375732016-07-14 22:09:2826
27ShellDelegateMus::~ShellDelegateMus() {}
28
rockot400ea35b2016-10-15 19:15:3229service_manager::Connector* ShellDelegateMus::GetShellConnector() const {
jamescook2a6b8692016-10-04 02:41:2930 return connector_;
31}
32
jamescook33375732016-07-14 22:09:2833bool ShellDelegateMus::IsIncognitoAllowed() const {
34 NOTIMPLEMENTED();
35 return false;
36}
37
38bool ShellDelegateMus::IsMultiProfilesEnabled() const {
39 NOTIMPLEMENTED();
James Cooka1c01282017-07-10 19:01:5340 return true; // For manual testing of multi-profile under mash.
jamescook33375732016-07-14 22:09:2841}
42
43bool ShellDelegateMus::IsRunningInForcedAppMode() const {
44 NOTIMPLEMENTED();
45 return false;
46}
47
varkhad43f55242017-05-26 20:55:5848bool ShellDelegateMus::CanShowWindowForUser(aura::Window* window) const {
jamescook33375732016-07-14 22:09:2849 NOTIMPLEMENTED();
50 return true;
51}
52
53bool ShellDelegateMus::IsForceMaximizeOnFirstRun() const {
54 NOTIMPLEMENTED();
55 return false;
56}
57
58void ShellDelegateMus::PreInit() {
59 NOTIMPLEMENTED();
60}
61
62void ShellDelegateMus::PreShutdown() {
63 NOTIMPLEMENTED();
64}
65
66void ShellDelegateMus::Exit() {
67 NOTIMPLEMENTED();
68}
69
yhanada8909a542017-07-11 10:06:1970std::unique_ptr<keyboard::KeyboardUI> ShellDelegateMus::CreateKeyboardUI() {
jamescook33375732016-07-14 22:09:2871 NOTIMPLEMENTED();
72 return nullptr;
73}
74
kenobib7af62b2016-07-29 21:40:1675void ShellDelegateMus::OpenUrlFromArc(const GURL& url) {
jamescook33375732016-07-14 22:09:2876 NOTIMPLEMENTED();
77}
78
msw5138f3d2017-04-20 00:22:0779void ShellDelegateMus::ShelfInit() {
80 NOTIMPLEMENTED();
81}
82
83void ShellDelegateMus::ShelfShutdown() {
84 NOTIMPLEMENTED();
jamescook33375732016-07-14 22:09:2885}
86
James Cook8d5b29f2017-08-16 21:19:0687NetworkingConfigDelegate* 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;
jamescook33375732016-07-14 22:09:2892}
93
msw0e91d932016-08-25 22:34:0994std::unique_ptr<WallpaperDelegate> ShellDelegateMus::CreateWallpaperDelegate() {
mswc691bf12016-10-19 17:05:3995 return base::MakeUnique<WallpaperDelegateMus>();
jamescook33375732016-07-14 22:09:2896}
97
jamescook33375732016-07-14 22:09:2898AccessibilityDelegate* ShellDelegateMus::CreateAccessibilityDelegate() {
jamescook428f986f2016-07-15 19:13:2599 return new AccessibilityDelegateMus(connector_);
jamescook33375732016-07-14 22:09:28100}
101
jdufault0f4fa6e2016-08-05 19:13:59102std::unique_ptr<PaletteDelegate> ShellDelegateMus::CreatePaletteDelegate() {
sky1eb7caa2016-09-16 00:02:46103 // TODO: http://crbug.com/647417.
jdufault0f4fa6e2016-08-05 19:13:59104 NOTIMPLEMENTED();
105 return nullptr;
106}
107
James Cook840177e2017-05-25 02:20:01108ui::MenuModel* ShellDelegateMus::CreateContextMenu(Shelf* shelf,
jamescook33375732016-07-14 22:09:28109 const ShelfItem* item) {
James Cook840177e2017-05-25 02:20:01110 return new ContextMenuMus(shelf);
jamescook33375732016-07-14 22:09:28111}
112
113GPUSupport* ShellDelegateMus::CreateGPUSupport() {
sky1eb7caa2016-09-16 00:02:46114 // TODO: http://crbug.com/647421.
jamescook33375732016-07-14 22:09:28115 NOTIMPLEMENTED() << " Using a stub GPUSupport implementation";
116 return new GPUSupportStub();
117}
118
119base::string16 ShellDelegateMus::GetProductName() const {
120 NOTIMPLEMENTED();
121 return base::string16();
122}
123
124gfx::Image ShellDelegateMus::GetDeprecatedAcceleratorImage() const {
125 NOTIMPLEMENTED();
126 return gfx::Image();
127}
128
warx4c8baedb2016-12-03 22:38:50129bool ShellDelegateMus::IsTouchscreenEnabledInPrefs(bool use_local_state) const {
130 NOTIMPLEMENTED();
131 return true;
132}
133
134void ShellDelegateMus::SetTouchscreenEnabledInPrefs(bool enabled,
135 bool use_local_state) {
136 NOTIMPLEMENTED();
137}
138
139void ShellDelegateMus::UpdateTouchscreenStatusFromPrefs() {
140 NOTIMPLEMENTED();
141}
142
Scott Violet17a61722017-06-19 17:54:31143ui::InputDeviceControllerClient*
144ShellDelegateMus::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 Violet17a61722017-06-19 17:54:31154
jamescook33375732016-07-14 22:09:28155} // namespace ash