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

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..c8aacb8f0938435c631019d2b3995e3ef3e48bed 100644
--- a/ash/common/wm/default_state.cc
+++ b/ash/common/wm/default_state.cc
@@ -205,10 +205,12 @@ 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.
+ next_state_type = WmShell::Get()->IsPinned() ? current_state_type
oshima 2016/06/18 04:47:44 you may want to log when the request wasn't fulfil
hidehiko 2016/06/18 05:32:45 Done.
+ : 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