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