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

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: Clang errors 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 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 } 578 }
578 579
579 // TODO(nkostylev): Show some UI messages why no more users could be added 580 // TODO(nkostylev): Show some UI messages why no more users could be added
580 // to this session. http://crbug.com/230863 581 // to this session. http://crbug.com/230863
581 // We limit list of logged in users to 3 due to memory constraints. 582 // We limit list of logged in users to 3 due to memory constraints.
582 // TODO(nkostylev): Adjust this limitation based on device capabilites. 583 // TODO(nkostylev): Adjust this limitation based on device capabilites.
583 // http://crbug.com/230865 584 // http://crbug.com/230865
584 if (UserManager::Get()->GetLoggedInUsers().size() >= 3) 585 if (UserManager::Get()->GetLoggedInUsers().size() >= 3)
585 return; 586 return;
586 587
587 // Check whether there're regular users on the list that are not
588 // currently logged in.
589 const UserList& users = UserManager::Get()->GetUsers();
590 bool has_regular_not_logged_in_users = false;
591 for (UserList::const_iterator it = users.begin(); it != users.end(); ++it) {
592 const User* user = (*it);
593 if (user->GetType() == User::USER_TYPE_REGULAR &&
594 !user->is_logged_in()) {
595 has_regular_not_logged_in_users = true;
596 break;
597 }
598 }
599
600 // Launch sign in screen to add another user to current session. 588 // Launch sign in screen to add another user to current session.
601 if (has_regular_not_logged_in_users) { 589 if (UserManager::Get()->GetUsersAdmittedForMultiProfile().size())
602 ash::Shell::GetInstance()-> 590 UserAddingScreen::Get()->Start();
603 desktop_background_controller()->MoveDesktopToLockedContainer();
604 ShowLoginWizard(std::string(), gfx::Size());
605 }
606 } 591 }
607 592
608 virtual void ShutDown() OVERRIDE { 593 virtual void ShutDown() OVERRIDE {
609 ash::Shell::GetInstance()->session_state_controller()->RequestShutdown(); 594 ash::Shell::GetInstance()->session_state_controller()->RequestShutdown();
610 } 595 }
611 596
612 virtual void SignOut() OVERRIDE { 597 virtual void SignOut() OVERRIDE {
613 chrome::AttemptUserExit(); 598 chrome::AttemptUserExit();
614 } 599 }
615 600
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after
1337 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); 1322 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate);
1338 }; 1323 };
1339 1324
1340 } // namespace 1325 } // namespace
1341 1326
1342 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { 1327 ash::SystemTrayDelegate* CreateSystemTrayDelegate() {
1343 return new chromeos::SystemTrayDelegate(); 1328 return new chromeos::SystemTrayDelegate();
1344 } 1329 }
1345 1330
1346 } // namespace chromeos 1331 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698