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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 void Window::SetTransform(const gfx::Transform& transform) { | 269 void Window::SetTransform(const gfx::Transform& transform) { |
270 FOR_EACH_OBSERVER(WindowObserver, observers_, | 270 FOR_EACH_OBSERVER(WindowObserver, observers_, |
271 OnWindowTransforming(this)); | 271 OnWindowTransforming(this)); |
272 layer()->SetTransform(transform); | 272 layer()->SetTransform(transform); |
273 FOR_EACH_OBSERVER(WindowObserver, observers_, | 273 FOR_EACH_OBSERVER(WindowObserver, observers_, |
274 OnWindowTransformed(this)); | 274 OnWindowTransformed(this)); |
275 NotifyAncestorWindowTransformed(this); | 275 NotifyAncestorWindowTransformed(this); |
276 } | 276 } |
277 | 277 |
278 void Window::SetLayoutManager(LayoutManager* layout_manager) { | 278 void Window::SetLayoutManager(LayoutManager* layout_manager) { |
279 if (layout_manager == layout_manager_) | 279 if (layout_manager == layout_manager_.get()) |
280 return; | 280 return; |
281 layout_manager_.reset(layout_manager); | 281 layout_manager_.reset(layout_manager); |
282 if (!layout_manager) | 282 if (!layout_manager) |
283 return; | 283 return; |
284 // If we're changing to a new layout manager, ensure it is aware of all the | 284 // If we're changing to a new layout manager, ensure it is aware of all the |
285 // existing child windows. | 285 // existing child windows. |
286 for (Windows::const_iterator it = children_.begin(); | 286 for (Windows::const_iterator it = children_.begin(); |
287 it != children_.end(); | 287 it != children_.end(); |
288 ++it) | 288 ++it) |
289 layout_manager_->OnWindowAddedToLayout(*it); | 289 layout_manager_->OnWindowAddedToLayout(*it); |
(...skipping 818 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 |