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

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

Issue 2542493002: Replace kCanMaximize/Minimize/Resize with kResizeBehavior. (Closed)
Patch Set: Fix int->bool compile issue. 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/aura/wm_window_aura.cc ('k') | ash/mus/non_client_frame_controller.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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 bool WindowState::IsUserPositionable() const { 109 bool WindowState::IsUserPositionable() const {
110 return (window_->GetType() == ui::wm::WINDOW_TYPE_NORMAL || 110 return (window_->GetType() == ui::wm::WINDOW_TYPE_NORMAL ||
111 window_->GetType() == ui::wm::WINDOW_TYPE_PANEL); 111 window_->GetType() == ui::wm::WINDOW_TYPE_PANEL);
112 } 112 }
113 113
114 bool WindowState::ShouldBeExcludedFromMru() const { 114 bool WindowState::ShouldBeExcludedFromMru() const {
115 return window_->GetBoolProperty(ash::WmWindowProperty::EXCLUDE_FROM_MRU); 115 return window_->GetBoolProperty(ash::WmWindowProperty::EXCLUDE_FROM_MRU);
116 } 116 }
117 117
118 bool WindowState::CanMaximize() const { 118 bool WindowState::CanMaximize() const {
119 // Window must have the kCanMaximizeKey and have no maximum width or height. 119 // Window must allow maximization and have no maximum width or height.
120 if (!window_->CanMaximize()) 120 if (!window_->CanMaximize())
121 return false; 121 return false;
122 122
123 if (!window_->HasNonClientArea()) 123 if (!window_->HasNonClientArea())
124 return true; 124 return true;
125 125
126 gfx::Size max_size = window_->GetMaximumSize(); 126 gfx::Size max_size = window_->GetMaximumSize();
127 return !max_size.width() && !max_size.height(); 127 return !max_size.width() && !max_size.height();
128 } 128 }
129 129
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 if (!window_->GetTargetVisibility()) { 396 if (!window_->GetTargetVisibility()) {
397 SetBoundsConstrained(new_bounds); 397 SetBoundsConstrained(new_bounds);
398 return; 398 return;
399 } 399 }
400 400
401 window_->SetBoundsDirectCrossFade(new_bounds); 401 window_->SetBoundsDirectCrossFade(new_bounds);
402 } 402 }
403 403
404 } // namespace wm 404 } // namespace wm
405 } // namespace ash 405 } // namespace ash
OLDNEW
« no previous file with comments | « ash/aura/wm_window_aura.cc ('k') | ash/mus/non_client_frame_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698