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/logging.h" | 9 #include "base/logging.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 | 176 |
177 const RootWindow* Window::GetRootWindow() const { | 177 const RootWindow* Window::GetRootWindow() const { |
178 return parent_ ? parent_->GetRootWindow() : NULL; | 178 return parent_ ? parent_->GetRootWindow() : NULL; |
179 } | 179 } |
180 | 180 |
181 void Window::Show() { | 181 void Window::Show() { |
182 SetVisible(true); | 182 SetVisible(true); |
183 } | 183 } |
184 | 184 |
185 void Window::Hide() { | 185 void Window::Hide() { |
| 186 for (Windows::iterator it = transient_children_.begin(); |
| 187 it != transient_children_.end(); ++it) { |
| 188 (*it)->Hide(); |
| 189 } |
186 SetVisible(false); | 190 SetVisible(false); |
187 ReleaseCapture(); | 191 ReleaseCapture(); |
188 } | 192 } |
189 | 193 |
190 bool Window::IsVisible() const { | 194 bool Window::IsVisible() const { |
191 // Layer visibility can be inconsistent with window visibility, for example | 195 // Layer visibility can be inconsistent with window visibility, for example |
192 // when a Window is hidden, we want this function to return false immediately | 196 // when a Window is hidden, we want this function to return false immediately |
193 // after, even though the client may decide to animate the hide effect (and | 197 // after, even though the client may decide to animate the hide effect (and |
194 // so the layer will be visible for some time after Hide() is called). | 198 // so the layer will be visible for some time after Hide() is called). |
195 return visible_ && layer_ && layer_->IsDrawn(); | 199 return visible_ && layer_ && layer_->IsDrawn(); |
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
802 if (id_ != -1) { | 806 if (id_ != -1) { |
803 char id_buf[10]; | 807 char id_buf[10]; |
804 base::snprintf(id_buf, sizeof(id_buf), " %d", id_); | 808 base::snprintf(id_buf, sizeof(id_buf), " %d", id_); |
805 layer_name.append(id_buf); | 809 layer_name.append(id_buf); |
806 } | 810 } |
807 layer()->set_name(layer_name); | 811 layer()->set_name(layer_name); |
808 #endif | 812 #endif |
809 } | 813 } |
810 | 814 |
811 } // namespace aura | 815 } // namespace aura |
OLD | NEW |