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

Unified Diff: ash/common/wm/maximize_mode/maximize_mode_window_state.cc

Issue 2590123002: Prevent maximize/minimize/fullscreen-ize window in trusted pinned mode. (Closed)
Patch Set: Created 4 years 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/maximize_mode/maximize_mode_window_state.cc
diff --git a/ash/common/wm/maximize_mode/maximize_mode_window_state.cc b/ash/common/wm/maximize_mode/maximize_mode_window_state.cc
index fc240bb71a2dcac5f63c4697ddb91d0dd40efde3..60053fcd39c860d0763312a5f277a7c5ac1f74a4 100644
--- a/ash/common/wm/maximize_mode/maximize_mode_window_state.cc
+++ b/ash/common/wm/maximize_mode/maximize_mode_window_state.cc
@@ -133,9 +133,13 @@ void MaximizeModeWindowState::OnWMEvent(wm::WindowState* window_state,
const wm::WMEvent* event) {
switch (event->type()) {
case wm::WM_EVENT_TOGGLE_FULLSCREEN:
+ if (window_state->IsTrustedPinned())
+ return;
oshima 2016/12/21 01:38:58 FYI: ARC windows are no longer using this class. W
hidehiko 2016/12/21 06:57:30 Thanks, so reverted this file. Let's address remov
ToggleFullScreen(window_state, window_state->delegate());
break;
case wm::WM_EVENT_FULLSCREEN:
+ if (window_state->IsTrustedPinned())
+ return;
UpdateWindow(window_state, wm::WINDOW_STATE_TYPE_FULLSCREEN, true);
break;
case wm::WM_EVENT_PIN:
@@ -150,18 +154,23 @@ void MaximizeModeWindowState::OnWMEvent(wm::WindowState* window_state,
case wm::WM_EVENT_TOGGLE_VERTICAL_MAXIMIZE:
case wm::WM_EVENT_TOGGLE_HORIZONTAL_MAXIMIZE:
case wm::WM_EVENT_TOGGLE_MAXIMIZE:
+ case wm::WM_EVENT_MAXIMIZE:
+ if (window_state->IsTrustedPinned())
+ return;
+ // Fall through.
case wm::WM_EVENT_CYCLE_SNAP_DOCK_LEFT:
case wm::WM_EVENT_CYCLE_SNAP_DOCK_RIGHT:
case wm::WM_EVENT_CENTER:
case wm::WM_EVENT_SNAP_LEFT:
case wm::WM_EVENT_SNAP_RIGHT:
case wm::WM_EVENT_NORMAL:
- case wm::WM_EVENT_MAXIMIZE:
case wm::WM_EVENT_DOCK:
UpdateWindow(window_state, GetMaximizedOrCenteredWindowType(window_state),
true);
return;
case wm::WM_EVENT_MINIMIZE:
+ if (window_state->IsTrustedPinned())
+ return;
UpdateWindow(window_state, wm::WINDOW_STATE_TYPE_MINIMIZED, true);
return;
case wm::WM_EVENT_SHOW_INACTIVE:

Powered by Google App Engine
This is Rietveld 408576698