diff options
author | stevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-31 19:29:55 +0000 |
---|---|---|
committer | stevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-31 19:29:55 +0000 |
commit | 8e6986af5167094c71bba75c2659899c8c949f69 (patch) | |
tree | 219ae75e585471bf533a113297465353b00ec020 /ash/shelf/shelf_widget.cc | |
parent | 9b730732f8dbdb44283e6cebaf7cf39ff53bb07b (diff) | |
download | chromium_src-8e6986af5167094c71bba75c2659899c8c949f69.zip chromium_src-8e6986af5167094c71bba75c2659899c8c949f69.tar.gz chromium_src-8e6986af5167094c71bba75c2659899c8c949f69.tar.bz2 |
Call OpenAsh before Profile Init and CreateLauncher() after
This partially undoes the changes from
https://chromiumcodereview.appspot.com/15702004
Rather than initializing Ash after Profile Init, initialize Ash first
and postpone CreateLauncher() and any other calls that may depend on
GetDefaultProfile() until after profiles have been initialized.
BUG=245055
Review URL: https://chromiumcodereview.appspot.com/16229008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203454 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/shelf/shelf_widget.cc')
-rw-r--r-- | ash/shelf/shelf_widget.cc | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/ash/shelf/shelf_widget.cc b/ash/shelf/shelf_widget.cc index f2f206f..5d54da1 100644 --- a/ash/shelf/shelf_widget.cc +++ b/ash/shelf/shelf_widget.cc @@ -497,25 +497,28 @@ bool ShelfWidget::GetDimsShelf() const { } void ShelfWidget::CreateLauncher() { - if (!launcher_) { - Shell* shell = Shell::GetInstance(); - // This needs to be called before launcher_model(). - shell->GetLauncherDelegate(); - launcher_.reset(new Launcher(shell->launcher_model(), - shell->GetLauncherDelegate(), - this)); + if (launcher_) + return; - SetFocusCycler(shell->focus_cycler()); + Shell* shell = Shell::GetInstance(); + // This needs to be called before launcher_model(). + LauncherDelegate* launcher_delegate = shell->GetLauncherDelegate(); + if (!launcher_delegate) + return; // Not ready to create Launcher - // Inform the root window controller. - internal::RootWindowController::ForWindow(window_container_)-> - OnLauncherCreated(); + launcher_.reset(new Launcher(shell->launcher_model(), + shell->GetLauncherDelegate(), + this)); + SetFocusCycler(shell->focus_cycler()); - launcher_->SetVisible( - shell->session_state_delegate()->IsActiveUserSessionStarted()); + // Inform the root window controller. + internal::RootWindowController::ForWindow(window_container_)-> + OnLauncherCreated(); - Show(); - } + launcher_->SetVisible( + shell->session_state_delegate()->IsActiveUserSessionStarted()); + + Show(); } bool ShelfWidget::IsLauncherVisible() const { @@ -579,4 +582,3 @@ void ShelfWidget::DisableDimmingAnimationsForTest() { } } // namespace ash - |