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_model.h" | 5 #include "chrome/browser/profiles/avatar_menu_model.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 185 const content::NotificationSource& source, | 185 const content::NotificationSource& source, |
| 186 const content::NotificationDetails& details) { | 186 const content::NotificationDetails& details) { |
| 187 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED, type); | 187 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED, type); |
| 188 RebuildMenu(); | 188 RebuildMenu(); |
| 189 if (observer_) | 189 if (observer_) |
| 190 observer_->OnAvatarMenuModelChanged(this); | 190 observer_->OnAvatarMenuModelChanged(this); |
| 191 } | 191 } |
| 192 | 192 |
| 193 // static | 193 // static |
| 194 bool AvatarMenuModel::ShouldShowAvatarMenu() { | 194 bool AvatarMenuModel::ShouldShowAvatarMenu() { |
| 195 #if defined(OS_CHROMEOS) | 195 #if defined(OS_CHROMEOS) |
|
sail
2013/04/04 14:38:37
Could you just delete this part entirely?
Nikita (slow)
2013/04/04 14:50:05
This part should not be deleted as eventually this
sail
2013/04/04 15:09:34
Makes sense. Could you add a comment / TODO then?
dzhioev (left Google)
2013/04/04 15:54:41
I've uncommented it back as long as we have no Chr
| |
| 196 // On Chrome OS we use different UI for multi-profiles. | 196 // On Chrome OS we use different UI for multi-profiles. |
| 197 return false; | 197 // return false; |
| 198 #endif | 198 #endif |
| 199 | 199 |
| 200 if (base::FieldTrialList::FindFullName(kShowProfileSwitcherFieldTrialName) == | 200 if (base::FieldTrialList::FindFullName(kShowProfileSwitcherFieldTrialName) == |
| 201 kAlwaysShowSwitcherGroupName) { | 201 kAlwaysShowSwitcherGroupName) { |
| 202 // We should only be in this group when multi-profiles is enabled. | 202 // We should only be in this group when multi-profiles is enabled. |
| 203 DCHECK(ProfileManager::IsMultipleProfilesEnabled()); | 203 DCHECK(ProfileManager::IsMultipleProfilesEnabled()); |
| 204 return true; | 204 return true; |
| 205 } | 205 } |
| 206 return ProfileManager::IsMultipleProfilesEnabled() && | 206 return ProfileManager::IsMultipleProfilesEnabled() && |
| 207 g_browser_process->profile_manager()->GetNumberOfProfiles() > 1; | 207 g_browser_process->profile_manager()->GetNumberOfProfiles() > 1; |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 230 base::FilePath path = profile_info_->GetPathOfProfileAtIndex(i); | 230 base::FilePath path = profile_info_->GetPathOfProfileAtIndex(i); |
| 231 item->active = browser_->profile()->GetPath() == path; | 231 item->active = browser_->profile()->GetPath() == path; |
| 232 } | 232 } |
| 233 items_.push_back(item); | 233 items_.push_back(item); |
| 234 } | 234 } |
| 235 } | 235 } |
| 236 | 236 |
| 237 void AvatarMenuModel::ClearMenu() { | 237 void AvatarMenuModel::ClearMenu() { |
| 238 STLDeleteElements(&items_); | 238 STLDeleteElements(&items_); |
| 239 } | 239 } |
| OLD | NEW |