1 // Copyright (c) 2013 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 "chrome/browser/ui/ash/session_state_delegate_views.h" 6 7 #include "ash/session/user_info.h" 8 #include "base/logging.h" 9 #include "base/strings/string16.h" 10 #include "base/strings/utf_string_conversions.h" 11 #include "ui/gfx/image/image_skia.h" 12 13 namespace { 14 15 class EmptyUserInfo : public ash::UserInfo { 16 public: 17 EmptyUserInfo() {} 18 virtual ~EmptyUserInfo() {} 19 20 // ash::UserInfo: 21 virtual base::string16 GetDisplayName() const OVERRIDE { 22 NOTIMPLEMENTED(); 23 return base::UTF8ToUTF16(std::string()); 24 } 25 virtual base::string16 GetGivenName() const OVERRIDE { 26 NOTIMPLEMENTED(); 27 return base::UTF8ToUTF16(std::string()); 28 } 29 virtual std::string GetEmail() const OVERRIDE { 30 NOTIMPLEMENTED(); 31 return std::string(); 32 } 33 virtual std::string GetUserID() const OVERRIDE { 34 NOTIMPLEMENTED(); 35 return std::string(); 36 } 37 38 virtual const gfx::ImageSkia& GetImage() const OVERRIDE { 39 NOTIMPLEMENTED(); 40 // To make the compiler happy. 41 return null_image_; 42 } 43 44 private: 45 const gfx::ImageSkia null_image_; 46 47 DISALLOW_COPY_AND_ASSIGN(EmptyUserInfo); 48 }; 49 50 } // namespace 51 52 SessionStateDelegate::SessionStateDelegate() { 53 } 54 55 SessionStateDelegate::~SessionStateDelegate() { 56 } 57 58 content::BrowserContext* SessionStateDelegate::GetBrowserContextByIndex( 59 ash::MultiProfileIndex index) { 60 NOTIMPLEMENTED(); 61 return NULL; 62 } 63 64 content::BrowserContext* SessionStateDelegate::GetBrowserContextForWindow( 65 aura::Window* window) { 66 NOTIMPLEMENTED(); 67 return NULL; 68 } 69 70 int SessionStateDelegate::GetMaximumNumberOfLoggedInUsers() const { 71 return 3; 72 } 73 74 int SessionStateDelegate::NumberOfLoggedInUsers() const { 75 return 1; 76 } 77 78 bool SessionStateDelegate::IsActiveUserSessionStarted() const { 79 return true; 80 } 81 82 bool SessionStateDelegate::CanLockScreen() const { 83 return false; 84 } 85 86 bool SessionStateDelegate::IsScreenLocked() const { 87 return false; 88 } 89 90 bool SessionStateDelegate::ShouldLockScreenBeforeSuspending() const { 91 return false; 92 } 93 94 void SessionStateDelegate::LockScreen() { 95 } 96 97 void SessionStateDelegate::UnlockScreen() { 98 } 99 100 bool SessionStateDelegate::IsUserSessionBlocked() const { 101 return false; 102 } 103 104 ash::SessionStateDelegate::SessionState SessionStateDelegate::GetSessionState() 105 const { 106 return SESSION_STATE_ACTIVE; 107 } 108 109 const ash::UserInfo* SessionStateDelegate::GetUserInfo( 110 ash::MultiProfileIndex index) const { 111 return GetUserInfo(static_cast<content::BrowserContext*>(NULL)); 112 } 113 114 const ash::UserInfo* SessionStateDelegate::GetUserInfo( 115 content::BrowserContext* context) const { 116 static const ash::UserInfo* kUserInfo = new EmptyUserInfo(); 117 return kUserInfo; 118 } 119 120 bool SessionStateDelegate::ShouldShowAvatar(aura::Window* window) const { 121 return false; 122 } 123 124 void SessionStateDelegate::SwitchActiveUser(const std::string& user_id) { 125 NOTIMPLEMENTED(); 126 } 127 128 void SessionStateDelegate::CycleActiveUser(CycleUser cycle_user) { 129 NOTIMPLEMENTED(); 130 } 131 132 void SessionStateDelegate::AddSessionStateObserver( 133 ash::SessionStateObserver* observer) { 134 NOTIMPLEMENTED(); 135 } 136 137 void SessionStateDelegate::RemoveSessionStateObserver( 138 ash::SessionStateObserver* observer) { 139 NOTIMPLEMENTED(); 140 } 141