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

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

Issue 93633007: Created optional multiprofiles introduction dialog. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Non POD variables are not allowed to be set as static. Created 6 years, 11 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
« no previous file with comments | « chrome/browser/chromeos/profiles/multiprofiles_intro_dialog.cc ('k') | chrome/chrome_browser_chromeos.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/system_tray_delegate_chromeos.cc
diff --git a/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc b/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc
index 42367b07144e1690ae19904f56f680cba12bf428..503a0aed387409c3392fb4b538958e1ca48089e7 100644
--- a/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc
+++ b/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc
@@ -65,6 +65,7 @@
#include "chrome/browser/chromeos/login/user_manager.h"
#include "chrome/browser/chromeos/options/network_config_view.h"
#include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h"
+#include "chrome/browser/chromeos/profiles/multiprofiles_intro_dialog.h"
#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chrome/browser/chromeos/sim_dialog_delegate.h"
#include "chrome/browser/chromeos/system_key_event_listener.h"
@@ -74,6 +75,7 @@
#include "chrome/browser/lifetime/application_lifetime.h"
#include "chrome/browser/policy/browser_policy_connector.h"
#include "chrome/browser/profiles/profile_manager.h"
+#include "chrome/browser/ui/ash/multi_user/multi_user_util.h"
#include "chrome/browser/ui/ash/volume_controller_chromeos.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
@@ -238,6 +240,12 @@ void ShowNetworkSettingsPage(const std::string& service_path) {
ProfileManager::GetPrimaryUserProfile());
}
+void OnAcceptMultiprofilesIntro(bool no_show_again) {
+ PrefService* prefs = ProfileManager::GetActiveUserProfile()->GetPrefs();
+ prefs->SetBoolean(prefs::kMultiProfileNeverShowIntro, no_show_again);
+ UserAddingScreen::Get()->Start();
+}
+
class SystemTrayDelegate : public ash::SystemTrayDelegate,
public SessionManagerClient::Observer,
public drive::JobListObserver,
@@ -629,8 +637,27 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate,
return;
// Launch sign in screen to add another user to current session.
- if (UserManager::Get()->GetUsersAdmittedForMultiProfile().size())
- UserAddingScreen::Get()->Start();
+ if (UserManager::Get()->GetUsersAdmittedForMultiProfile().size()) {
+ // Don't show dialog if any logged in user in multi-profiles session
+ // dismissed it.
+ bool show_intro = true;
+ const UserList logged_in_users = UserManager::Get()->GetLoggedInUsers();
+ for (UserList::const_iterator it = logged_in_users.begin();
+ it != logged_in_users.end(); ++it) {
+ show_intro &= !multi_user_util::GetProfileFromUserID(
+ multi_user_util::GetUserIDFromEmail((*it)->email()))->GetPrefs()->
+ GetBoolean(prefs::kMultiProfileNeverShowIntro);
+ if (!show_intro)
+ break;
+ }
+ if (show_intro) {
+ base::Callback<void(bool)> on_accept =
+ base::Bind(&OnAcceptMultiprofilesIntro);
+ ShowMultiprofilesIntroDialog(on_accept);
+ } else {
+ UserAddingScreen::Get()->Start();
+ }
+ }
}
virtual void ShowSpringChargerReplacementDialog() OVERRIDE {
« no previous file with comments | « chrome/browser/chromeos/profiles/multiprofiles_intro_dialog.cc ('k') | chrome/chrome_browser_chromeos.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698