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

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

Issue 2778733004: Add WindowPinType property on arua::Window (Closed)
Patch Set: WIP Created 3 years, 8 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
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 <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/common/frame/custom_frame_view_ash.h" 9 #include "ash/common/frame/custom_frame_view_ash.h"
10 #include "ash/common/shelf/wm_shelf.h" 10 #include "ash/common/shelf/wm_shelf.h"
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 TRACE_EVENT2("exo", "ShellSurface::SetPinned", "pinned", pinned, "trusted", 486 TRACE_EVENT2("exo", "ShellSurface::SetPinned", "pinned", pinned, "trusted",
487 trusted); 487 trusted);
488 488
489 if (!widget_) 489 if (!widget_)
490 CreateShellSurfaceWidget(ui::SHOW_STATE_NORMAL); 490 CreateShellSurfaceWidget(ui::SHOW_STATE_NORMAL);
491 491
492 // Note: This will ask client to configure its surface even if pinned 492 // Note: This will ask client to configure its surface even if pinned
493 // state doesn't change. 493 // state doesn't change.
494 ScopedConfigure scoped_configure(this, true); 494 ScopedConfigure scoped_configure(this, true);
495 if (pinned) { 495 if (pinned) {
496 ash::wm::PinWindow(widget_->GetNativeWindow(), trusted); 496 widget_->Pin(trusted);
497 } else { 497 } else {
498 // At the moment, we cannot just unpin the window state, due to ash 498 // At the moment, we cannot just unpin the window state, due to ash
499 // implementation. Instead, we call Restore() to unpin, if it is Pinned 499 // implementation. Instead, we call Restore() to unpin, if it is Pinned
500 // state. In this implementation, we may loose the previous state, 500 // state. In this implementation, we may loose the previous state,
501 // if the previous state is fullscreen, etc. 501 // if the previous state is fullscreen, etc.
502 if (ash::wm::GetWindowState(widget_->GetNativeWindow())->IsPinned()) 502 if (widget_->IsPinned())
503 widget_->Restore(); 503 widget_->Restore();
504 } 504 }
505 } 505 }
506 506
507 void ShellSurface::SetSystemUiVisibility(bool autohide) { 507 void ShellSurface::SetSystemUiVisibility(bool autohide) {
508 TRACE_EVENT1("exo", "ShellSurface::SetSystemUiVisibility", "autohide", 508 TRACE_EVENT1("exo", "ShellSurface::SetSystemUiVisibility", "autohide",
509 autohide); 509 autohide);
510 // TODO: Implemented in next CL. crbug.com/705723 510 // TODO: Implemented in next CL. crbug.com/705723
511 NOTIMPLEMENTED(); 511 NOTIMPLEMENTED();
512 } 512 }
(...skipping 1192 matching lines...) Expand 10 before | Expand all | Expand 10 after
1705 gfx::Point ShellSurface::GetMouseLocation() const { 1705 gfx::Point ShellSurface::GetMouseLocation() const {
1706 aura::Window* const root_window = widget_->GetNativeWindow()->GetRootWindow(); 1706 aura::Window* const root_window = widget_->GetNativeWindow()->GetRootWindow();
1707 gfx::Point location = 1707 gfx::Point location =
1708 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot(); 1708 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot();
1709 aura::Window::ConvertPointToTarget( 1709 aura::Window::ConvertPointToTarget(
1710 root_window, widget_->GetNativeWindow()->parent(), &location); 1710 root_window, widget_->GetNativeWindow()->parent(), &location);
1711 return location; 1711 return location;
1712 } 1712 }
1713 1713
1714 } // namespace exo 1714 } // namespace exo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698