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

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

Issue 1953293004: PlatformWindowMus::SetBounds to NativeWidgetMus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move OnWindowBoundsChanged; add getters to clean up MusWindowObserver Created 4 years, 7 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 | « no previous file | ui/views/mus/platform_window_mus.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/mus/native_widget_mus.cc
diff --git a/ui/views/mus/native_widget_mus.cc b/ui/views/mus/native_widget_mus.cc
index 1a26212b4f20749202c530faa5f2cfe7d86076c7..452b66cedab5f22b9cb07e21d17178eeb734884b 100644
--- a/ui/views/mus/native_widget_mus.cc
+++ b/ui/views/mus/native_widget_mus.cc
@@ -298,11 +298,11 @@ class NativeWidgetMus::MusWindowObserver : public mus::WindowObserver {
public:
explicit MusWindowObserver(NativeWidgetMus* native_widget_mus)
: native_widget_mus_(native_widget_mus) {
- native_widget_mus_->window_->AddObserver(this);
+ mus_window()->AddObserver(this);
}
~MusWindowObserver() override {
- native_widget_mus_->window_->RemoveObserver(this);
+ mus_window()->RemoveObserver(this);
}
// mus::WindowObserver:
@@ -312,8 +312,18 @@ class NativeWidgetMus::MusWindowObserver : public mus::WindowObserver {
void OnWindowVisibilityChanged(mus::Window* window) override {
native_widget_mus_->OnMusWindowVisibilityChanged(window);
}
+ void OnWindowBoundsChanged(mus::Window* window,
+ const gfx::Rect& old_bounds,
+ const gfx::Rect& new_bounds) override {
+ window_tree_host()->OnBoundsChanged(new_bounds);
+ }
private:
+ mus::Window* mus_window() { return native_widget_mus_->window(); }
+ WindowTreeHostMus* window_tree_host() {
sadrul 2016/05/09 20:19:46 Change this to aura::WindowTreeHost*. That should
Mark Dittmer 2016/05/10 13:26:03 I believe OnBoundsChanged is part of the PlatformW
+ return native_widget_mus_->window_tree_host();
+ }
+
NativeWidgetMus* native_widget_mus_;
DISALLOW_COPY_AND_ASSIGN(MusWindowObserver);
@@ -722,7 +732,7 @@ std::string NativeWidgetMus::GetWorkspace() const {
}
void NativeWidgetMus::SetBounds(const gfx::Rect& bounds) {
- if (!window_tree_host_)
+ if (!(window_ && window_tree_host_))
return;
gfx::Size size(bounds.size());
@@ -732,6 +742,7 @@ void NativeWidgetMus::SetBounds(const gfx::Rect& bounds) {
size.SetToMin(max_size);
size.SetToMax(min_size);
window_tree_host_->SetBounds(gfx::Rect(bounds.origin(), size));
+ window_->SetBounds(gfx::Rect(bounds.origin(), size));
}
void NativeWidgetMus::SetSize(const gfx::Size& size) {
« no previous file with comments | « no previous file | ui/views/mus/platform_window_mus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698