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