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

Unified Diff: ash/common/wm/default_state.cc

Issue 2072853002: Implement "pinned" mode in ash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: ash/common/wm/default_state.cc
diff --git a/ash/common/wm/default_state.cc b/ash/common/wm/default_state.cc
index 2579ff16311b176a91f3339c9ec329f23777443b..a514fa0621b6240cfc436a1370bb499657b168e6 100644
--- a/ash/common/wm/default_state.cc
+++ b/ash/common/wm/default_state.cc
@@ -205,10 +205,17 @@ void DefaultState::OnWMEvent(WindowState* window_state, const WMEvent* event) {
next_state_type = WINDOW_STATE_TYPE_INACTIVE;
break;
case WM_EVENT_PIN:
- // TODO(hidehiko): Check if the window can be pinnable. If a system modal
- // window is openening, or if there already is another pinned window,
- // the pinning should fail.
- next_state_type = WINDOW_STATE_TYPE_PINNED;
+ // If there already is a pinned window, it is not allowed to set it
+ // to this window.
+ // TODO(hidehiko): If a system modal window is openening, the pinning
+ // probably should fail.
+ if (WmShell::Get()->IsPinned()) {
+ LOG(ERROR) << "An PIN event is triggered, while another window is "
+ << "already in pinned mode.";
+ next_state_type = current_state_type;
+ } else {
+ next_state_type = WINDOW_STATE_TYPE_PINNED;
+ }
break;
case WM_EVENT_TOGGLE_MAXIMIZE_CAPTION:
case WM_EVENT_TOGGLE_MAXIMIZE:

Powered by Google App Engine
This is Rietveld 408576698