Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: ash/mus/shell_delegate_mus.cc

Issue 2734933004: ash: Use SessionController instead of SessionStateDelegate (Closed)
Patch Set: rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/common/gpu_support_stub.h" 9 #include "ash/common/gpu_support_stub.h"
10 #include "ash/common/palette_delegate.h" 10 #include "ash/common/palette_delegate.h"
11 #include "ash/common/session/session_state_delegate.h" 11 #include "ash/common/session/session_state_delegate.h"
12 #include "ash/common/wm_shell.h" 12 #include "ash/common/wm_shell.h"
13 #include "ash/mus/accessibility_delegate_mus.h" 13 #include "ash/mus/accessibility_delegate_mus.h"
14 #include "ash/mus/context_menu_mus.h" 14 #include "ash/mus/context_menu_mus.h"
15 #include "ash/mus/shelf_delegate_mus.h" 15 #include "ash/mus/shelf_delegate_mus.h"
16 #include "ash/mus/system_tray_delegate_mus.h" 16 #include "ash/mus/system_tray_delegate_mus.h"
17 #include "ash/mus/wallpaper_delegate_mus.h" 17 #include "ash/mus/wallpaper_delegate_mus.h"
18 #include "base/memory/ptr_util.h" 18 #include "base/memory/ptr_util.h"
19 #include "base/strings/string16.h" 19 #include "base/strings/string16.h"
20 #include "base/strings/string_util.h" 20 #include "base/strings/string_util.h"
21 #include "components/user_manager/user_info_impl.h" 21 #include "components/user_manager/user_info_impl.h"
22 #include "ui/gfx/image/image.h" 22 #include "ui/gfx/image/image.h"
23 23
24 namespace ash { 24 namespace ash {
25 namespace { 25 namespace {
26 26
27 class SessionStateDelegateStub : public SessionStateDelegate { 27 class SessionStateDelegateStub : public SessionStateDelegate {
James Cook 2017/03/17 17:14:36 We probably don't need two SessionStateDelegateStu
xiyuan 2017/03/17 22:52:02 Filed http://crbug.com/702809 to track. After we
28 public: 28 public:
29 SessionStateDelegateStub() 29 SessionStateDelegateStub() : user_info_(new user_manager::UserInfoImpl()) {}
30 : screen_locked_(false), user_info_(new user_manager::UserInfoImpl()) {}
31 30
32 ~SessionStateDelegateStub() override {} 31 ~SessionStateDelegateStub() override {}
33 32
34 // SessionStateDelegate: 33 // SessionStateDelegate:
35 int GetMaximumNumberOfLoggedInUsers() const override { return 3; }
36 int NumberOfLoggedInUsers() const override {
37 // ash_shell has 2 users.
38 return 2;
39 }
40 bool IsActiveUserSessionStarted() const override { return true; }
41 bool CanLockScreen() const override { return true; }
42 bool IsScreenLocked() const override { return screen_locked_; }
43 bool ShouldLockScreenAutomatically() const override { return false; }
44 void LockScreen() override {
45 screen_locked_ = true;
46 NOTIMPLEMENTED();
47 }
48 void UnlockScreen() override {
49 NOTIMPLEMENTED();
50 screen_locked_ = false;
51 }
52 bool IsUserSessionBlocked() const override { return false; }
53 session_manager::SessionState GetSessionState() const override {
54 return session_manager::SessionState::ACTIVE;
55 }
56 const user_manager::UserInfo* GetUserInfo(UserIndex index) const override {
57 return user_info_.get();
58 }
59 bool ShouldShowAvatar(WmWindow* window) const override { 34 bool ShouldShowAvatar(WmWindow* window) const override {
60 NOTIMPLEMENTED(); 35 NOTIMPLEMENTED();
61 return !user_info_->GetImage().isNull(); 36 return !user_info_->GetImage().isNull();
62 } 37 }
63 gfx::ImageSkia GetAvatarImageForWindow(WmWindow* window) const override { 38 gfx::ImageSkia GetAvatarImageForWindow(WmWindow* window) const override {
64 NOTIMPLEMENTED(); 39 NOTIMPLEMENTED();
65 return gfx::ImageSkia(); 40 return gfx::ImageSkia();
66 } 41 }
67 void SwitchActiveUser(const AccountId& account_id) override {}
68 void CycleActiveUser(CycleUserDirection direction) override {}
69 bool IsMultiProfileAllowedByPrimaryUserPolicy() const override {
70 return true;
71 }
72 void AddSessionStateObserver(ash::SessionStateObserver* observer) override {}
73 void RemoveSessionStateObserver(
74 ash::SessionStateObserver* observer) override {}
75 42
76 private: 43 private:
77 bool screen_locked_;
78
79 // A pseudo user info. 44 // A pseudo user info.
80 std::unique_ptr<user_manager::UserInfo> user_info_; 45 std::unique_ptr<user_manager::UserInfo> user_info_;
81 46
82 DISALLOW_COPY_AND_ASSIGN(SessionStateDelegateStub); 47 DISALLOW_COPY_AND_ASSIGN(SessionStateDelegateStub);
83 }; 48 };
84 49
85 } // namespace 50 } // namespace
86 51
87 ShellDelegateMus::ShellDelegateMus(service_manager::Connector* connector) 52 ShellDelegateMus::ShellDelegateMus(service_manager::Connector* connector)
88 : connector_(connector) {} 53 : connector_(connector) {}
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 void ShellDelegateMus::SetTouchscreenEnabledInPrefs(bool enabled, 161 void ShellDelegateMus::SetTouchscreenEnabledInPrefs(bool enabled,
197 bool use_local_state) { 162 bool use_local_state) {
198 NOTIMPLEMENTED(); 163 NOTIMPLEMENTED();
199 } 164 }
200 165
201 void ShellDelegateMus::UpdateTouchscreenStatusFromPrefs() { 166 void ShellDelegateMus::UpdateTouchscreenStatusFromPrefs() {
202 NOTIMPLEMENTED(); 167 NOTIMPLEMENTED();
203 } 168 }
204 169
205 } // namespace ash 170 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698