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 "ui/aura/window.h" | 5 #include "ui/aura/window.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 const WindowTreeHost* Window::GetHost() const { | 216 const WindowTreeHost* Window::GetHost() const { |
217 const Window* root_window = GetRootWindow(); | 217 const Window* root_window = GetRootWindow(); |
218 return root_window ? root_window->host_ : NULL; | 218 return root_window ? root_window->host_ : NULL; |
219 } | 219 } |
220 | 220 |
221 void Window::Show() { | 221 void Window::Show() { |
222 DCHECK_EQ(visible_, layer()->GetTargetVisibility()); | 222 DCHECK_EQ(visible_, layer()->GetTargetVisibility()); |
223 // It is not allowed that a window is visible but the layers alpha is fully | 223 // It is not allowed that a window is visible but the layers alpha is fully |
224 // transparent since the window would still be considered to be active but | 224 // transparent since the window would still be considered to be active but |
225 // could not be seen. | 225 // could not be seen. |
226 DCHECK_IMPLIES(visible_, layer()->GetTargetOpacity() > 0.0f); | 226 DCHECK(!visible_ || layer()->GetTargetOpacity() > 0.0f); |
227 SetVisible(true); | 227 SetVisible(true); |
228 } | 228 } |
229 | 229 |
230 void Window::Hide() { | 230 void Window::Hide() { |
231 // RootWindow::OnVisibilityChanged will call ReleaseCapture. | 231 // RootWindow::OnVisibilityChanged will call ReleaseCapture. |
232 SetVisible(false); | 232 SetVisible(false); |
233 } | 233 } |
234 | 234 |
235 bool Window::IsVisible() const { | 235 bool Window::IsVisible() const { |
236 // Layer visibility can be inconsistent with window visibility, for example | 236 // Layer visibility can be inconsistent with window visibility, for example |
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1108 layer_name = "Unnamed Window"; | 1108 layer_name = "Unnamed Window"; |
1109 | 1109 |
1110 if (id_ != -1) | 1110 if (id_ != -1) |
1111 layer_name += " " + base::IntToString(id_); | 1111 layer_name += " " + base::IntToString(id_); |
1112 | 1112 |
1113 layer()->set_name(layer_name); | 1113 layer()->set_name(layer_name); |
1114 #endif | 1114 #endif |
1115 } | 1115 } |
1116 | 1116 |
1117 } // namespace aura | 1117 } // namespace aura |
OLD | NEW |