| Index: ui/wm/core/default_activation_client.cc
|
| diff --git a/ui/wm/core/default_activation_client.cc b/ui/wm/core/default_activation_client.cc
|
| index 20c0d79b7dc7fd121c7d21c236ce38e34581bc1b..e48418450652e5563c460ac1654d94c3466e410c 100644
|
| --- a/ui/wm/core/default_activation_client.cc
|
| +++ b/ui/wm/core/default_activation_client.cc
|
| @@ -59,6 +59,14 @@ void DefaultActivationClient::RemoveObserver(
|
| }
|
|
|
| void DefaultActivationClient::ActivateWindow(aura::Window* window) {
|
| + ActivateWindowImpl(aura::client::ActivationChangeObserver::ActivationReason::
|
| + ACTIVATION_CLIENT,
|
| + window);
|
| +}
|
| +
|
| +void DefaultActivationClient::ActivateWindowImpl(
|
| + aura::client::ActivationChangeObserver::ActivationReason reason,
|
| + aura::Window* window) {
|
| aura::Window* last_active = GetActiveWindow();
|
| if (last_active == window)
|
| return;
|
| @@ -69,24 +77,28 @@ void DefaultActivationClient::ActivateWindow(aura::Window* window) {
|
| window->parent()->StackChildAtTop(window);
|
| window->AddObserver(this);
|
|
|
| - FOR_EACH_OBSERVER(aura::client::ActivationChangeObserver,
|
| - observers_,
|
| - OnWindowActivated(window, last_active));
|
| + FOR_EACH_OBSERVER(aura::client::ActivationChangeObserver, observers_,
|
| + OnWindowActivated(reason, window, last_active));
|
|
|
| aura::client::ActivationChangeObserver* observer =
|
| aura::client::GetActivationChangeObserver(last_active);
|
| - if (observer)
|
| - observer->OnWindowActivated(window, last_active);
|
| + if (observer) {
|
| + observer->OnWindowActivated(reason, window, last_active);
|
| + }
|
| observer = aura::client::GetActivationChangeObserver(window);
|
| - if (observer)
|
| - observer->OnWindowActivated(window, last_active);
|
| + if (observer) {
|
| + observer->OnWindowActivated(reason, window, last_active);
|
| + }
|
| }
|
|
|
| void DefaultActivationClient::DeactivateWindow(aura::Window* window) {
|
| aura::client::ActivationChangeObserver* observer =
|
| aura::client::GetActivationChangeObserver(window);
|
| - if (observer)
|
| - observer->OnWindowActivated(NULL, window);
|
| + if (observer) {
|
| + observer->OnWindowActivated(aura::client::ActivationChangeObserver::
|
| + ActivationReason::ACTIVATION_CLIENT,
|
| + NULL, window);
|
| + }
|
| if (last_active_)
|
| ActivateWindow(last_active_);
|
| }
|
| @@ -121,8 +133,10 @@ void DefaultActivationClient::OnWindowDestroyed(aura::Window* window) {
|
| active_windows_.pop_back();
|
| aura::Window* next_active = GetActiveWindow();
|
| if (next_active && aura::client::GetActivationChangeObserver(next_active)) {
|
| - aura::client::GetActivationChangeObserver(next_active)->OnWindowActivated(
|
| - next_active, NULL);
|
| + aura::client::GetActivationChangeObserver(next_active)
|
| + ->OnWindowActivated(aura::client::ActivationChangeObserver::
|
| + ActivationReason::WINDOW_DISPOSITION_CHANGED,
|
| + next_active, NULL);
|
| }
|
| return;
|
| }
|
|
|