Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7095)

Unified Diff: chrome/browser/ui/ash/session_state_delegate_chromeos.cc

Issue 496563002: Multiprofile security: Show a warning messagebox when desktop casting/sharing is turned on upon user (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/ash/session_state_delegate_chromeos.cc
diff --git a/chrome/browser/ui/ash/session_state_delegate_chromeos.cc b/chrome/browser/ui/ash/session_state_delegate_chromeos.cc
index 2f7c8405472735753c8d8adf41e5b0f75af54ce7..5b537a7f189d331e1c513f892cad730b129dad47 100644
--- a/chrome/browser/ui/ash/session_state_delegate_chromeos.cc
+++ b/chrome/browser/ui/ash/session_state_delegate_chromeos.cc
@@ -6,6 +6,10 @@
#include "ash/multi_profile_uma.h"
#include "ash/session/session_state_observer.h"
+#include "ash/shell.h"
James Cook 2014/08/20 23:33:53 Do you need this include?
Mr4D (OOO till 08-26) 2014/08/21 00:05:03 Done.
+#include "ash/system/chromeos/multi_user/try_switching_user.h"
James Cook 2014/08/20 23:33:53 This filename is a little weird. How about somethi
Mr4D (OOO till 08-26) 2014/08/21 00:05:03 I have found some similarly named cc/h files. But
+#include "base/bind.h"
+#include "base/callback.h"
#include "base/command_line.h"
#include "base/logging.h"
#include "base/prefs/pref_service.h"
@@ -164,7 +168,7 @@ void SessionStateDelegateChromeos::SwitchActiveUser(
gaia::CanonicalizeEmail(gaia::SanitizeEmail(user_id)));
if (user_id == user_manager::UserManager::Get()->GetActiveUser()->email())
return;
- user_manager::UserManager::Get()->SwitchActiveUser(user_id);
+ TryToSwitchUser(user_id);
}
void SessionStateDelegateChromeos::CycleActiveUser(CycleUser cycle_user) {
@@ -207,7 +211,7 @@ void SessionStateDelegateChromeos::CycleActiveUser(CycleUser cycle_user) {
}
// Switch using the transformed |user_id|.
- user_manager::UserManager::Get()->SwitchActiveUser(user_id);
+ TryToSwitchUser(user_id);
}
bool SessionStateDelegateChromeos::IsMultiProfileAllowedByPrimaryUserPolicy()
@@ -267,3 +271,13 @@ void SessionStateDelegateChromeos::NotifySessionStateChanged() {
session_state_observer_list_,
SessionStateChanged(session_state_));
}
+
+void DoSwitchUser(const std::string& user_id) {
+ user_manager::UserManager::Get()->SwitchActiveUser(user_id);
+}
+
+void SessionStateDelegateChromeos::TryToSwitchUser(
+ const std::string& user_id) {
+ base::Callback<void()> switch_user = base::Bind(&DoSwitchUser, user_id);
+ ash::TrySwitchingActiveUser(switch_user);
James Cook 2014/08/20 23:33:53 nit: You could just put the base::Bind() call here
Mr4D (OOO till 08-26) 2014/08/21 00:05:03 Done.
+}

Powered by Google App Engine
This is Rietveld 408576698