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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/i18n/case_conversion.h" | 8 #include "base/i18n/case_conversion.h" |
9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
10 #include "base/profiler/scoped_tracker.h" | 10 #include "base/profiler/scoped_tracker.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 ProfileMetrics::ProfileOpen metric) { | 106 ProfileMetrics::ProfileOpen metric) { |
107 DCHECK(profiles::IsMultipleProfilesEnabled() || | 107 DCHECK(profiles::IsMultipleProfilesEnabled() || |
108 index == GetActiveProfileIndex()); | 108 index == GetActiveProfileIndex()); |
109 const Item& item = GetItemAt(index); | 109 const Item& item = GetItemAt(index); |
110 | 110 |
111 #if !defined(OS_CHROMEOS) | 111 #if !defined(OS_CHROMEOS) |
112 // ChromeOS doesn't have the User Manager, it can't open it. | 112 // ChromeOS doesn't have the User Manager, it can't open it. |
113 // Don't open a browser window for signed-out profiles. | 113 // Don't open a browser window for signed-out profiles. |
114 if (item.signin_required) { | 114 if (item.signin_required) { |
115 UserManager::Show(item.profile_path, | 115 UserManager::Show(item.profile_path, |
116 profiles::USER_MANAGER_NO_TUTORIAL, | |
117 profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION); | 116 profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION); |
118 return; | 117 return; |
119 } | 118 } |
120 #endif | 119 #endif |
121 | 120 |
122 profiles::SwitchToProfile(item.profile_path, always_create, | 121 profiles::SwitchToProfile(item.profile_path, always_create, |
123 ProfileManager::CreateCallback(), metric); | 122 ProfileManager::CreateCallback(), metric); |
124 } | 123 } |
125 | 124 |
126 void AvatarMenu::AddNewProfile(ProfileMetrics::ProfileAdd type) { | 125 void AvatarMenu::AddNewProfile(ProfileMetrics::ProfileAdd type) { |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 void AvatarMenu::OnCustodianInfoChanged() { | 254 void AvatarMenu::OnCustodianInfoChanged() { |
256 Update(); | 255 Update(); |
257 } | 256 } |
258 #endif | 257 #endif |
259 | 258 |
260 void AvatarMenu::Update() { | 259 void AvatarMenu::Update() { |
261 RebuildMenu(); | 260 RebuildMenu(); |
262 if (observer_) | 261 if (observer_) |
263 observer_->OnAvatarMenuChanged(this); | 262 observer_->OnAvatarMenuChanged(this); |
264 } | 263 } |
OLD | NEW |