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" |
| 10 #include "components/user_manager/empty_user_info.h" |
11 #include "ui/gfx/image/image_skia.h" | 11 #include "ui/gfx/image/image_skia.h" |
12 | 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() { | 13 SessionStateDelegate::SessionStateDelegate() { |
53 } | 14 } |
54 | 15 |
55 SessionStateDelegate::~SessionStateDelegate() { | 16 SessionStateDelegate::~SessionStateDelegate() { |
56 } | 17 } |
57 | 18 |
58 content::BrowserContext* SessionStateDelegate::GetBrowserContextByIndex( | 19 content::BrowserContext* SessionStateDelegate::GetBrowserContextByIndex( |
59 ash::MultiProfileIndex index) { | 20 ash::MultiProfileIndex index) { |
60 NOTIMPLEMENTED(); | 21 NOTIMPLEMENTED(); |
61 return NULL; | 22 return NULL; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 | 60 |
100 bool SessionStateDelegate::IsUserSessionBlocked() const { | 61 bool SessionStateDelegate::IsUserSessionBlocked() const { |
101 return false; | 62 return false; |
102 } | 63 } |
103 | 64 |
104 ash::SessionStateDelegate::SessionState SessionStateDelegate::GetSessionState() | 65 ash::SessionStateDelegate::SessionState SessionStateDelegate::GetSessionState() |
105 const { | 66 const { |
106 return SESSION_STATE_ACTIVE; | 67 return SESSION_STATE_ACTIVE; |
107 } | 68 } |
108 | 69 |
109 const ash::UserInfo* SessionStateDelegate::GetUserInfo( | 70 const user_manager::UserInfo* SessionStateDelegate::GetUserInfo( |
110 ash::MultiProfileIndex index) const { | 71 ash::MultiProfileIndex index) const { |
111 return GetUserInfo(static_cast<content::BrowserContext*>(NULL)); | 72 return GetUserInfo(static_cast<content::BrowserContext*>(NULL)); |
112 } | 73 } |
113 | 74 |
114 const ash::UserInfo* SessionStateDelegate::GetUserInfo( | 75 const user_manager::UserInfo* SessionStateDelegate::GetUserInfo( |
115 content::BrowserContext* context) const { | 76 content::BrowserContext* context) const { |
116 static const ash::UserInfo* kUserInfo = new EmptyUserInfo(); | 77 static const user_manager::UserInfo* kUserInfo = |
| 78 new user_manager::EmptyUserInfo(); |
117 return kUserInfo; | 79 return kUserInfo; |
118 } | 80 } |
119 | 81 |
120 bool SessionStateDelegate::ShouldShowAvatar(aura::Window* window) const { | 82 bool SessionStateDelegate::ShouldShowAvatar(aura::Window* window) const { |
121 return false; | 83 return false; |
122 } | 84 } |
123 | 85 |
124 void SessionStateDelegate::SwitchActiveUser(const std::string& user_id) { | 86 void SessionStateDelegate::SwitchActiveUser(const std::string& user_id) { |
125 NOTIMPLEMENTED(); | 87 NOTIMPLEMENTED(); |
126 } | 88 } |
127 | 89 |
128 void SessionStateDelegate::CycleActiveUser(CycleUser cycle_user) { | 90 void SessionStateDelegate::CycleActiveUser(CycleUser cycle_user) { |
129 NOTIMPLEMENTED(); | 91 NOTIMPLEMENTED(); |
130 } | 92 } |
131 | 93 |
132 void SessionStateDelegate::AddSessionStateObserver( | 94 void SessionStateDelegate::AddSessionStateObserver( |
133 ash::SessionStateObserver* observer) { | 95 ash::SessionStateObserver* observer) { |
134 NOTIMPLEMENTED(); | 96 NOTIMPLEMENTED(); |
135 } | 97 } |
136 | 98 |
137 void SessionStateDelegate::RemoveSessionStateObserver( | 99 void SessionStateDelegate::RemoveSessionStateObserver( |
138 ash::SessionStateObserver* observer) { | 100 ash::SessionStateObserver* observer) { |
139 NOTIMPLEMENTED(); | 101 NOTIMPLEMENTED(); |
140 } | 102 } |
OLD | NEW |