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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 ->session_state_delegate() | 122 ->session_state_delegate() |
123 ->GetUserInfo(IDC_VISIT_DESKTOP_OF_LRU_USER_2 == command_id ? 1 | 123 ->GetUserInfo(IDC_VISIT_DESKTOP_OF_LRU_USER_2 == command_id ? 1 |
124 : 2) | 124 : 2) |
125 ->GetUserID(); | 125 ->GetUserID(); |
126 base::Callback<void(bool)> on_accept = | 126 base::Callback<void(bool)> on_accept = |
127 base::Bind(&OnAcceptTeleportWarning, user_id, window); | 127 base::Bind(&OnAcceptTeleportWarning, user_id, window); |
128 | 128 |
129 // Don't show warning dialog if any logged in user in multi-profiles | 129 // Don't show warning dialog if any logged in user in multi-profiles |
130 // session dismissed it. | 130 // session dismissed it. |
131 const chromeos::UserList logged_in_users = | 131 const chromeos::UserList logged_in_users = |
132 chromeos::UserManager::Get()->GetLoggedInUsers(); | 132 chromeos::GetUserManager()->GetLoggedInUsers(); |
133 for (chromeos::UserList::const_iterator it = logged_in_users.begin(); | 133 for (chromeos::UserList::const_iterator it = logged_in_users.begin(); |
134 it != logged_in_users.end(); ++it) { | 134 it != logged_in_users.end(); ++it) { |
135 if (multi_user_util::GetProfileFromUserID( | 135 if (multi_user_util::GetProfileFromUserID( |
136 multi_user_util::GetUserIDFromEmail((*it)->email()))->GetPrefs()-> | 136 multi_user_util::GetUserIDFromEmail((*it)->email()))->GetPrefs()-> |
137 GetBoolean(prefs::kMultiProfileWarningShowDismissed)) { | 137 GetBoolean(prefs::kMultiProfileWarningShowDismissed)) { |
138 bool active_user_show_option = | 138 bool active_user_show_option = |
139 ProfileManager::GetActiveUserProfile()-> | 139 ProfileManager::GetActiveUserProfile()-> |
140 GetPrefs()->GetBoolean(prefs::kMultiProfileWarningShowDismissed); | 140 GetPrefs()->GetBoolean(prefs::kMultiProfileWarningShowDismissed); |
141 on_accept.Run(active_user_show_option); | 141 on_accept.Run(active_user_show_option); |
142 return; | 142 return; |
143 } | 143 } |
144 } | 144 } |
145 chromeos::ShowMultiprofilesWarningDialog(on_accept); | 145 chromeos::ShowMultiprofilesWarningDialog(on_accept); |
146 return; | 146 return; |
147 } | 147 } |
148 default: | 148 default: |
149 NOTREACHED(); | 149 NOTREACHED(); |
150 } | 150 } |
151 } | 151 } |
OLD | NEW |