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_EVENT1("exo", "ShellSurface::SetPinned", "pinned", pinned); |
reveman
2016/08/26 12:44:29
nit: add trusted flag to trace event
hirono
2016/08/29 00:24:51
Done.
| |
409 | 409 |
410 if (!widget_) | 410 if (!widget_) |
411 CreateShellSurfaceWidget(ui::SHOW_STATE_NORMAL); | 411 CreateShellSurfaceWidget(ui::SHOW_STATE_NORMAL); |
412 | 412 |
413 // Note: This will ask client to configure its surface even if pinned | 413 // Note: This will ask client to configure its surface even if pinned |
414 // state doesn't change. | 414 // state doesn't change. |
415 ScopedConfigure scoped_configure(this, true); | 415 ScopedConfigure scoped_configure(this, true); |
416 if (pinned) { | 416 if (pinned) { |
417 ash::wm::PinWindow(widget_->GetNativeWindow()); | 417 ash::wm::PinWindow(widget_->GetNativeWindow(), trusted); |
418 } else { | 418 } else { |
419 // At the moment, we cannot just unpin the window state, due to ash | 419 // 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 | 420 // implementation. Instead, we call Restore() to unpin, if it is Pinned |
421 // state. In this implementation, we may loose the previous state, | 421 // state. In this implementation, we may loose the previous state, |
422 // if the previous state is fullscreen, etc. | 422 // if the previous state is fullscreen, etc. |
423 if (ash::wm::GetWindowState(widget_->GetNativeWindow())->IsPinned()) | 423 if (ash::wm::GetWindowState(widget_->GetNativeWindow())->IsPinned()) |
424 widget_->Restore(); | 424 widget_->Restore(); |
425 } | 425 } |
426 } | 426 } |
427 | 427 |
(...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1287 shadow_overlay_->layer()->Add(shadow->layer()); | 1287 shadow_overlay_->layer()->Add(shadow->layer()); |
1288 window->AddChild(shadow_overlay_); | 1288 window->AddChild(shadow_overlay_); |
1289 shadow_overlay_->Show(); | 1289 shadow_overlay_->Show(); |
1290 } | 1290 } |
1291 shadow_overlay_->SetBounds(shadow_bounds); | 1291 shadow_overlay_->SetBounds(shadow_bounds); |
1292 shadow->SetContentBounds(gfx::Rect(shadow_bounds.size())); | 1292 shadow->SetContentBounds(gfx::Rect(shadow_bounds.size())); |
1293 } | 1293 } |
1294 } | 1294 } |
1295 | 1295 |
1296 } // namespace exo | 1296 } // namespace exo |
OLD | NEW |