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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 return true; | 71 return true; |
72 } | 72 } |
73 | 73 |
74 bool CanResizeWindow(const aura::Window* window) { | 74 bool CanResizeWindow(const aura::Window* window) { |
75 return window->GetProperty(aura::client::kCanResizeKey); | 75 return window->GetProperty(aura::client::kCanResizeKey); |
76 } | 76 } |
77 | 77 |
78 bool CanSnapWindow(aura::Window* window) { | 78 bool CanSnapWindow(aura::Window* window) { |
79 if (!CanResizeWindow(window)) | 79 if (!CanResizeWindow(window)) |
80 return false; | 80 return false; |
| 81 if (window->type() == aura::client::WINDOW_TYPE_PANEL) |
| 82 return false; |
81 // If a window has a maximum size defined, snapping may make it too big. | 83 // If a window has a maximum size defined, snapping may make it too big. |
82 return window->delegate() ? window->delegate()->GetMaximumSize().IsEmpty() : | 84 return window->delegate() ? window->delegate()->GetMaximumSize().IsEmpty() : |
83 true; | 85 true; |
84 } | 86 } |
85 | 87 |
86 bool IsWindowNormal(const aura::Window* window) { | 88 bool IsWindowNormal(const aura::Window* window) { |
87 return IsWindowStateNormal(window->GetProperty(aura::client::kShowStateKey)); | 89 return IsWindowStateNormal(window->GetProperty(aura::client::kShowStateKey)); |
88 } | 90 } |
89 | 91 |
90 bool IsWindowStateNormal(ui::WindowShowState state) { | 92 bool IsWindowStateNormal(ui::WindowShowState state) { |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 return false; | 201 return false; |
200 aura::Window* window_container = | 202 aura::Window* window_container = |
201 ash::Shell::GetContainer(target_root, window->parent()->id()); | 203 ash::Shell::GetContainer(target_root, window->parent()->id()); |
202 // Move the window to the target launcher. | 204 // Move the window to the target launcher. |
203 window_container->AddChild(window); | 205 window_container->AddChild(window); |
204 return true; | 206 return true; |
205 } | 207 } |
206 | 208 |
207 } // namespace wm | 209 } // namespace wm |
208 } // namespace ash | 210 } // namespace ash |
OLD | NEW |