| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 } | 164 } |
| 165 prop_map_.clear(); | 165 prop_map_.clear(); |
| 166 | 166 |
| 167 // The layer will either be destroyed by |layer_owner_|'s dtor, or by whoever | 167 // The layer will either be destroyed by |layer_owner_|'s dtor, or by whoever |
| 168 // acquired it. | 168 // acquired it. |
| 169 layer()->set_delegate(NULL); | 169 layer()->set_delegate(NULL); |
| 170 DestroyLayer(); | 170 DestroyLayer(); |
| 171 } | 171 } |
| 172 | 172 |
| 173 void Window::Init(ui::LayerType layer_type) { | 173 void Window::Init(ui::LayerType layer_type) { |
| 174 SetLayer(new ui::Layer(layer_type)); | 174 SetLayer(base::MakeUnique<ui::Layer>(layer_type)); |
| 175 layer()->SetVisible(false); | 175 layer()->SetVisible(false); |
| 176 layer()->set_delegate(this); | 176 layer()->set_delegate(this); |
| 177 UpdateLayerName(); | 177 UpdateLayerName(); |
| 178 layer()->SetFillsBoundsOpaquely(!transparent_); | 178 layer()->SetFillsBoundsOpaquely(!transparent_); |
| 179 Env::GetInstance()->NotifyWindowInitialized(this); | 179 Env::GetInstance()->NotifyWindowInitialized(this); |
| 180 } | 180 } |
| 181 | 181 |
| 182 void Window::SetType(ui::wm::WindowType type) { | 182 void Window::SetType(ui::wm::WindowType type) { |
| 183 // Cannot change type after the window is initialized. | 183 // Cannot change type after the window is initialized. |
| 184 DCHECK(!layer()); | 184 DCHECK(!layer()); |
| (...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1118 layer_name = "Unnamed Window"; | 1118 layer_name = "Unnamed Window"; |
| 1119 | 1119 |
| 1120 if (id_ != -1) | 1120 if (id_ != -1) |
| 1121 layer_name += " " + base::IntToString(id_); | 1121 layer_name += " " + base::IntToString(id_); |
| 1122 | 1122 |
| 1123 layer()->set_name(layer_name); | 1123 layer()->set_name(layer_name); |
| 1124 #endif | 1124 #endif |
| 1125 } | 1125 } |
| 1126 | 1126 |
| 1127 } // namespace aura | 1127 } // namespace aura |
| OLD | NEW |