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/multi_profile_uma.h" | 7 #include "ash/multi_profile_uma.h" |
8 #include "ash/session/session_state_delegate.h" | 8 #include "ash/session/session_state_delegate.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 // If this window is not owned, we don't show the menu addition. | 80 // If this window is not owned, we don't show the menu addition. |
81 chrome::MultiUserWindowManager* manager = | 81 chrome::MultiUserWindowManager* manager = |
82 chrome::MultiUserWindowManager::GetInstance(); | 82 chrome::MultiUserWindowManager::GetInstance(); |
83 const std::string user_id = manager->GetWindowOwner(window); | 83 const std::string user_id = manager->GetWindowOwner(window); |
84 if (user_id.empty() || !window) | 84 if (user_id.empty() || !window) |
85 return model.Pass(); | 85 return model.Pass(); |
86 chromeos::MultiUserContextMenuChromeos* menu = | 86 chromeos::MultiUserContextMenuChromeos* menu = |
87 new chromeos::MultiUserContextMenuChromeos(window); | 87 new chromeos::MultiUserContextMenuChromeos(window); |
88 model.reset(menu); | 88 model.reset(menu); |
89 for (int user_index = 1; user_index < logged_in_users; ++user_index) { | 89 for (int user_index = 1; user_index < logged_in_users; ++user_index) { |
90 const ash::UserInfo* user_info = delegate->GetUserInfo(user_index); | 90 const user_manager::UserInfo* user_info = |
| 91 delegate->GetUserInfo(user_index); |
91 menu->AddItem(user_index == 1 ? IDC_VISIT_DESKTOP_OF_LRU_USER_2 | 92 menu->AddItem(user_index == 1 ? IDC_VISIT_DESKTOP_OF_LRU_USER_2 |
92 : IDC_VISIT_DESKTOP_OF_LRU_USER_3, | 93 : IDC_VISIT_DESKTOP_OF_LRU_USER_3, |
93 l10n_util::GetStringFUTF16( | 94 l10n_util::GetStringFUTF16( |
94 IDS_VISIT_DESKTOP_OF_LRU_USER, | 95 IDS_VISIT_DESKTOP_OF_LRU_USER, |
95 user_info->GetDisplayName(), | 96 user_info->GetDisplayName(), |
96 base::ASCIIToUTF16(user_info->GetEmail()))); | 97 base::ASCIIToUTF16(user_info->GetEmail()))); |
97 } | 98 } |
98 } | 99 } |
99 return model.Pass(); | 100 return model.Pass(); |
100 } | 101 } |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 return; | 143 return; |
143 } | 144 } |
144 } | 145 } |
145 chromeos::ShowMultiprofilesWarningDialog(on_accept); | 146 chromeos::ShowMultiprofilesWarningDialog(on_accept); |
146 return; | 147 return; |
147 } | 148 } |
148 default: | 149 default: |
149 NOTREACHED(); | 150 NOTREACHED(); |
150 } | 151 } |
151 } | 152 } |
OLD | NEW |