OLD | NEW |
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_ash.h" | 9 #include "ash/screen_ash.h" |
10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 bool WindowState::CanResize() const { | 126 bool WindowState::CanResize() const { |
127 return window_->GetProperty(aura::client::kCanResizeKey); | 127 return window_->GetProperty(aura::client::kCanResizeKey); |
128 } | 128 } |
129 | 129 |
130 bool WindowState::CanActivate() const { | 130 bool WindowState::CanActivate() const { |
131 return views::corewm::CanActivateWindow(window_); | 131 return views::corewm::CanActivateWindow(window_); |
132 } | 132 } |
133 | 133 |
134 bool WindowState::CanSnap() const { | 134 bool WindowState::CanSnap() const { |
135 if (!CanResize() || window_->type() == ui::wm::WINDOW_TYPE_PANEL || | 135 if (!CanResize() || window_->type() == ui::wm::WINDOW_TYPE_PANEL || |
136 window_->transient_parent()) | 136 views::corewm::GetTransientParent(window_)) |
137 return false; | 137 return false; |
138 // If a window has a maximum size defined, snapping may make it too big. | 138 // If a window has a maximum size defined, snapping may make it too big. |
139 return window_->delegate() ? window_->delegate()->GetMaximumSize().IsEmpty() : | 139 return window_->delegate() ? window_->delegate()->GetMaximumSize().IsEmpty() : |
140 true; | 140 true; |
141 } | 141 } |
142 | 142 |
143 bool WindowState::HasRestoreBounds() const { | 143 bool WindowState::HasRestoreBounds() const { |
144 return window_->GetProperty(aura::client::kRestoreBoundsKey) != NULL; | 144 return window_->GetProperty(aura::client::kRestoreBoundsKey) != NULL; |
145 } | 145 } |
146 | 146 |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 } | 323 } |
324 return settings; | 324 return settings; |
325 } | 325 } |
326 | 326 |
327 const WindowState* GetWindowState(const aura::Window* window) { | 327 const WindowState* GetWindowState(const aura::Window* window) { |
328 return GetWindowState(const_cast<aura::Window*>(window)); | 328 return GetWindowState(const_cast<aura::Window*>(window)); |
329 } | 329 } |
330 | 330 |
331 } // namespace wm | 331 } // namespace wm |
332 } // namespace ash | 332 } // namespace ash |
OLD | NEW |