diff options
Diffstat (limited to 'ash')
-rw-r--r-- | ash/display/window_tree_host_manager.cc | 2 | ||||
-rw-r--r-- | ash/display/window_tree_host_manager.h | 7 | ||||
-rw-r--r-- | ash/shell.cc | 2 | ||||
-rw-r--r-- | ash/shell_observer.h | 3 |
4 files changed, 12 insertions, 2 deletions
diff --git a/ash/display/window_tree_host_manager.cc b/ash/display/window_tree_host_manager.cc index af7d17c..aabf1b2 100644 --- a/ash/display/window_tree_host_manager.cc +++ b/ash/display/window_tree_host_manager.cc @@ -286,6 +286,8 @@ void WindowTreeHostManager::Start() { } void WindowTreeHostManager::Shutdown() { + FOR_EACH_OBSERVER(Observer, observers_, OnWindowTreeHostManagerShutdown()); + // Unset the display manager's delegate here because // DisplayManager outlives WindowTreeHostManager. Shell::GetInstance()->display_manager()->set_delegate(nullptr); diff --git a/ash/display/window_tree_host_manager.h b/ash/display/window_tree_host_manager.h index 5d27699..67ae28d 100644 --- a/ash/display/window_tree_host_manager.h +++ b/ash/display/window_tree_host_manager.h @@ -72,7 +72,10 @@ class ASH_EXPORT WindowTreeHostManager // Invoked when the all display configuration changes // have been applied. - virtual void OnDisplayConfigurationChanged(){}; + virtual void OnDisplayConfigurationChanged() {} + + // Invoked in WindowTreeHostManager::Shutdown(). + virtual void OnWindowTreeHostManagerShutdown() {} protected: virtual ~Observer() {} @@ -225,7 +228,7 @@ class ASH_EXPORT WindowTreeHostManager // The mapping from display ID to its window tree host. WindowTreeHostMap window_tree_hosts_; - base::ObserverList<Observer> observers_; + base::ObserverList<Observer, true> observers_; // Store the primary window tree host temporarily while replacing // display. diff --git a/ash/shell.cc b/ash/shell.cc index 27697f6..b021e7b 100644 --- a/ash/shell.cc +++ b/ash/shell.cc @@ -1077,6 +1077,8 @@ void Shell::Init(const ShellInitParams& init_params) { // is started. display_manager_->CreateMirrorWindowAsyncIfAny(); + FOR_EACH_OBSERVER(ShellObserver, observers_, OnShellInitialized()); + user_metrics_recorder_->OnShellInitialized(); } diff --git a/ash/shell_observer.h b/ash/shell_observer.h index 3ea105b..da53428 100644 --- a/ash/shell_observer.h +++ b/ash/shell_observer.h @@ -63,6 +63,9 @@ class ASH_EXPORT ShellObserver { // animating but have been restored. virtual void OnMaximizeModeEnded() {} + // Called at the end of Shell::Init. + virtual void OnShellInitialized() {} + protected: virtual ~ShellObserver() {} }; |