| 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/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 return false; | 72 return false; |
| 73 aura::client::ActivationClient* client = | 73 aura::client::ActivationClient* client = |
| 74 aura::client::GetActivationClient(window->GetRootWindow()); | 74 aura::client::GetActivationClient(window->GetRootWindow()); |
| 75 return client && client->CanActivateWindow(window); | 75 return client && client->CanActivateWindow(window); |
| 76 } | 76 } |
| 77 | 77 |
| 78 bool CanMaximizeWindow(const aura::Window* window) { | 78 bool CanMaximizeWindow(const aura::Window* window) { |
| 79 return window->GetProperty(aura::client::kCanMaximizeKey); | 79 return window->GetProperty(aura::client::kCanMaximizeKey); |
| 80 } | 80 } |
| 81 | 81 |
| 82 bool CanResizeWindow(const aura::Window* window) { |
| 83 return window->GetProperty(aura::client::kCanResizeKey); |
| 84 } |
| 85 |
| 82 bool IsWindowNormal(const aura::Window* window) { | 86 bool IsWindowNormal(const aura::Window* window) { |
| 83 return IsWindowStateNormal(window->GetProperty(aura::client::kShowStateKey)); | 87 return IsWindowStateNormal(window->GetProperty(aura::client::kShowStateKey)); |
| 84 } | 88 } |
| 85 | 89 |
| 86 bool IsWindowStateNormal(ui::WindowShowState state) { | 90 bool IsWindowStateNormal(ui::WindowShowState state) { |
| 87 return state == ui::SHOW_STATE_NORMAL || state == ui::SHOW_STATE_DEFAULT; | 91 return state == ui::SHOW_STATE_NORMAL || state == ui::SHOW_STATE_DEFAULT; |
| 88 } | 92 } |
| 89 | 93 |
| 90 bool IsWindowMaximized(const aura::Window* window) { | 94 bool IsWindowMaximized(const aura::Window* window) { |
| 91 return window->GetProperty(aura::client::kShowStateKey) == | 95 return window->GetProperty(aura::client::kShowStateKey) == |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 x_offset = work_area.right() - bounds->x() - kMinimumOnScreenArea; | 204 x_offset = work_area.right() - bounds->x() - kMinimumOnScreenArea; |
| 201 } else if (bounds->right() < work_area.x()) { | 205 } else if (bounds->right() < work_area.x()) { |
| 202 x_offset = work_area.x() - bounds->right() + kMinimumOnScreenArea; | 206 x_offset = work_area.x() - bounds->right() + kMinimumOnScreenArea; |
| 203 } | 207 } |
| 204 bounds->Offset(x_offset, y_offset); | 208 bounds->Offset(x_offset, y_offset); |
| 205 } | 209 } |
| 206 } | 210 } |
| 207 | 211 |
| 208 } // namespace wm | 212 } // namespace wm |
| 209 } // namespace ash | 213 } // namespace ash |
| OLD | NEW |