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

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
« no previous file with comments | « ui/views/mus/desktop_window_tree_host_mus.h ('k') | ui/views/mus/mus_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..a93effd3b0efee4603b06679a1ffe059ed43c185 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());
+ DCHECK(!window->GetRootWindow() || this->window() == window->GetRootWindow());
+ if (!this->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, this->window(), key);
+ }
+}
+
void DesktopWindowTreeHostMus::ShowImpl() {
native_widget_delegate_->OnNativeWidgetVisibilityChanging(true);
// Using ui::SHOW_STATE_NORMAL matches that of DesktopWindowTreeHostX11.
« no previous file with comments | « ui/views/mus/desktop_window_tree_host_mus.h ('k') | ui/views/mus/mus_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698