| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/mus/shell_delegate_mus.h" | 5 #include "ash/mus/shell_delegate_mus.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "ash/gpu_support_stub.h" | 9 #include "ash/gpu_support_stub.h" |
| 10 #include "ash/mus/accessibility_delegate_mus.h" | 10 #include "ash/mus/accessibility_delegate_mus.h" |
| 11 #include "ash/mus/context_menu_mus.h" | 11 #include "ash/mus/context_menu_mus.h" |
| 12 #include "ash/mus/system_tray_delegate_mus.h" | 12 #include "ash/mus/system_tray_delegate_mus.h" |
| 13 #include "ash/mus/wallpaper_delegate_mus.h" | 13 #include "ash/mus/wallpaper_delegate_mus.h" |
| 14 #include "ash/palette_delegate.h" | 14 #include "ash/palette_delegate.h" |
| 15 #include "ash/session/session_state_delegate.h" | |
| 16 #include "base/memory/ptr_util.h" | 15 #include "base/memory/ptr_util.h" |
| 17 #include "base/strings/string16.h" | 16 #include "base/strings/string16.h" |
| 18 #include "base/strings/string_util.h" | 17 #include "base/strings/string_util.h" |
| 19 #include "components/user_manager/user_info_impl.h" | 18 #include "components/user_manager/user_info_impl.h" |
| 20 #include "ui/gfx/image/image.h" | 19 #include "ui/gfx/image/image.h" |
| 21 | 20 |
| 22 namespace ash { | 21 namespace ash { |
| 23 namespace { | |
| 24 | |
| 25 class SessionStateDelegateStub : public SessionStateDelegate { | |
| 26 public: | |
| 27 SessionStateDelegateStub() : user_info_(new user_manager::UserInfoImpl()) {} | |
| 28 | |
| 29 ~SessionStateDelegateStub() override {} | |
| 30 | |
| 31 // SessionStateDelegate: | |
| 32 bool ShouldShowAvatar(WmWindow* window) const override { | |
| 33 NOTIMPLEMENTED(); | |
| 34 return !user_info_->GetImage().isNull(); | |
| 35 } | |
| 36 gfx::ImageSkia GetAvatarImageForWindow(WmWindow* window) const override { | |
| 37 NOTIMPLEMENTED(); | |
| 38 return gfx::ImageSkia(); | |
| 39 } | |
| 40 | |
| 41 private: | |
| 42 // A pseudo user info. | |
| 43 std::unique_ptr<user_manager::UserInfo> user_info_; | |
| 44 | |
| 45 DISALLOW_COPY_AND_ASSIGN(SessionStateDelegateStub); | |
| 46 }; | |
| 47 | |
| 48 } // namespace | |
| 49 | 22 |
| 50 ShellDelegateMus::ShellDelegateMus(service_manager::Connector* connector) | 23 ShellDelegateMus::ShellDelegateMus(service_manager::Connector* connector) |
| 51 : connector_(connector) {} | 24 : connector_(connector) {} |
| 52 | 25 |
| 53 ShellDelegateMus::~ShellDelegateMus() {} | 26 ShellDelegateMus::~ShellDelegateMus() {} |
| 54 | 27 |
| 55 service_manager::Connector* ShellDelegateMus::GetShellConnector() const { | 28 service_manager::Connector* ShellDelegateMus::GetShellConnector() const { |
| 56 return connector_; | 29 return connector_; |
| 57 } | 30 } |
| 58 | 31 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 } | 84 } |
| 112 | 85 |
| 113 SystemTrayDelegate* ShellDelegateMus::CreateSystemTrayDelegate() { | 86 SystemTrayDelegate* ShellDelegateMus::CreateSystemTrayDelegate() { |
| 114 return new SystemTrayDelegateMus(); | 87 return new SystemTrayDelegateMus(); |
| 115 } | 88 } |
| 116 | 89 |
| 117 std::unique_ptr<WallpaperDelegate> ShellDelegateMus::CreateWallpaperDelegate() { | 90 std::unique_ptr<WallpaperDelegate> ShellDelegateMus::CreateWallpaperDelegate() { |
| 118 return base::MakeUnique<WallpaperDelegateMus>(); | 91 return base::MakeUnique<WallpaperDelegateMus>(); |
| 119 } | 92 } |
| 120 | 93 |
| 121 SessionStateDelegate* ShellDelegateMus::CreateSessionStateDelegate() { | |
| 122 // TODO: http://crbug.com/647416. | |
| 123 NOTIMPLEMENTED() << " Using a stub SessionStateDeleagte implementation"; | |
| 124 return new SessionStateDelegateStub; | |
| 125 } | |
| 126 | |
| 127 AccessibilityDelegate* ShellDelegateMus::CreateAccessibilityDelegate() { | 94 AccessibilityDelegate* ShellDelegateMus::CreateAccessibilityDelegate() { |
| 128 return new AccessibilityDelegateMus(connector_); | 95 return new AccessibilityDelegateMus(connector_); |
| 129 } | 96 } |
| 130 | 97 |
| 131 std::unique_ptr<PaletteDelegate> ShellDelegateMus::CreatePaletteDelegate() { | 98 std::unique_ptr<PaletteDelegate> ShellDelegateMus::CreatePaletteDelegate() { |
| 132 // TODO: http://crbug.com/647417. | 99 // TODO: http://crbug.com/647417. |
| 133 NOTIMPLEMENTED(); | 100 NOTIMPLEMENTED(); |
| 134 return nullptr; | 101 return nullptr; |
| 135 } | 102 } |
| 136 | 103 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 void ShellDelegateMus::SetTouchscreenEnabledInPrefs(bool enabled, | 138 void ShellDelegateMus::SetTouchscreenEnabledInPrefs(bool enabled, |
| 172 bool use_local_state) { | 139 bool use_local_state) { |
| 173 NOTIMPLEMENTED(); | 140 NOTIMPLEMENTED(); |
| 174 } | 141 } |
| 175 | 142 |
| 176 void ShellDelegateMus::UpdateTouchscreenStatusFromPrefs() { | 143 void ShellDelegateMus::UpdateTouchscreenStatusFromPrefs() { |
| 177 NOTIMPLEMENTED(); | 144 NOTIMPLEMENTED(); |
| 178 } | 145 } |
| 179 | 146 |
| 180 } // namespace ash | 147 } // namespace ash |
| OLD | NEW |