Index: ui/views/mus/desktop_window_tree_host_mus.cc |
diff --git a/ui/views/mus/desktop_window_tree_host_mus.cc b/ui/views/mus/desktop_window_tree_host_mus.cc |
index b89b191e5ddc0f112282b511648e3db7c6f1a1ae..9b11b07f8294502a1b0089c8ba97597262d55018 100644 |
--- a/ui/views/mus/desktop_window_tree_host_mus.cc |
+++ b/ui/views/mus/desktop_window_tree_host_mus.cc |
@@ -8,7 +8,6 @@ |
#include "ui/aura/client/aura_constants.h" |
#include "ui/aura/client/drag_drop_client.h" |
#include "ui/aura/client/focus_client.h" |
-#include "ui/aura/env.h" |
#include "ui/aura/mus/window_tree_host_mus.h" |
#include "ui/aura/window.h" |
#include "ui/display/screen.h" |
@@ -30,13 +29,11 @@ |
desktop_native_widget_aura_(desktop_native_widget_aura), |
fullscreen_restore_state_(ui::SHOW_STATE_DEFAULT), |
close_widget_factory_(this) { |
- aura::Env::GetInstance()->AddObserver(this); |
// TODO: use display id and bounds if available, likely need to pass in |
// InitParams for that. |
} |
DesktopWindowTreeHostMus::~DesktopWindowTreeHostMus() { |
- aura::Env::GetInstance()->RemoveObserver(this); |
desktop_native_widget_aura_->OnDesktopWindowTreeHostDestroyed(this); |
} |
@@ -202,22 +199,18 @@ |
} |
void DesktopWindowTreeHostMus::Activate() { |
- aura::Env::GetInstance()->SetActiveFocusClient( |
- aura::client::GetFocusClient(window()), window()); |
- if (is_active_) { |
- window()->Focus(); |
- if (window()->GetProperty(aura::client::kDrawAttentionKey)) |
- window()->SetProperty(aura::client::kDrawAttentionKey, false); |
- } |
+ window()->Focus(); |
+ if (window()->GetProperty(aura::client::kDrawAttentionKey)) |
+ window()->SetProperty(aura::client::kDrawAttentionKey, false); |
} |
void DesktopWindowTreeHostMus::Deactivate() { |
- // TODO: Deactivate() means focus next window, that needs to go to mus. |
- NOTIMPLEMENTED(); |
+ aura::client::GetActivationClient(window()->GetRootWindow()) |
+ ->DeactivateWindow(window()); |
} |
bool DesktopWindowTreeHostMus::IsActive() const { |
- return is_active_; |
+ return wm::IsActiveWindow(const_cast<aura::Window*>(window())); |
} |
void DesktopWindowTreeHostMus::Maximize() { |
@@ -360,18 +353,4 @@ |
widget->widget_delegate()->CanResize()); |
} |
-void DesktopWindowTreeHostMus::OnWindowInitialized(aura::Window* window) {} |
- |
-void DesktopWindowTreeHostMus::OnActiveFocusClientChanged( |
- aura::client::FocusClient* focus_client, |
- aura::Window* window) { |
- if (window == this->window()) { |
- is_active_ = true; |
- desktop_native_widget_aura_->HandleActivationChanged(true); |
- } else if (is_active_) { |
- is_active_ = false; |
- desktop_native_widget_aura_->HandleActivationChanged(false); |
- } |
-} |
- |
} // namespace views |