OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_util.h" | 5 #include "ash/wm/window_util.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/ash_constants.h" | 9 #include "ash/ash_constants.h" |
10 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 return true; | 70 return true; |
71 } | 71 } |
72 | 72 |
73 bool CanResizeWindow(const aura::Window* window) { | 73 bool CanResizeWindow(const aura::Window* window) { |
74 return window->GetProperty(aura::client::kCanResizeKey); | 74 return window->GetProperty(aura::client::kCanResizeKey); |
75 } | 75 } |
76 | 76 |
77 bool CanSnapWindow(aura::Window* window) { | 77 bool CanSnapWindow(aura::Window* window) { |
78 if (!CanResizeWindow(window)) | 78 if (!CanResizeWindow(window)) |
79 return false; | 79 return false; |
| 80 if (window->type() == aura::client::WINDOW_TYPE_PANEL) |
| 81 return false; |
80 // If a window has a maximum size defined, snapping may make it too big. | 82 // If a window has a maximum size defined, snapping may make it too big. |
81 return window->delegate() ? window->delegate()->GetMaximumSize().IsEmpty() : | 83 return window->delegate() ? window->delegate()->GetMaximumSize().IsEmpty() : |
82 true; | 84 true; |
83 } | 85 } |
84 | 86 |
85 bool IsWindowNormal(const aura::Window* window) { | 87 bool IsWindowNormal(const aura::Window* window) { |
86 return IsWindowStateNormal(window->GetProperty(aura::client::kShowStateKey)); | 88 return IsWindowStateNormal(window->GetProperty(aura::client::kShowStateKey)); |
87 } | 89 } |
88 | 90 |
89 bool IsWindowStateNormal(ui::WindowShowState state) { | 91 bool IsWindowStateNormal(ui::WindowShowState state) { |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 return false; | 204 return false; |
203 aura::Window* window_container = | 205 aura::Window* window_container = |
204 ash::Shell::GetContainer(target_root, window->parent()->id()); | 206 ash::Shell::GetContainer(target_root, window->parent()->id()); |
205 // Move the window to the target launcher. | 207 // Move the window to the target launcher. |
206 window_container->AddChild(window); | 208 window_container->AddChild(window); |
207 return true; | 209 return true; |
208 } | 210 } |
209 | 211 |
210 } // namespace wm | 212 } // namespace wm |
211 } // namespace ash | 213 } // namespace ash |
OLD | NEW |