| OLD | NEW |
| (Empty) |
| 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/sysui/shell_delegate_mus.h" | |
| 6 | |
| 7 #include "ash/common/default_accessibility_delegate.h" | |
| 8 #include "ash/common/gpu_support_stub.h" | |
| 9 #include "ash/common/media_delegate.h" | |
| 10 #include "ash/common/palette_delegate.h" | |
| 11 #include "ash/common/session/session_state_delegate.h" | |
| 12 #include "ash/common/system/tray/default_system_tray_delegate.h" | |
| 13 #include "ash/common/wallpaper/wallpaper_delegate.h" | |
| 14 #include "base/memory/ptr_util.h" | |
| 15 #include "base/strings/string16.h" | |
| 16 #include "components/user_manager/user_info_impl.h" | |
| 17 #include "ui/gfx/image/image.h" | |
| 18 | |
| 19 namespace ash { | |
| 20 namespace sysui { | |
| 21 | |
| 22 namespace { | |
| 23 | |
| 24 class SessionStateDelegateStub : public SessionStateDelegate { | |
| 25 public: | |
| 26 SessionStateDelegateStub() | |
| 27 : screen_locked_(false), user_info_(new user_manager::UserInfoImpl()) {} | |
| 28 | |
| 29 ~SessionStateDelegateStub() override {} | |
| 30 | |
| 31 // SessionStateDelegate: | |
| 32 int GetMaximumNumberOfLoggedInUsers() const override { return 3; } | |
| 33 int NumberOfLoggedInUsers() const override { | |
| 34 // ash_shell has 2 users. | |
| 35 return 2; | |
| 36 } | |
| 37 bool IsActiveUserSessionStarted() const override { return true; } | |
| 38 bool CanLockScreen() const override { return true; } | |
| 39 bool IsScreenLocked() const override { return screen_locked_; } | |
| 40 bool ShouldLockScreenBeforeSuspending() const override { return false; } | |
| 41 void LockScreen() override { | |
| 42 screen_locked_ = true; | |
| 43 NOTIMPLEMENTED(); | |
| 44 } | |
| 45 void UnlockScreen() override { | |
| 46 NOTIMPLEMENTED(); | |
| 47 screen_locked_ = false; | |
| 48 } | |
| 49 bool IsUserSessionBlocked() const override { return false; } | |
| 50 SessionState GetSessionState() const override { return SESSION_STATE_ACTIVE; } | |
| 51 const user_manager::UserInfo* GetUserInfo(UserIndex index) const override { | |
| 52 return user_info_.get(); | |
| 53 } | |
| 54 bool ShouldShowAvatar(WmWindow* window) const override { | |
| 55 NOTIMPLEMENTED(); | |
| 56 return !user_info_->GetImage().isNull(); | |
| 57 } | |
| 58 gfx::ImageSkia GetAvatarImageForWindow(WmWindow* window) const override { | |
| 59 NOTIMPLEMENTED(); | |
| 60 return gfx::ImageSkia(); | |
| 61 } | |
| 62 void SwitchActiveUser(const AccountId& account_id) override {} | |
| 63 void CycleActiveUser(CycleUser cycle_user) override {} | |
| 64 bool IsMultiProfileAllowedByPrimaryUserPolicy() const override { | |
| 65 return true; | |
| 66 } | |
| 67 void AddSessionStateObserver(ash::SessionStateObserver* observer) override {} | |
| 68 void RemoveSessionStateObserver( | |
| 69 ash::SessionStateObserver* observer) override {} | |
| 70 | |
| 71 private: | |
| 72 bool screen_locked_; | |
| 73 | |
| 74 // A pseudo user info. | |
| 75 std::unique_ptr<user_manager::UserInfo> user_info_; | |
| 76 | |
| 77 DISALLOW_COPY_AND_ASSIGN(SessionStateDelegateStub); | |
| 78 }; | |
| 79 | |
| 80 class MediaDelegateStub : public MediaDelegate { | |
| 81 public: | |
| 82 MediaDelegateStub() {} | |
| 83 ~MediaDelegateStub() override {} | |
| 84 | |
| 85 // MediaDelegate: | |
| 86 void HandleMediaNextTrack() override { NOTIMPLEMENTED(); } | |
| 87 void HandleMediaPlayPause() override { NOTIMPLEMENTED(); } | |
| 88 void HandleMediaPrevTrack() override { NOTIMPLEMENTED(); } | |
| 89 MediaCaptureState GetMediaCaptureState(UserIndex index) override { | |
| 90 NOTIMPLEMENTED(); | |
| 91 return MEDIA_CAPTURE_NONE; | |
| 92 } | |
| 93 | |
| 94 private: | |
| 95 DISALLOW_COPY_AND_ASSIGN(MediaDelegateStub); | |
| 96 }; | |
| 97 | |
| 98 } // namespace | |
| 99 | |
| 100 ShellDelegateMus::ShellDelegateMus() {} | |
| 101 | |
| 102 ShellDelegateMus::~ShellDelegateMus() {} | |
| 103 | |
| 104 bool ShellDelegateMus::IsFirstRunAfterBoot() const { | |
| 105 NOTIMPLEMENTED(); | |
| 106 return false; | |
| 107 } | |
| 108 | |
| 109 bool ShellDelegateMus::IsIncognitoAllowed() const { | |
| 110 NOTIMPLEMENTED(); | |
| 111 return false; | |
| 112 } | |
| 113 | |
| 114 bool ShellDelegateMus::IsMultiProfilesEnabled() const { | |
| 115 NOTIMPLEMENTED(); | |
| 116 return false; | |
| 117 } | |
| 118 | |
| 119 bool ShellDelegateMus::IsRunningInForcedAppMode() const { | |
| 120 NOTIMPLEMENTED(); | |
| 121 return false; | |
| 122 } | |
| 123 | |
| 124 bool ShellDelegateMus::CanShowWindowForUser(WmWindow* window) const { | |
| 125 NOTIMPLEMENTED(); | |
| 126 return true; | |
| 127 } | |
| 128 | |
| 129 bool ShellDelegateMus::IsForceMaximizeOnFirstRun() const { | |
| 130 NOTIMPLEMENTED(); | |
| 131 return false; | |
| 132 } | |
| 133 | |
| 134 void ShellDelegateMus::PreInit() { | |
| 135 NOTIMPLEMENTED(); | |
| 136 } | |
| 137 | |
| 138 void ShellDelegateMus::PreShutdown() { | |
| 139 NOTIMPLEMENTED(); | |
| 140 } | |
| 141 | |
| 142 void ShellDelegateMus::Exit() { | |
| 143 NOTIMPLEMENTED(); | |
| 144 } | |
| 145 | |
| 146 keyboard::KeyboardUI* ShellDelegateMus::CreateKeyboardUI() { | |
| 147 NOTIMPLEMENTED(); | |
| 148 return nullptr; | |
| 149 } | |
| 150 | |
| 151 void ShellDelegateMus::OpenUrlFromArc(const GURL& url) { | |
| 152 NOTIMPLEMENTED(); | |
| 153 } | |
| 154 | |
| 155 app_list::AppListPresenter* ShellDelegateMus::GetAppListPresenter() { | |
| 156 NOTIMPLEMENTED(); | |
| 157 return nullptr; | |
| 158 } | |
| 159 | |
| 160 ShelfDelegate* ShellDelegateMus::CreateShelfDelegate(ShelfModel* model) { | |
| 161 NOTIMPLEMENTED(); | |
| 162 return nullptr; | |
| 163 } | |
| 164 | |
| 165 SystemTrayDelegate* ShellDelegateMus::CreateSystemTrayDelegate() { | |
| 166 NOTIMPLEMENTED() << " Using the default SystemTrayDelegate implementation"; | |
| 167 return new DefaultSystemTrayDelegate; | |
| 168 } | |
| 169 | |
| 170 std::unique_ptr<WallpaperDelegate> ShellDelegateMus::CreateWallpaperDelegate() { | |
| 171 NOTIMPLEMENTED(); | |
| 172 return nullptr; | |
| 173 } | |
| 174 | |
| 175 SessionStateDelegate* ShellDelegateMus::CreateSessionStateDelegate() { | |
| 176 NOTIMPLEMENTED() << " Using a stub SessionStateDeleagte implementation"; | |
| 177 return new SessionStateDelegateStub; | |
| 178 } | |
| 179 | |
| 180 AccessibilityDelegate* ShellDelegateMus::CreateAccessibilityDelegate() { | |
| 181 NOTIMPLEMENTED() << " Using the default AccessibilityDelegate implementation"; | |
| 182 return new DefaultAccessibilityDelegate; | |
| 183 } | |
| 184 | |
| 185 NewWindowDelegate* ShellDelegateMus::CreateNewWindowDelegate() { | |
| 186 NOTIMPLEMENTED(); | |
| 187 return nullptr; | |
| 188 } | |
| 189 | |
| 190 MediaDelegate* ShellDelegateMus::CreateMediaDelegate() { | |
| 191 NOTIMPLEMENTED() << " Using a stub MediaDelegate implementation"; | |
| 192 return new MediaDelegateStub; | |
| 193 } | |
| 194 | |
| 195 std::unique_ptr<PaletteDelegate> ShellDelegateMus::CreatePaletteDelegate() { | |
| 196 NOTIMPLEMENTED(); | |
| 197 return nullptr; | |
| 198 } | |
| 199 | |
| 200 ui::MenuModel* ShellDelegateMus::CreateContextMenu(WmShelf* wm_shelf, | |
| 201 const ShelfItem* item) { | |
| 202 NOTIMPLEMENTED(); | |
| 203 return nullptr; | |
| 204 } | |
| 205 | |
| 206 GPUSupport* ShellDelegateMus::CreateGPUSupport() { | |
| 207 NOTIMPLEMENTED() << " Using a stub GPUSupport implementation"; | |
| 208 return new GPUSupportStub(); | |
| 209 } | |
| 210 | |
| 211 base::string16 ShellDelegateMus::GetProductName() const { | |
| 212 NOTIMPLEMENTED(); | |
| 213 return base::string16(); | |
| 214 } | |
| 215 | |
| 216 gfx::Image ShellDelegateMus::GetDeprecatedAcceleratorImage() const { | |
| 217 NOTIMPLEMENTED(); | |
| 218 return gfx::Image(); | |
| 219 } | |
| 220 | |
| 221 } // namespace sysui | |
| 222 } // namespace ash | |
| OLD | NEW |