OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_state.h" | 5 #include "ash/wm/window_state.h" |
6 | 6 |
7 #include "ash/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
8 #include "ash/screen_ash.h" | 8 #include "ash/screen_ash.h" |
9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
10 #include "ash/wm/window_properties.h" | 10 #include "ash/wm/window_properties.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 bool WindowState::IsNormalShowState() const { | 69 bool WindowState::IsNormalShowState() const { |
70 ui::WindowShowState state = window_->GetProperty(aura::client::kShowStateKey); | 70 ui::WindowShowState state = window_->GetProperty(aura::client::kShowStateKey); |
71 return state == ui::SHOW_STATE_NORMAL || state == ui::SHOW_STATE_DEFAULT; | 71 return state == ui::SHOW_STATE_NORMAL || state == ui::SHOW_STATE_DEFAULT; |
72 } | 72 } |
73 | 73 |
74 bool WindowState::IsActive() const { | 74 bool WindowState::IsActive() const { |
75 return IsActiveWindow(window_); | 75 return IsActiveWindow(window_); |
76 } | 76 } |
77 | 77 |
| 78 bool WindowState::IsDocked() const { |
| 79 return window_->parent() && |
| 80 window_->parent()->id() == internal::kShellWindowId_DockedContainer; |
| 81 } |
| 82 |
78 bool WindowState::CanMaximize() const { | 83 bool WindowState::CanMaximize() const { |
79 return window_->GetProperty(aura::client::kCanMaximizeKey); | 84 return window_->GetProperty(aura::client::kCanMaximizeKey); |
80 } | 85 } |
81 | 86 |
82 bool WindowState::CanMinimize() const { | 87 bool WindowState::CanMinimize() const { |
83 internal::RootWindowController* controller = | 88 internal::RootWindowController* controller = |
84 internal::RootWindowController::ForWindow(window_); | 89 internal::RootWindowController::ForWindow(window_); |
85 if (!controller) | 90 if (!controller) |
86 return false; | 91 return false; |
87 aura::Window* lockscreen = controller->GetContainer( | 92 aura::Window* lockscreen = controller->GetContainer( |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 } | 276 } |
272 return settings; | 277 return settings; |
273 } | 278 } |
274 | 279 |
275 const WindowState* GetWindowState(const aura::Window* window) { | 280 const WindowState* GetWindowState(const aura::Window* window) { |
276 return GetWindowState(const_cast<aura::Window*>(window)); | 281 return GetWindowState(const_cast<aura::Window*>(window)); |
277 } | 282 } |
278 | 283 |
279 } // namespace wm | 284 } // namespace wm |
280 } // namespace ash | 285 } // namespace ash |
OLD | NEW |