| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 return false; | 186 return false; |
| 185 aura::Window* window_container = | 187 aura::Window* window_container = |
| 186 ash::Shell::GetContainer(target_root, window->parent()->id()); | 188 ash::Shell::GetContainer(target_root, window->parent()->id()); |
| 187 // Move the window to the target launcher. | 189 // Move the window to the target launcher. |
| 188 window_container->AddChild(window); | 190 window_container->AddChild(window); |
| 189 return true; | 191 return true; |
| 190 } | 192 } |
| 191 | 193 |
| 192 } // namespace wm | 194 } // namespace wm |
| 193 } // namespace ash | 195 } // namespace ash |
| OLD | NEW |