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

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

Issue 2285633002: Add WM_EVENT_TRUSTED_PIN and WINDOW_STATE_TYPE_TRUSTED_PINNED to Ash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 4 years, 3 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
« no previous file with comments | « ash/common/wm/maximize_mode/maximize_mode_window_state.cc ('k') | ash/common/wm/wm_event.h » ('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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 bool WindowState::IsMaximized() const { 68 bool WindowState::IsMaximized() const {
69 return GetStateType() == WINDOW_STATE_TYPE_MAXIMIZED; 69 return GetStateType() == WINDOW_STATE_TYPE_MAXIMIZED;
70 } 70 }
71 71
72 bool WindowState::IsFullscreen() const { 72 bool WindowState::IsFullscreen() const {
73 return GetStateType() == WINDOW_STATE_TYPE_FULLSCREEN; 73 return GetStateType() == WINDOW_STATE_TYPE_FULLSCREEN;
74 } 74 }
75 75
76 bool WindowState::IsMaximizedOrFullscreenOrPinned() const { 76 bool WindowState::IsMaximizedOrFullscreenOrPinned() const {
77 return GetStateType() == WINDOW_STATE_TYPE_MAXIMIZED || 77 return GetStateType() == WINDOW_STATE_TYPE_MAXIMIZED ||
78 GetStateType() == WINDOW_STATE_TYPE_FULLSCREEN || 78 GetStateType() == WINDOW_STATE_TYPE_FULLSCREEN || IsPinned();
79 GetStateType() == WINDOW_STATE_TYPE_PINNED;
80 } 79 }
81 80
82 bool WindowState::IsSnapped() const { 81 bool WindowState::IsSnapped() const {
83 return GetStateType() == WINDOW_STATE_TYPE_LEFT_SNAPPED || 82 return GetStateType() == WINDOW_STATE_TYPE_LEFT_SNAPPED ||
84 GetStateType() == WINDOW_STATE_TYPE_RIGHT_SNAPPED; 83 GetStateType() == WINDOW_STATE_TYPE_RIGHT_SNAPPED;
85 } 84 }
86 85
87 bool WindowState::IsPinned() const { 86 bool WindowState::IsPinned() const {
88 return GetStateType() == WINDOW_STATE_TYPE_PINNED; 87 return GetStateType() == WINDOW_STATE_TYPE_PINNED ||
88 GetStateType() == WINDOW_STATE_TYPE_TRUSTED_PINNED;
89 } 89 }
90 90
91 bool WindowState::IsNormalStateType() const { 91 bool WindowState::IsNormalStateType() const {
92 return GetStateType() == WINDOW_STATE_TYPE_NORMAL || 92 return GetStateType() == WINDOW_STATE_TYPE_NORMAL ||
93 GetStateType() == WINDOW_STATE_TYPE_DEFAULT; 93 GetStateType() == WINDOW_STATE_TYPE_DEFAULT;
94 } 94 }
95 95
96 bool WindowState::IsNormalOrSnapped() const { 96 bool WindowState::IsNormalOrSnapped() const {
97 return IsNormalStateType() || IsSnapped(); 97 return IsNormalStateType() || IsSnapped();
98 } 98 }
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 if (!window_->GetTargetVisibility()) { 395 if (!window_->GetTargetVisibility()) {
396 SetBoundsConstrained(new_bounds); 396 SetBoundsConstrained(new_bounds);
397 return; 397 return;
398 } 398 }
399 399
400 window_->SetBoundsDirectCrossFade(new_bounds); 400 window_->SetBoundsDirectCrossFade(new_bounds);
401 } 401 }
402 402
403 } // namespace wm 403 } // namespace wm
404 } // namespace ash 404 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/wm/maximize_mode/maximize_mode_window_state.cc ('k') | ash/common/wm/wm_event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698