Chromium Code Reviews| Index: components/exo/shell_surface.cc |
| diff --git a/components/exo/shell_surface.cc b/components/exo/shell_surface.cc |
| index c1fa2e241f7a6addcfb00bf66067b71935064209..9ce392b607ed5285d089ca3320f08b5dcf871b26 100644 |
| --- a/components/exo/shell_surface.cc |
| +++ b/components/exo/shell_surface.cc |
| @@ -13,6 +13,7 @@ |
| #include "ash/common/wm_shell.h" |
| #include "ash/common/wm_window.h" |
| #include "ash/public/cpp/shell_window_ids.h" |
| +#include "ash/public/cpp/window_properties.h" |
| #include "ash/wm/drag_window_resizer.h" |
| #include "ash/wm/window_state_aura.h" |
| #include "ash/wm/window_util.h" |
| @@ -49,6 +50,14 @@ |
| namespace exo { |
| namespace { |
| +ash::mojom::WindowPinType GetPinType(bool pinned, bool trusted) { |
|
reveman
2017/04/04 07:13:14
Please change ShellSurface::SetPinned to take an a
Peng
2017/04/04 15:08:14
Done.
|
| + if (pinned) { |
| + return trusted ? ash::mojom::WindowPinType::TRUSTED_PINNED |
| + : ash::mojom::WindowPinType::PINNED; |
| + } |
| + return ash::mojom::WindowPinType::NONE; |
| +} |
| + |
| // This is a struct for accelerator keys used to close ShellSurfaces. |
| const struct Accelerator { |
| ui::KeyboardCode keycode; |
| @@ -492,16 +501,8 @@ void ShellSurface::SetPinned(bool pinned, bool trusted) { |
| // Note: This will ask client to configure its surface even if pinned |
| // state doesn't change. |
| ScopedConfigure scoped_configure(this, true); |
| - if (pinned) { |
| - ash::wm::PinWindow(widget_->GetNativeWindow(), trusted); |
| - } else { |
| - // At the moment, we cannot just unpin the window state, due to ash |
| - // implementation. Instead, we call Restore() to unpin, if it is Pinned |
| - // state. In this implementation, we may loose the previous state, |
| - // if the previous state is fullscreen, etc. |
| - if (ash::wm::GetWindowState(widget_->GetNativeWindow())->IsPinned()) |
| - widget_->Restore(); |
| - } |
| + widget_->GetNativeWindow()->SetProperty(ash::kWindowPinTypeKey, |
| + GetPinType(pinned, trusted)); |
| } |
| void ShellSurface::SetSystemUiVisibility(bool autohide) { |