OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/profiles/avatar_menu.h" | 5 #include "chrome/browser/profiles/avatar_menu.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/i18n/case_conversion.h" | 9 #include "base/i18n/case_conversion.h" |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 } else { | 218 } else { |
219 return l10n_util::GetStringFUTF16(IDS_CHILD_INFO_TWO_CUSTODIANS, | 219 return l10n_util::GetStringFUTF16(IDS_CHILD_INFO_TWO_CUSTODIANS, |
220 custodian, second_custodian); | 220 custodian, second_custodian); |
221 } | 221 } |
222 #endif | 222 #endif |
223 } | 223 } |
224 return base::string16(); | 224 return base::string16(); |
225 } | 225 } |
226 | 226 |
227 const gfx::Image& AvatarMenu::GetSupervisedUserIcon() const { | 227 const gfx::Image& AvatarMenu::GetSupervisedUserIcon() const { |
| 228 if (browser_ && browser_->profile()->IsChild()) { |
| 229 return ResourceBundle::GetSharedInstance().GetNativeImageNamed( |
| 230 IDR_CHILD_USER_ICON); |
| 231 } |
228 return ResourceBundle::GetSharedInstance().GetNativeImageNamed( | 232 return ResourceBundle::GetSharedInstance().GetNativeImageNamed( |
229 IDR_SUPERVISED_USER_ICON); | 233 IDR_LEGACY_SUPERVISED_USER_ICON); |
230 } | 234 } |
231 | 235 |
232 void AvatarMenu::ActiveBrowserChanged(Browser* browser) { | 236 void AvatarMenu::ActiveBrowserChanged(Browser* browser) { |
233 browser_ = browser; | 237 browser_ = browser; |
234 menu_actions_->ActiveBrowserChanged(browser); | 238 menu_actions_->ActiveBrowserChanged(browser); |
235 | 239 |
236 // If browser is not NULL, get the path of its active profile. | 240 // If browser is not NULL, get the path of its active profile. |
237 base::FilePath path; | 241 base::FilePath path; |
238 if (browser) | 242 if (browser) |
239 path = browser->profile()->GetPath(); | 243 path = browser->profile()->GetPath(); |
(...skipping 17 matching lines...) Expand all Loading... |
257 observer_->OnAvatarMenuChanged(this); | 261 observer_->OnAvatarMenuChanged(this); |
258 } | 262 } |
259 | 263 |
260 #if defined(ENABLE_SUPERVISED_USERS) | 264 #if defined(ENABLE_SUPERVISED_USERS) |
261 void AvatarMenu::OnCustodianInfoChanged() { | 265 void AvatarMenu::OnCustodianInfoChanged() { |
262 RebuildMenu(); | 266 RebuildMenu(); |
263 if (observer_) | 267 if (observer_) |
264 observer_->OnAvatarMenuChanged(this); | 268 observer_->OnAvatarMenuChanged(this); |
265 } | 269 } |
266 #endif | 270 #endif |
OLD | NEW |