Chromium Code Reviews| 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) { |