OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ui/ash/multi_user/multi_user_context_menu.h" | 5 #include "chrome/browser/ui/ash/multi_user/multi_user_context_menu.h" |
6 | 6 |
7 #include "ash/common/multi_profile_uma.h" | 7 #include "ash/common/multi_profile_uma.h" |
8 #include "ash/common/session/session_state_delegate.h" | 8 #include "ash/common/session/session_state_delegate.h" |
9 #include "ash/common/wm_shell.h" | 9 #include "ash/common/wm_shell.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 chrome::MultiUserWindowManager::GetInstance(); | 76 chrome::MultiUserWindowManager::GetInstance(); |
77 const AccountId& account_id = manager->GetWindowOwner(window); | 77 const AccountId& account_id = manager->GetWindowOwner(window); |
78 if (!account_id.is_valid() || !window) | 78 if (!account_id.is_valid() || !window) |
79 return model; | 79 return model; |
80 chromeos::MultiUserContextMenuChromeos* menu = | 80 chromeos::MultiUserContextMenuChromeos* menu = |
81 new chromeos::MultiUserContextMenuChromeos(window); | 81 new chromeos::MultiUserContextMenuChromeos(window); |
82 model.reset(menu); | 82 model.reset(menu); |
83 for (int user_index = 1; user_index < logged_in_users; ++user_index) { | 83 for (int user_index = 1; user_index < logged_in_users; ++user_index) { |
84 const user_manager::UserInfo* user_info = | 84 const user_manager::UserInfo* user_info = |
85 delegate->GetUserInfo(user_index); | 85 delegate->GetUserInfo(user_index); |
86 menu->AddItem(user_index == 1 ? IDC_VISIT_DESKTOP_OF_LRU_USER_2 | 86 menu->AddItem( |
87 : IDC_VISIT_DESKTOP_OF_LRU_USER_3, | 87 user_index == 1 ? IDC_VISIT_DESKTOP_OF_LRU_USER_2 |
88 l10n_util::GetStringFUTF16( | 88 : IDC_VISIT_DESKTOP_OF_LRU_USER_3, |
89 IDS_VISIT_DESKTOP_OF_LRU_USER, | 89 l10n_util::GetStringFUTF16( |
90 user_info->GetDisplayName(), | 90 IDS_VISIT_DESKTOP_OF_LRU_USER, user_info->GetDisplayName(), |
91 base::ASCIIToUTF16(user_info->GetEmail()))); | 91 base::ASCIIToUTF16(user_info->GetDisplayEmail()))); |
92 } | 92 } |
93 } | 93 } |
94 return model; | 94 return model; |
95 } | 95 } |
96 | 96 |
97 void OnAcceptTeleportWarning(const AccountId& account_id, | 97 void OnAcceptTeleportWarning(const AccountId& account_id, |
98 aura::Window* window_, | 98 aura::Window* window_, |
99 bool no_show_again) { | 99 bool no_show_again) { |
100 PrefService* pref = ProfileManager::GetActiveUserProfile()->GetPrefs(); | 100 PrefService* pref = ProfileManager::GetActiveUserProfile()->GetPrefs(); |
101 pref->SetBoolean(prefs::kMultiProfileWarningShowDismissed, no_show_again); | 101 pref->SetBoolean(prefs::kMultiProfileWarningShowDismissed, no_show_again); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 return; | 139 return; |
140 } | 140 } |
141 } | 141 } |
142 chromeos::ShowMultiprofilesWarningDialog(on_accept); | 142 chromeos::ShowMultiprofilesWarningDialog(on_accept); |
143 return; | 143 return; |
144 } | 144 } |
145 default: | 145 default: |
146 NOTREACHED(); | 146 NOTREACHED(); |
147 } | 147 } |
148 } | 148 } |
OLD | NEW |