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

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

Issue 169713003: Remove WindowState::IsNormalShowState() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « ash/wm/window_state.h ('k') | ash/wm/window_util.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/wm/window_state.h" 5 #include "ash/wm/window_state.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/root_window_controller.h" 8 #include "ash/root_window_controller.h"
9 #include "ash/screen_util.h" 9 #include "ash/screen_util.h"
10 #include "ash/shell_window_ids.h" 10 #include "ash/shell_window_ids.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 bool WindowState::IsFullscreen() const { 133 bool WindowState::IsFullscreen() const {
134 return GetShowState() == ui::SHOW_STATE_FULLSCREEN; 134 return GetShowState() == ui::SHOW_STATE_FULLSCREEN;
135 } 135 }
136 136
137 bool WindowState::IsMaximizedOrFullscreen() const { 137 bool WindowState::IsMaximizedOrFullscreen() const {
138 ui::WindowShowState show_state(GetShowState()); 138 ui::WindowShowState show_state(GetShowState());
139 return show_state == ui::SHOW_STATE_FULLSCREEN || 139 return show_state == ui::SHOW_STATE_FULLSCREEN ||
140 show_state == ui::SHOW_STATE_MAXIMIZED; 140 show_state == ui::SHOW_STATE_MAXIMIZED;
141 } 141 }
142 142
143 bool WindowState::IsNormalShowState() const { 143 bool WindowState::IsSnapped() const {
144 ui::WindowShowState state = GetShowState(); 144 return window_show_type_ == SHOW_TYPE_LEFT_SNAPPED ||
145 return state == ui::SHOW_STATE_NORMAL || state == ui::SHOW_STATE_DEFAULT; 145 window_show_type_ == SHOW_TYPE_RIGHT_SNAPPED;
146 } 146 }
147 147
148 bool WindowState::IsNormalShowType() const { 148 bool WindowState::IsNormalShowType() const {
149 return window_show_type_ == SHOW_TYPE_NORMAL || 149 return window_show_type_ == SHOW_TYPE_NORMAL ||
150 window_show_type_ == SHOW_TYPE_DEFAULT; 150 window_show_type_ == SHOW_TYPE_DEFAULT;
151 } 151 }
152 152
153 bool WindowState::IsNormalOrSnapped() const {
154 return IsNormalShowType() || IsSnapped();
155 }
156
153 bool WindowState::IsActive() const { 157 bool WindowState::IsActive() const {
154 return IsActiveWindow(window_); 158 return IsActiveWindow(window_);
155 } 159 }
156 160
157 bool WindowState::IsDocked() const { 161 bool WindowState::IsDocked() const {
158 return window_->parent() && 162 return window_->parent() &&
159 window_->parent()->id() == internal::kShellWindowId_DockedContainer; 163 window_->parent()->id() == internal::kShellWindowId_DockedContainer;
160 } 164 }
161 165
162 bool WindowState::IsSnapped() const {
163 return window_show_type_ == SHOW_TYPE_LEFT_SNAPPED ||
164 window_show_type_ == SHOW_TYPE_RIGHT_SNAPPED;
165 }
166
167 bool WindowState::CanMaximize() const { 166 bool WindowState::CanMaximize() const {
168 return window_->GetProperty(aura::client::kCanMaximizeKey); 167 return window_->GetProperty(aura::client::kCanMaximizeKey);
169 } 168 }
170 169
171 bool WindowState::CanMinimize() const { 170 bool WindowState::CanMinimize() const {
172 internal::RootWindowController* controller = 171 internal::RootWindowController* controller =
173 internal::RootWindowController::ForWindow(window_); 172 internal::RootWindowController::ForWindow(window_);
174 if (!controller) 173 if (!controller)
175 return false; 174 return false;
176 aura::Window* lockscreen = controller->GetContainer( 175 aura::Window* lockscreen = controller->GetContainer(
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 } 463 }
465 return settings; 464 return settings;
466 } 465 }
467 466
468 const WindowState* GetWindowState(const aura::Window* window) { 467 const WindowState* GetWindowState(const aura::Window* window) {
469 return GetWindowState(const_cast<aura::Window*>(window)); 468 return GetWindowState(const_cast<aura::Window*>(window));
470 } 469 }
471 470
472 } // namespace wm 471 } // namespace wm
473 } // namespace ash 472 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/window_state.h ('k') | ash/wm/window_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698