| OLD | NEW |
| 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 | 10 |
| (...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 !profile->IsGuestSession() && !profile->IsSupervised()) { | 558 !profile->IsGuestSession() && !profile->IsSupervised()) { |
| 559 // Start the error notifier services to show auth/sync notifications. | 559 // Start the error notifier services to show auth/sync notifications. |
| 560 SigninErrorNotifierFactory::GetForProfile(profile); | 560 SigninErrorNotifierFactory::GetForProfile(profile); |
| 561 SyncErrorNotifierFactory::GetForProfile(profile); | 561 SyncErrorNotifierFactory::GetForProfile(profile); |
| 562 } | 562 } |
| 563 // Do not use chrome::NOTIFICATION_PROFILE_ADDED because the | 563 // Do not use chrome::NOTIFICATION_PROFILE_ADDED because the |
| 564 // profile is not fully initialized by user_manager. Use | 564 // profile is not fully initialized by user_manager. Use |
| 565 // chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED instead. | 565 // chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED instead. |
| 566 if (shelf_delegate_) | 566 if (shelf_delegate_) |
| 567 shelf_delegate_->OnUserProfileReadyToSwitch(profile); | 567 shelf_delegate_->OnUserProfileReadyToSwitch(profile); |
| 568 ash::Shell::GetInstance()->OnLoginUserProfilePrepared(); |
| 568 break; | 569 break; |
| 569 } | 570 } |
| 570 case chrome::NOTIFICATION_SESSION_STARTED: | 571 case chrome::NOTIFICATION_SESSION_STARTED: |
| 571 // InitAfterFirstSessionStart() should only be called once upon system | 572 // InitAfterFirstSessionStart() should only be called once upon system |
| 572 // start. | 573 // start. |
| 573 if (user_manager::UserManager::Get()->GetLoggedInUsers().size() < 2) | 574 if (user_manager::UserManager::Get()->GetLoggedInUsers().size() < 2) |
| 574 InitAfterFirstSessionStart(); | 575 InitAfterFirstSessionStart(); |
| 576 ash::WmShell::Get()->ShowShelf(); |
| 575 break; | 577 break; |
| 576 default: | 578 default: |
| 577 NOTREACHED() << "Unexpected notification " << type; | 579 NOTREACHED() << "Unexpected notification " << type; |
| 578 } | 580 } |
| 579 } | 581 } |
| 580 | 582 |
| 581 void ChromeShellDelegate::PlatformInit() { | 583 void ChromeShellDelegate::PlatformInit() { |
| 582 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, | 584 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, |
| 583 content::NotificationService::AllSources()); | 585 content::NotificationService::AllSources()); |
| 584 registrar_.Add(this, chrome::NOTIFICATION_SESSION_STARTED, | 586 registrar_.Add(this, chrome::NOTIFICATION_SESSION_STARTED, |
| 585 content::NotificationService::AllSources()); | 587 content::NotificationService::AllSources()); |
| 586 } | 588 } |
| OLD | NEW |