| 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/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 const content::NotificationSource& source, | 265 const content::NotificationSource& source, |
| 266 const content::NotificationDetails& details) { | 266 const content::NotificationDetails& details) { |
| 267 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED, type); | 267 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED, type); |
| 268 RebuildMenu(); | 268 RebuildMenu(); |
| 269 if (observer_) | 269 if (observer_) |
| 270 observer_->OnAvatarMenuModelChanged(this); | 270 observer_->OnAvatarMenuModelChanged(this); |
| 271 } | 271 } |
| 272 | 272 |
| 273 // static | 273 // static |
| 274 bool AvatarMenuModel::ShouldShowAvatarMenu() { | 274 bool AvatarMenuModel::ShouldShowAvatarMenu() { |
| 275 #if defined(OS_CHROMEOS) | |
| 276 // On Chrome OS we use different UI for multi-profiles. | |
| 277 return false; | |
| 278 #endif | |
| 279 | |
| 280 if (base::FieldTrialList::FindFullName(kShowProfileSwitcherFieldTrialName) == | 275 if (base::FieldTrialList::FindFullName(kShowProfileSwitcherFieldTrialName) == |
| 281 kAlwaysShowSwitcherGroupName) { | 276 kAlwaysShowSwitcherGroupName) { |
| 282 // We should only be in this group when multi-profiles is enabled. | 277 // We should only be in this group when multi-profiles is enabled. |
| 283 DCHECK(profiles::IsMultipleProfilesEnabled()); | 278 DCHECK(profiles::IsMultipleProfilesEnabled()); |
| 284 return true; | 279 return true; |
| 285 } | 280 } |
| 286 if (profiles::IsMultipleProfilesEnabled()) { | 281 if (profiles::IsMultipleProfilesEnabled()) { |
| 287 return profiles::IsNewProfileManagementEnabled() || | 282 return profiles::IsNewProfileManagementEnabled() || |
| 288 (g_browser_process->profile_manager() && | 283 (g_browser_process->profile_manager() && |
| 289 g_browser_process->profile_manager()->GetNumberOfProfiles() > 1); | 284 g_browser_process->profile_manager()->GetNumberOfProfiles() > 1); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 contents->GetController().LoadURL( | 349 contents->GetController().LoadURL( |
| 355 logout_url, content::Referrer(), | 350 logout_url, content::Referrer(), |
| 356 content::PAGE_TRANSITION_GENERATED, std::string()); | 351 content::PAGE_TRANSITION_GENERATED, std::string()); |
| 357 | 352 |
| 358 // This object may be destructed when the menu closes but we need something | 353 // This object may be destructed when the menu closes but we need something |
| 359 // around to finish the sign-out process and close the profile windows. | 354 // around to finish the sign-out process and close the profile windows. |
| 360 new SignoutTracker(current_profile, GURL(landing_url), contents); | 355 new SignoutTracker(current_profile, GURL(landing_url), contents); |
| 361 | 356 |
| 362 return contents; // returned for testing purposes | 357 return contents; // returned for testing purposes |
| 363 } | 358 } |
| OLD | NEW |