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

Side by Side Diff: ash/common/wm/window_state.cc

Issue 2590123002: Prevent maximize/minimize/fullscreen-ize window in trusted pinned mode. (Closed)
Patch Set: Address comments 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 unified diff | Download patch
« no previous file with comments | « ash/common/wm/window_state.h ('k') | ash/wm/window_state_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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ash/common/wm/window_state.h" 5 #include "ash/common/wm/window_state.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/common/wm/default_state.h" 9 #include "ash/common/wm/default_state.h"
10 #include "ash/common/wm/window_positioning_utils.h" 10 #include "ash/common/wm/window_positioning_utils.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 bool WindowState::IsSnapped() const { 80 bool WindowState::IsSnapped() const {
81 return GetStateType() == WINDOW_STATE_TYPE_LEFT_SNAPPED || 81 return GetStateType() == WINDOW_STATE_TYPE_LEFT_SNAPPED ||
82 GetStateType() == WINDOW_STATE_TYPE_RIGHT_SNAPPED; 82 GetStateType() == WINDOW_STATE_TYPE_RIGHT_SNAPPED;
83 } 83 }
84 84
85 bool WindowState::IsPinned() const { 85 bool WindowState::IsPinned() const {
86 return GetStateType() == WINDOW_STATE_TYPE_PINNED || 86 return GetStateType() == WINDOW_STATE_TYPE_PINNED ||
87 GetStateType() == WINDOW_STATE_TYPE_TRUSTED_PINNED; 87 GetStateType() == WINDOW_STATE_TYPE_TRUSTED_PINNED;
88 } 88 }
89 89
90 bool WindowState::IsTrustedPinned() const {
91 return GetStateType() == WINDOW_STATE_TYPE_TRUSTED_PINNED;
92 }
93
90 bool WindowState::IsNormalStateType() const { 94 bool WindowState::IsNormalStateType() const {
91 return GetStateType() == WINDOW_STATE_TYPE_NORMAL || 95 return GetStateType() == WINDOW_STATE_TYPE_NORMAL ||
92 GetStateType() == WINDOW_STATE_TYPE_DEFAULT; 96 GetStateType() == WINDOW_STATE_TYPE_DEFAULT;
93 } 97 }
94 98
95 bool WindowState::IsNormalOrSnapped() const { 99 bool WindowState::IsNormalOrSnapped() const {
96 return IsNormalStateType() || IsSnapped(); 100 return IsNormalStateType() || IsSnapped();
97 } 101 }
98 102
99 bool WindowState::IsActive() const { 103 bool WindowState::IsActive() const {
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 if (!window_->GetTargetVisibility()) { 390 if (!window_->GetTargetVisibility()) {
387 SetBoundsConstrained(new_bounds); 391 SetBoundsConstrained(new_bounds);
388 return; 392 return;
389 } 393 }
390 394
391 window_->SetBoundsDirectCrossFade(new_bounds); 395 window_->SetBoundsDirectCrossFade(new_bounds);
392 } 396 }
393 397
394 } // namespace wm 398 } // namespace wm
395 } // namespace ash 399 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/wm/window_state.h ('k') | ash/wm/window_state_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698