| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 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 "chrome/browser/ui/ash/session_state_delegate_views.h" | 5 #include "chrome/browser/ui/ash/session_state_delegate_views.h" |
| 6 | 6 |
| 7 #include "ash/session/user_info.h" | |
| 8 #include "base/logging.h" | 7 #include "base/logging.h" |
| 9 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 11 #include "ui/gfx/image/image_skia.h" | 10 #include "ui/gfx/image/image_skia.h" |
| 12 | 11 |
| 13 namespace { | 12 namespace { |
| 14 | 13 // This isn't really used. It is mainly here to make the compiler happy. |
| 15 class EmptyUserInfo : public ash::UserInfo { | 14 gfx::ImageSkia null_image; |
| 16 public: | 15 } |
| 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 | 16 |
| 52 SessionStateDelegate::SessionStateDelegate() { | 17 SessionStateDelegate::SessionStateDelegate() { |
| 53 } | 18 } |
| 54 | 19 |
| 55 SessionStateDelegate::~SessionStateDelegate() { | 20 SessionStateDelegate::~SessionStateDelegate() { |
| 56 } | 21 } |
| 57 | 22 |
| 58 content::BrowserContext* SessionStateDelegate::GetBrowserContextByIndex( | 23 content::BrowserContext* SessionStateDelegate::GetBrowserContextByIndex( |
| 59 ash::MultiProfileIndex index) { | 24 ash::MultiProfileIndex index) { |
| 60 NOTIMPLEMENTED(); | 25 NOTIMPLEMENTED(); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 | 64 |
| 100 bool SessionStateDelegate::IsUserSessionBlocked() const { | 65 bool SessionStateDelegate::IsUserSessionBlocked() const { |
| 101 return false; | 66 return false; |
| 102 } | 67 } |
| 103 | 68 |
| 104 ash::SessionStateDelegate::SessionState SessionStateDelegate::GetSessionState() | 69 ash::SessionStateDelegate::SessionState SessionStateDelegate::GetSessionState() |
| 105 const { | 70 const { |
| 106 return SESSION_STATE_ACTIVE; | 71 return SESSION_STATE_ACTIVE; |
| 107 } | 72 } |
| 108 | 73 |
| 109 const ash::UserInfo* SessionStateDelegate::GetUserInfo( | 74 const base::string16 SessionStateDelegate::GetUserDisplayName( |
| 110 ash::MultiProfileIndex index) const { | 75 ash::MultiProfileIndex index) const { |
| 111 return GetUserInfo(NULL); | 76 NOTIMPLEMENTED(); |
| 77 return base::UTF8ToUTF16(""); |
| 112 } | 78 } |
| 113 | 79 |
| 114 const ash::UserInfo* SessionStateDelegate::GetUserInfo( | 80 const base::string16 SessionStateDelegate::GetUserGivenName( |
| 115 content::BrowserContext* context) const { | 81 ash::MultiProfileIndex index) const { |
| 116 static const ash::UserInfo* kUserInfo = new EmptyUserInfo(); | 82 NOTIMPLEMENTED(); |
| 117 return kUserInfo; | 83 return base::UTF8ToUTF16(""); |
| 118 } | 84 } |
| 119 | 85 |
| 120 bool SessionStateDelegate::ShouldShowAvatar(aura::Window* window) const { | 86 const std::string SessionStateDelegate::GetUserEmail( |
| 87 ash::MultiProfileIndex index) const { |
| 88 NOTIMPLEMENTED(); |
| 89 return ""; |
| 90 } |
| 91 |
| 92 const std::string SessionStateDelegate::GetUserID( |
| 93 ash::MultiProfileIndex index) const { |
| 94 NOTIMPLEMENTED(); |
| 95 return ""; |
| 96 } |
| 97 |
| 98 const gfx::ImageSkia& SessionStateDelegate::GetUserImage( |
| 99 content::BrowserContext* context) const { |
| 100 NOTIMPLEMENTED(); |
| 101 // To make the compiler happy. |
| 102 return null_image; |
| 103 } |
| 104 |
| 105 bool SessionStateDelegate::ShouldShowAvatar(aura::Window* window) { |
| 121 return false; | 106 return false; |
| 122 } | 107 } |
| 123 | 108 |
| 124 void SessionStateDelegate::SwitchActiveUser(const std::string& user_id) { | 109 void SessionStateDelegate::SwitchActiveUser(const std::string& user_id) { |
| 125 NOTIMPLEMENTED(); | 110 NOTIMPLEMENTED(); |
| 126 } | 111 } |
| 127 | 112 |
| 128 void SessionStateDelegate::CycleActiveUser(CycleUser cycle_user) { | 113 void SessionStateDelegate::CycleActiveUser(CycleUser cycle_user) { |
| 129 NOTIMPLEMENTED(); | 114 NOTIMPLEMENTED(); |
| 130 } | 115 } |
| 131 | 116 |
| 132 void SessionStateDelegate::AddSessionStateObserver( | 117 void SessionStateDelegate::AddSessionStateObserver( |
| 133 ash::SessionStateObserver* observer) { | 118 ash::SessionStateObserver* observer) { |
| 134 NOTIMPLEMENTED(); | 119 NOTIMPLEMENTED(); |
| 135 } | 120 } |
| 136 | 121 |
| 137 void SessionStateDelegate::RemoveSessionStateObserver( | 122 void SessionStateDelegate::RemoveSessionStateObserver( |
| 138 ash::SessionStateObserver* observer) { | 123 ash::SessionStateObserver* observer) { |
| 139 NOTIMPLEMENTED(); | 124 NOTIMPLEMENTED(); |
| 140 } | 125 } |
| OLD | NEW |