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

Side by Side Diff: chrome/browser/ui/ash/chrome_shell_delegate.cc

Issue 2945023002: Introduce profile for lock screen apps (Closed)
Patch Set: rebase Created 3 years, 5 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/ui/ash/chrome_shell_delegate.h" 5 #include "chrome/browser/ui/ash/chrome_shell_delegate.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <limits> 9 #include <limits>
10 #include <vector> 10 #include <vector>
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 } 630 }
631 #endif 631 #endif
632 632
633 void ChromeShellDelegate::Observe(int type, 633 void ChromeShellDelegate::Observe(int type,
634 const content::NotificationSource& source, 634 const content::NotificationSource& source,
635 const content::NotificationDetails& details) { 635 const content::NotificationDetails& details) {
636 switch (type) { 636 switch (type) {
637 case chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED: { 637 case chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED: {
638 Profile* profile = content::Details<Profile>(details).ptr(); 638 Profile* profile = content::Details<Profile>(details).ptr();
639 if (!chromeos::ProfileHelper::IsSigninProfile(profile) && 639 if (!chromeos::ProfileHelper::IsSigninProfile(profile) &&
640 !chromeos::ProfileHelper::IsLockScreenAppProfile(profile) &&
640 !profile->IsGuestSession() && !profile->IsSupervised()) { 641 !profile->IsGuestSession() && !profile->IsSupervised()) {
641 // Start the error notifier services to show auth/sync notifications. 642 // Start the error notifier services to show auth/sync notifications.
642 SigninErrorNotifierFactory::GetForProfile(profile); 643 SigninErrorNotifierFactory::GetForProfile(profile);
643 SyncErrorNotifierFactory::GetForProfile(profile); 644 SyncErrorNotifierFactory::GetForProfile(profile);
644 } 645 }
645 // Do not use chrome::NOTIFICATION_PROFILE_ADDED because the 646 // Do not use chrome::NOTIFICATION_PROFILE_ADDED because the
646 // profile is not fully initialized by user_manager. Use 647 // profile is not fully initialized by user_manager. Use
647 // chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED instead. 648 // chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED instead.
648 if (launcher_controller_) 649 if (launcher_controller_)
649 launcher_controller_->OnUserProfileReadyToSwitch(profile); 650 launcher_controller_->OnUserProfileReadyToSwitch(profile);
650 break; 651 break;
651 } 652 }
652 case chrome::NOTIFICATION_SESSION_STARTED: 653 case chrome::NOTIFICATION_SESSION_STARTED:
653 // InitAfterFirstSessionStart() should only be called once upon system 654 // InitAfterFirstSessionStart() should only be called once upon system
654 // start. 655 // start.
655 if (user_manager::UserManager::Get()->GetLoggedInUsers().size() < 2) 656 if (user_manager::UserManager::Get()->GetLoggedInUsers().size() < 2)
656 InitAfterFirstSessionStart(); 657 InitAfterFirstSessionStart();
657 break; 658 break;
658 default: 659 default:
659 NOTREACHED() << "Unexpected notification " << type; 660 NOTREACHED() << "Unexpected notification " << type;
660 } 661 }
661 } 662 }
662 663
663 void ChromeShellDelegate::PlatformInit() { 664 void ChromeShellDelegate::PlatformInit() {
664 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, 665 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED,
665 content::NotificationService::AllSources()); 666 content::NotificationService::AllSources());
666 registrar_.Add(this, chrome::NOTIFICATION_SESSION_STARTED, 667 registrar_.Add(this, chrome::NOTIFICATION_SESSION_STARTED,
667 content::NotificationService::AllSources()); 668 content::NotificationService::AllSources());
668 } 669 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/app_list_syncable_service_factory.cc ('k') | chrome/test/base/testing_profile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698