| 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 "ash/shell.h" | 5 #include "ash/shell.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 778 | 778 |
| 779 PowerStatus::Shutdown(); | 779 PowerStatus::Shutdown(); |
| 780 | 780 |
| 781 // Ensure that DBusThreadManager outlives this Shell. | 781 // Ensure that DBusThreadManager outlives this Shell. |
| 782 DCHECK(chromeos::DBusThreadManager::IsInitialized()); | 782 DCHECK(chromeos::DBusThreadManager::IsInitialized()); |
| 783 | 783 |
| 784 // Needs to happen right before |instance_| is reset. | 784 // Needs to happen right before |instance_| is reset. |
| 785 shell_port_.reset(); | 785 shell_port_.reset(); |
| 786 session_controller_->RemoveObserver(this); | 786 session_controller_->RemoveObserver(this); |
| 787 wallpaper_delegate_.reset(); | 787 wallpaper_delegate_.reset(); |
| 788 // NightLightController depeneds on the PrefService and must be destructed |
| 789 // before it. crbug.com/724231. |
| 790 night_light_controller_ = nullptr; |
| 788 pref_service_ = nullptr; | 791 pref_service_ = nullptr; |
| 789 shell_delegate_.reset(); | 792 shell_delegate_.reset(); |
| 790 | 793 |
| 791 DCHECK(instance_ == this); | 794 DCHECK(instance_ == this); |
| 792 instance_ = nullptr; | 795 instance_ = nullptr; |
| 793 } | 796 } |
| 794 | 797 |
| 795 void Shell::Init(const ShellInitParams& init_params) { | 798 void Shell::Init(const ShellInitParams& init_params) { |
| 796 const Config config = shell_port_->GetAshConfig(); | 799 const Config config = shell_port_->GetAshConfig(); |
| 797 | 800 |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1275 void Shell::OnPrefServiceInitialized( | 1278 void Shell::OnPrefServiceInitialized( |
| 1276 std::unique_ptr<::PrefService> pref_service) { | 1279 std::unique_ptr<::PrefService> pref_service) { |
| 1277 if (!instance_) | 1280 if (!instance_) |
| 1278 return; | 1281 return; |
| 1279 // |pref_service_| is null if can't connect to Chrome (as happens when | 1282 // |pref_service_| is null if can't connect to Chrome (as happens when |
| 1280 // running mash outside of chrome --mash and chrome isn't built). | 1283 // running mash outside of chrome --mash and chrome isn't built). |
| 1281 pref_service_ = std::move(pref_service); | 1284 pref_service_ = std::move(pref_service); |
| 1282 } | 1285 } |
| 1283 | 1286 |
| 1284 } // namespace ash | 1287 } // namespace ash |
| OLD | NEW |