Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Side by Side Diff: components/exo/shell_surface.cc

Issue 2285633002: Add WM_EVENT_TRUSTED_PIN and WINDOW_STATE_TYPE_TRUSTED_PINNED to Ash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/exo/shell_surface.h ('k') | components/exo/shell_surface_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « components/exo/shell_surface.h ('k') | components/exo/shell_surface_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698