Chromium Code Reviews| 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()) | |
|
Marc Treib
2015/02/05 12:25:06
nit: Add braces for multiline "if" body.
This is
merkulova
2015/02/05 12:41:11
Added braces. Ok, thanks)
| |
| 229 return ResourceBundle::GetSharedInstance().GetNativeImageNamed( | |
| 230 IDR_CHILD_USER_ICON); | |
| 228 return ResourceBundle::GetSharedInstance().GetNativeImageNamed( | 231 return ResourceBundle::GetSharedInstance().GetNativeImageNamed( |
| 229 IDR_SUPERVISED_USER_ICON); | 232 IDR_LEGACY_SUPERVISED_USER_ICON); |
| 230 } | 233 } |
| 231 | 234 |
| 232 void AvatarMenu::ActiveBrowserChanged(Browser* browser) { | 235 void AvatarMenu::ActiveBrowserChanged(Browser* browser) { |
| 233 browser_ = browser; | 236 browser_ = browser; |
| 234 menu_actions_->ActiveBrowserChanged(browser); | 237 menu_actions_->ActiveBrowserChanged(browser); |
| 235 | 238 |
| 236 // If browser is not NULL, get the path of its active profile. | 239 // If browser is not NULL, get the path of its active profile. |
| 237 base::FilePath path; | 240 base::FilePath path; |
| 238 if (browser) | 241 if (browser) |
| 239 path = browser->profile()->GetPath(); | 242 path = browser->profile()->GetPath(); |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 257 observer_->OnAvatarMenuChanged(this); | 260 observer_->OnAvatarMenuChanged(this); |
| 258 } | 261 } |
| 259 | 262 |
| 260 #if defined(ENABLE_SUPERVISED_USERS) | 263 #if defined(ENABLE_SUPERVISED_USERS) |
| 261 void AvatarMenu::OnCustodianInfoChanged() { | 264 void AvatarMenu::OnCustodianInfoChanged() { |
| 262 RebuildMenu(); | 265 RebuildMenu(); |
| 263 if (observer_) | 266 if (observer_) |
| 264 observer_->OnAvatarMenuChanged(this); | 267 observer_->OnAvatarMenuChanged(this); |
| 265 } | 268 } |
| 266 #endif | 269 #endif |
| OLD | NEW |