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

Side by Side Diff: chrome/browser/chromeos/system/ash_system_tray_delegate.cc

Issue 16002004: Added login screen mode for adding users into session. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: WebUI test fixed. Created 7 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/chromeos/system/ash_system_tray_delegate.h" 5 #include "chrome/browser/chromeos/system/ash_system_tray_delegate.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 #include "chrome/browser/chromeos/cros/network_library.h" 52 #include "chrome/browser/chromeos/cros/network_library.h"
53 #include "chrome/browser/chromeos/drive/drive_integration_service.h" 53 #include "chrome/browser/chromeos/drive/drive_integration_service.h"
54 #include "chrome/browser/chromeos/input_method/input_method_util.h" 54 #include "chrome/browser/chromeos/input_method/input_method_util.h"
55 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" 55 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h"
56 #include "chrome/browser/chromeos/login/help_app_launcher.h" 56 #include "chrome/browser/chromeos/login/help_app_launcher.h"
57 #include "chrome/browser/chromeos/login/login_display_host.h" 57 #include "chrome/browser/chromeos/login/login_display_host.h"
58 #include "chrome/browser/chromeos/login/login_display_host_impl.h" 58 #include "chrome/browser/chromeos/login/login_display_host_impl.h"
59 #include "chrome/browser/chromeos/login/login_wizard.h" 59 #include "chrome/browser/chromeos/login/login_wizard.h"
60 #include "chrome/browser/chromeos/login/startup_utils.h" 60 #include "chrome/browser/chromeos/login/startup_utils.h"
61 #include "chrome/browser/chromeos/login/user.h" 61 #include "chrome/browser/chromeos/login/user.h"
62 #include "chrome/browser/chromeos/login/user_adding_screen.h"
62 #include "chrome/browser/chromeos/login/user_manager.h" 63 #include "chrome/browser/chromeos/login/user_manager.h"
63 #include "chrome/browser/chromeos/mobile_config.h" 64 #include "chrome/browser/chromeos/mobile_config.h"
64 #include "chrome/browser/chromeos/options/network_config_view.h" 65 #include "chrome/browser/chromeos/options/network_config_view.h"
65 #include "chrome/browser/chromeos/options/network_connect.h" 66 #include "chrome/browser/chromeos/options/network_connect.h"
66 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h" 67 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h"
67 #include "chrome/browser/chromeos/sim_dialog_delegate.h" 68 #include "chrome/browser/chromeos/sim_dialog_delegate.h"
68 #include "chrome/browser/chromeos/status/data_promo_notification.h" 69 #include "chrome/browser/chromeos/status/data_promo_notification.h"
69 #include "chrome/browser/chromeos/system/timezone_settings.h" 70 #include "chrome/browser/chromeos/system/timezone_settings.h"
70 #include "chrome/browser/chromeos/system_key_event_listener.h" 71 #include "chrome/browser/chromeos/system_key_event_listener.h"
71 #include "chrome/browser/google/google_util.h" 72 #include "chrome/browser/google/google_util.h"
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 } 579 }
579 580
580 // TODO(nkostylev): Show some UI messages why no more users could be added 581 // TODO(nkostylev): Show some UI messages why no more users could be added
581 // to this session. http://crbug.com/230863 582 // to this session. http://crbug.com/230863
582 // We limit list of logged in users to 3 due to memory constraints. 583 // We limit list of logged in users to 3 due to memory constraints.
583 // TODO(nkostylev): Adjust this limitation based on device capabilites. 584 // TODO(nkostylev): Adjust this limitation based on device capabilites.
584 // http://crbug.com/230865 585 // http://crbug.com/230865
585 if (UserManager::Get()->GetLoggedInUsers().size() >= 3) 586 if (UserManager::Get()->GetLoggedInUsers().size() >= 3)
586 return; 587 return;
587 588
588 // Check whether there're regular users on the list that are not
589 // currently logged in.
590 const UserList& users = UserManager::Get()->GetUsers();
591 bool has_regular_not_logged_in_users = false;
592 for (UserList::const_iterator it = users.begin(); it != users.end(); ++it) {
593 const User* user = (*it);
594 if (user->GetType() == User::USER_TYPE_REGULAR &&
595 !user->is_logged_in()) {
596 has_regular_not_logged_in_users = true;
597 break;
598 }
599 }
600
601 // Launch sign in screen to add another user to current session. 589 // Launch sign in screen to add another user to current session.
602 if (has_regular_not_logged_in_users) { 590 if (UserManager::Get()->GetUsersAdmittedForMultiProfile().size())
603 ash::Shell::GetInstance()-> 591 UserAddingScreen::Get()->Start();
604 desktop_background_controller()->MoveDesktopToLockedContainer();
605 ShowLoginWizard(std::string());
606 }
607 } 592 }
608 593
609 virtual void ShutDown() OVERRIDE { 594 virtual void ShutDown() OVERRIDE {
610 ash::Shell::GetInstance()->session_state_controller()->RequestShutdown(); 595 ash::Shell::GetInstance()->session_state_controller()->RequestShutdown();
611 } 596 }
612 597
613 virtual void SignOut() OVERRIDE { 598 virtual void SignOut() OVERRIDE {
614 chrome::AttemptUserExit(); 599 chrome::AttemptUserExit();
615 } 600 }
616 601
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after
1340 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); 1325 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate);
1341 }; 1326 };
1342 1327
1343 } // namespace 1328 } // namespace
1344 1329
1345 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { 1330 ash::SystemTrayDelegate* CreateSystemTrayDelegate() {
1346 return new chromeos::SystemTrayDelegate(); 1331 return new chromeos::SystemTrayDelegate();
1347 } 1332 }
1348 1333
1349 } // namespace chromeos 1334 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/webui_screen_locker.cc ('k') | chrome/browser/resources/chromeos/login/display_manager.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698