Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(249)

Unified Diff: ui/views/mus/desktop_window_tree_host_mus.cc

Issue 2655513002: mash: Relay some Chrome aura window properties to Ash. (Closed)
Patch Set: Address comments. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 22730162d1e027dc5a80d2f7b5399d245a236918..2645465779644e80f2886d5fbe28428ad21f51a7 100644
--- a/ui/views/mus/desktop_window_tree_host_mus.cc
+++ b/ui/views/mus/desktop_window_tree_host_mus.cc
@@ -20,6 +20,7 @@
#include "ui/gfx/geometry/dip_util.h"
#include "ui/views/corewm/tooltip_aura.h"
#include "ui/views/mus/mus_client.h"
+#include "ui/views/mus/mus_property_mirror.h"
#include "ui/views/mus/window_manager_frame_values.h"
#include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h"
#include "ui/views/widget/native_widget_aura.h"
@@ -182,6 +183,7 @@ DesktopWindowTreeHostMus::DesktopWindowTreeHostMus(
aura::Env::GetInstance()->AddObserver(this);
MusClient::Get()->AddObserver(this);
native_widget_delegate_->AsWidget()->AddObserver(this);
+ desktop_native_widget_aura_->content_window()->AddObserver(this);
// DesktopNativeWidgetAura registers the association between |content_window_|
// and Widget, but code may also want to go from the root (window()) to the
// Widget. This call enables that.
@@ -196,6 +198,7 @@ DesktopWindowTreeHostMus::~DesktopWindowTreeHostMus() {
// the cursor-client needs to be unset on the root-window before
// |cursor_manager_| is destroyed.
aura::client::SetCursorClient(window(), nullptr);
+ desktop_native_widget_aura_->content_window()->RemoveObserver(this);
native_widget_delegate_->AsWidget()->RemoveObserver(this);
MusClient::Get()->RemoveObserver(this);
aura::Env::GetInstance()->RemoveObserver(this);
@@ -693,6 +696,22 @@ void DesktopWindowTreeHostMus::OnWidgetActivationChanged(Widget* widget,
is_active_ = active;
}
+void DesktopWindowTreeHostMus::OnWindowPropertyChanged(aura::Window* window,
+ const void* key,
+ intptr_t old) {
+ DCHECK_EQ(window, desktop_native_widget_aura_->content_window());
+ aura::Window* root_window = window->GetRootWindow();
sky 2017/01/27 23:46:22 root_window is the same as window() in this file.
msw 2017/01/28 00:09:16 Done.
+ if (!root_window)
+ return;
+
+ // Allow mus clients to mirror widget window properties to their root windows.
+ MusPropertyMirror* property_mirror = MusClient::Get()->mus_property_mirror();
+ if (property_mirror) {
+ property_mirror->MirrorPropertyFromWidgetWindowToRootWindow(
+ window, root_window, key);
+ }
+}
+
void DesktopWindowTreeHostMus::ShowImpl() {
native_widget_delegate_->OnNativeWidgetVisibilityChanging(true);
// Using ui::SHOW_STATE_NORMAL matches that of DesktopWindowTreeHostX11.

Powered by Google App Engine
This is Rietveld 408576698