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

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

Issue 2573703003: chromeos: Fix shelf appearing at login screen under mash (Closed)
Patch Set: rebase on session change, fix tests Created 4 years 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 10
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 !profile->IsGuestSession() && !profile->IsSupervised()) { 556 !profile->IsGuestSession() && !profile->IsSupervised()) {
557 // Start the error notifier services to show auth/sync notifications. 557 // Start the error notifier services to show auth/sync notifications.
558 SigninErrorNotifierFactory::GetForProfile(profile); 558 SigninErrorNotifierFactory::GetForProfile(profile);
559 SyncErrorNotifierFactory::GetForProfile(profile); 559 SyncErrorNotifierFactory::GetForProfile(profile);
560 } 560 }
561 // Do not use chrome::NOTIFICATION_PROFILE_ADDED because the 561 // Do not use chrome::NOTIFICATION_PROFILE_ADDED because the
562 // profile is not fully initialized by user_manager. Use 562 // profile is not fully initialized by user_manager. Use
563 // chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED instead. 563 // chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED instead.
564 if (shelf_delegate_) 564 if (shelf_delegate_)
565 shelf_delegate_->OnUserProfileReadyToSwitch(profile); 565 shelf_delegate_->OnUserProfileReadyToSwitch(profile);
566 ash::Shell::GetInstance()->OnLoginUserProfilePrepared();
James Cook 2016/12/16 01:28:27 This is the core of the change. The shelf is creat
567 break; 566 break;
568 } 567 }
569 case chrome::NOTIFICATION_SESSION_STARTED: 568 case chrome::NOTIFICATION_SESSION_STARTED:
570 // InitAfterFirstSessionStart() should only be called once upon system 569 // InitAfterFirstSessionStart() should only be called once upon system
571 // start. 570 // start.
572 if (user_manager::UserManager::Get()->GetLoggedInUsers().size() < 2) 571 if (user_manager::UserManager::Get()->GetLoggedInUsers().size() < 2)
573 InitAfterFirstSessionStart(); 572 InitAfterFirstSessionStart();
574 ash::WmShell::Get()->ShowShelf();
575 break; 573 break;
576 default: 574 default:
577 NOTREACHED() << "Unexpected notification " << type; 575 NOTREACHED() << "Unexpected notification " << type;
578 } 576 }
579 } 577 }
580 578
581 void ChromeShellDelegate::PlatformInit() { 579 void ChromeShellDelegate::PlatformInit() {
582 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, 580 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED,
583 content::NotificationService::AllSources()); 581 content::NotificationService::AllSources());
584 registrar_.Add(this, chrome::NOTIFICATION_SESSION_STARTED, 582 registrar_.Add(this, chrome::NOTIFICATION_SESSION_STARTED,
585 content::NotificationService::AllSources()); 583 content::NotificationService::AllSources());
586 } 584 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698