Chromium Code Reviews| Index: ash/shell.cc |
| diff --git a/ash/shell.cc b/ash/shell.cc |
| index 525229c8e6cc076d334e02aebc2ca5f31855576e..545eda507e879e91857190f36acb826facb08d39 100644 |
| --- a/ash/shell.cc |
| +++ b/ash/shell.cc |
| @@ -419,21 +419,6 @@ FirstRunHelper* Shell::CreateFirstRunHelper() { |
| return new FirstRunHelperImpl; |
| } |
| -void Shell::CreateShelfView() { |
| - // Must occur after SessionController creation and user login. |
| - DCHECK(session_controller()); |
| - DCHECK_GT(session_controller()->NumberOfLoggedInUsers(), 0); |
| - |
| - // Notify the ShellDelegate that the shelf is being initialized. |
| - // TODO(msw): Refine ChromeLauncherController lifetime management. |
| - shell_delegate_->ShelfInit(); |
| - |
| - if (!shelf_window_watcher_) |
| - shelf_window_watcher_ = base::MakeUnique<ShelfWindowWatcher>(shelf_model()); |
| - for (WmWindow* root_window : shell_port_->GetAllRootWindows()) |
| - root_window->GetRootWindowController()->CreateShelfView(); |
| -} |
| - |
| void Shell::SetLargeCursorSizeInDip(int large_cursor_size_in_dip) { |
| window_tree_host_manager_->cursor_window_controller() |
| ->SetLargeCursorSizeInDip(large_cursor_size_in_dip); |
| @@ -1232,11 +1217,10 @@ void Shell::OnWindowActivated( |
| } |
| void Shell::OnSessionStateChanged(session_manager::SessionState state) { |
| - // Create the shelf when a session becomes active. It's safe to do this |
| + // Finalize the shelf when a session becomes active. It's safe to do this |
|
msw
2017/05/16 22:42:00
nit: s/Finalize/Initialize/?
|
| // multiple times (e.g. initial login vs. multiprofile add session). |
| if (state == session_manager::SessionState::ACTIVE) { |
| - CreateShelfView(); |
| - |
| + InitializeShelf(); |
| if (GetAshConfig() != Config::MASH) { |
| // Recreate the keyboard after initial login and after multiprofile login. |
| CreateKeyboard(); |
| @@ -1260,6 +1244,21 @@ void Shell::OnLockStateChanged(bool locked) { |
| #endif |
| } |
| +void Shell::InitializeShelf() { |
| + // Must occur after SessionController creation and user login. |
| + DCHECK(session_controller()); |
| + DCHECK_GT(session_controller()->NumberOfLoggedInUsers(), 0); |
| + |
| + // Notify the ShellDelegate that the shelf is being initialized. |
| + // TODO(msw): Refine ChromeLauncherController lifetime management. |
| + shell_delegate_->ShelfInit(); |
| + |
| + if (!shelf_window_watcher_) |
| + shelf_window_watcher_ = base::MakeUnique<ShelfWindowWatcher>(shelf_model()); |
| + for (WmWindow* root_window : shell_port_->GetAllRootWindows()) |
|
msw
2017/05/16 22:42:00
optional nit: avoid WmWindow usage.
James Cook
2017/05/17 16:16:13
Done.
|
| + root_window->GetRootWindowController()->InitializeShelf(); |
| +} |
| + |
| void Shell::OnPrefServiceInitialized( |
| std::unique_ptr<::PrefService> pref_service) { |
| if (!instance_) |