| 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/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/wm/activation_controller.h" | 10 #include "ash/wm/activation_controller.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 | 55 |
| 56 bool CanActivateWindow(aura::Window* window) { | 56 bool CanActivateWindow(aura::Window* window) { |
| 57 DCHECK(window); | 57 DCHECK(window); |
| 58 if (!window->GetRootWindow()) | 58 if (!window->GetRootWindow()) |
| 59 return false; | 59 return false; |
| 60 aura::client::ActivationClient* client = | 60 aura::client::ActivationClient* client = |
| 61 aura::client::GetActivationClient(window->GetRootWindow()); | 61 aura::client::GetActivationClient(window->GetRootWindow()); |
| 62 return client && client->CanActivateWindow(window); | 62 return client && client->CanActivateWindow(window); |
| 63 } | 63 } |
| 64 | 64 |
| 65 bool IsWindowNormal(aura::Window* window) { | 65 bool IsWindowNormal(const aura::Window* window) { |
| 66 return window->GetProperty(aura::client::kShowStateKey) == | 66 return window->GetProperty(aura::client::kShowStateKey) == |
| 67 ui::SHOW_STATE_NORMAL || | 67 ui::SHOW_STATE_NORMAL || |
| 68 window->GetProperty(aura::client::kShowStateKey) == | 68 window->GetProperty(aura::client::kShowStateKey) == |
| 69 ui::SHOW_STATE_DEFAULT; | 69 ui::SHOW_STATE_DEFAULT; |
| 70 } | 70 } |
| 71 | 71 |
| 72 bool IsWindowMaximized(aura::Window* window) { | 72 bool IsWindowMaximized(const aura::Window* window) { |
| 73 return window->GetProperty(aura::client::kShowStateKey) == | 73 return window->GetProperty(aura::client::kShowStateKey) == |
| 74 ui::SHOW_STATE_MAXIMIZED; | 74 ui::SHOW_STATE_MAXIMIZED; |
| 75 } | 75 } |
| 76 | 76 |
| 77 bool IsWindowMinimized(aura::Window* window) { | 77 bool IsWindowMinimized(const aura::Window* window) { |
| 78 return window->GetProperty(aura::client::kShowStateKey) == | 78 return window->GetProperty(aura::client::kShowStateKey) == |
| 79 ui::SHOW_STATE_MINIMIZED; | 79 ui::SHOW_STATE_MINIMIZED; |
| 80 } | 80 } |
| 81 | 81 |
| 82 bool IsWindowFullscreen(aura::Window* window) { | 82 bool IsWindowFullscreen(const aura::Window* window) { |
| 83 return window->GetProperty(aura::client::kShowStateKey) == | 83 return window->GetProperty(aura::client::kShowStateKey) == |
| 84 ui::SHOW_STATE_FULLSCREEN; | 84 ui::SHOW_STATE_FULLSCREEN; |
| 85 } | 85 } |
| 86 | 86 |
| 87 void MaximizeWindow(aura::Window* window) { | 87 void MaximizeWindow(aura::Window* window) { |
| 88 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); | 88 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); |
| 89 } | 89 } |
| 90 | 90 |
| 91 void MinimizeWindow(aura::Window* window) { | 91 void MinimizeWindow(aura::Window* window) { |
| 92 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED); | 92 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 it != children.end(); | 127 it != children.end(); |
| 128 ++it) { | 128 ++it) { |
| 129 ui::Layer* child = *it; | 129 ui::Layer* child = *it; |
| 130 DeepDeleteLayers(child); | 130 DeepDeleteLayers(child); |
| 131 } | 131 } |
| 132 delete layer; | 132 delete layer; |
| 133 } | 133 } |
| 134 | 134 |
| 135 } // namespace wm | 135 } // namespace wm |
| 136 } // namespace ash | 136 } // namespace ash |
| OLD | NEW |