Chromium Code Reviews| Index: ash/frame/custom_frame_view_ash.cc |
| diff --git a/ash/frame/custom_frame_view_ash.cc b/ash/frame/custom_frame_view_ash.cc |
| index eebc44354de982eb080f8da403c7eb4330c26c44..848dc486fb74464e4c528dd70575362083636693 100644 |
| --- a/ash/frame/custom_frame_view_ash.cc |
| +++ b/ash/frame/custom_frame_view_ash.cc |
| @@ -15,6 +15,7 @@ |
| #include "ash/session/session_state_delegate.h" |
| #include "ash/shell.h" |
| #include "ash/shell_observer.h" |
| +#include "ash/wm/aura/wm_window_aura.h" |
| #include "ash/wm/immersive_fullscreen_controller.h" |
| #include "ash/wm/window_state.h" |
| #include "ash/wm/window_state_aura.h" |
| @@ -64,12 +65,14 @@ class CustomFrameViewAshWindowStateDelegate |
| // TODO(pkotwicz): This is a hack. Remove ASAP. http://crbug.com/319048 |
| window_state_ = window_state; |
| window_state_->AddObserver(this); |
| - window_state_->aura_window()->AddObserver(this); |
| + ash::wm::WmWindowAura::GetAuraWindow(window_state_->window()) |
| + ->AddObserver(this); |
| } |
| ~CustomFrameViewAshWindowStateDelegate() override { |
| if (window_state_) { |
| window_state_->RemoveObserver(this); |
| - window_state_->aura_window()->RemoveObserver(this); |
| + ash::wm::WmWindowAura::GetAuraWindow(window_state_->window()) |
| + ->RemoveObserver(this); |
| } |
| } |
| private: |
| @@ -77,8 +80,8 @@ class CustomFrameViewAshWindowStateDelegate |
| bool ToggleFullscreen(ash::wm::WindowState* window_state) override { |
| bool enter_fullscreen = !window_state->IsFullscreen(); |
| if (enter_fullscreen) { |
| - window_state->aura_window()->SetProperty(aura::client::kShowStateKey, |
| - ui::SHOW_STATE_FULLSCREEN); |
| + ash::wm::WmWindowAura::GetAuraWindow(window_state->window()) |
| + ->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN); |
| } else { |
| window_state->Restore(); |
| } |
| @@ -92,7 +95,8 @@ class CustomFrameViewAshWindowStateDelegate |
| // Overridden from aura::WindowObserver: |
| void OnWindowDestroying(aura::Window* window) override { |
| window_state_->RemoveObserver(this); |
| - window_state_->aura_window()->RemoveObserver(this); |
| + ash::wm::WmWindowAura::GetAuraWindow(window_state_->window()) |
|
James Cook
2016/04/26 00:46:43
optional: Add a utility function aura::Window* Get
sky
2016/04/26 02:57:22
Done.
|
| + ->RemoveObserver(this); |
| window_state_ = NULL; |
| } |
| // Overridden from ash::wm::WindowStateObserver: |