| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/exo/shell_surface.h" | 5 #include "components/exo/shell_surface.h" |
| 6 | 6 |
| 7 #include "ash/aura/wm_window_aura.h" | 7 #include "ash/aura/wm_window_aura.h" |
| 8 #include "ash/common/shell_window_ids.h" | 8 #include "ash/common/shell_window_ids.h" |
| 9 #include "ash/common/wm/window_resizer.h" | 9 #include "ash/common/wm/window_resizer.h" |
| 10 #include "ash/common/wm/window_state.h" | 10 #include "ash/common/wm/window_state.h" |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 if (!widget_) | 397 if (!widget_) |
| 398 CreateShellSurfaceWidget(ui::SHOW_STATE_FULLSCREEN); | 398 CreateShellSurfaceWidget(ui::SHOW_STATE_FULLSCREEN); |
| 399 | 399 |
| 400 // Note: This will ask client to configure its surface even if fullscreen | 400 // Note: This will ask client to configure its surface even if fullscreen |
| 401 // state doesn't change. | 401 // state doesn't change. |
| 402 ScopedConfigure scoped_configure(this, true); | 402 ScopedConfigure scoped_configure(this, true); |
| 403 widget_->SetFullscreen(fullscreen); | 403 widget_->SetFullscreen(fullscreen); |
| 404 UpdateShelfStateForFullscreenChange(widget_); | 404 UpdateShelfStateForFullscreenChange(widget_); |
| 405 } | 405 } |
| 406 | 406 |
| 407 void ShellSurface::SetPinned(bool pinned) { | 407 void ShellSurface::SetPinned(bool pinned, bool trusted) { |
| 408 TRACE_EVENT1("exo", "ShellSurface::SetPinned", "pinned", pinned); | 408 TRACE_EVENT2("exo", "ShellSurface::SetPinned", "pinned", pinned, "trusted", |
| 409 trusted); |
| 409 | 410 |
| 410 if (!widget_) | 411 if (!widget_) |
| 411 CreateShellSurfaceWidget(ui::SHOW_STATE_NORMAL); | 412 CreateShellSurfaceWidget(ui::SHOW_STATE_NORMAL); |
| 412 | 413 |
| 413 // Note: This will ask client to configure its surface even if pinned | 414 // Note: This will ask client to configure its surface even if pinned |
| 414 // state doesn't change. | 415 // state doesn't change. |
| 415 ScopedConfigure scoped_configure(this, true); | 416 ScopedConfigure scoped_configure(this, true); |
| 416 if (pinned) { | 417 if (pinned) { |
| 417 ash::wm::PinWindow(widget_->GetNativeWindow()); | 418 ash::wm::PinWindow(widget_->GetNativeWindow(), trusted); |
| 418 } else { | 419 } else { |
| 419 // At the moment, we cannot just unpin the window state, due to ash | 420 // At the moment, we cannot just unpin the window state, due to ash |
| 420 // implementation. Instead, we call Restore() to unpin, if it is Pinned | 421 // implementation. Instead, we call Restore() to unpin, if it is Pinned |
| 421 // state. In this implementation, we may loose the previous state, | 422 // state. In this implementation, we may loose the previous state, |
| 422 // if the previous state is fullscreen, etc. | 423 // if the previous state is fullscreen, etc. |
| 423 if (ash::wm::GetWindowState(widget_->GetNativeWindow())->IsPinned()) | 424 if (ash::wm::GetWindowState(widget_->GetNativeWindow())->IsPinned()) |
| 424 widget_->Restore(); | 425 widget_->Restore(); |
| 425 } | 426 } |
| 426 } | 427 } |
| 427 | 428 |
| (...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1294 shadow_overlay_->layer()->Add(shadow->layer()); | 1295 shadow_overlay_->layer()->Add(shadow->layer()); |
| 1295 window->AddChild(shadow_overlay_); | 1296 window->AddChild(shadow_overlay_); |
| 1296 shadow_overlay_->Show(); | 1297 shadow_overlay_->Show(); |
| 1297 } | 1298 } |
| 1298 shadow_overlay_->SetBounds(shadow_bounds); | 1299 shadow_overlay_->SetBounds(shadow_bounds); |
| 1299 shadow->SetContentBounds(gfx::Rect(shadow_bounds.size())); | 1300 shadow->SetContentBounds(gfx::Rect(shadow_bounds.size())); |
| 1300 } | 1301 } |
| 1301 } | 1302 } |
| 1302 | 1303 |
| 1303 } // namespace exo | 1304 } // namespace exo |
| OLD | NEW |