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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 } | 162 } |
163 prop_map_.clear(); | 163 prop_map_.clear(); |
164 | 164 |
165 // The layer will either be destroyed by |layer_owner_|'s dtor, or by whoever | 165 // The layer will either be destroyed by |layer_owner_|'s dtor, or by whoever |
166 // acquired it. | 166 // acquired it. |
167 layer()->set_delegate(NULL); | 167 layer()->set_delegate(NULL); |
168 DestroyLayer(); | 168 DestroyLayer(); |
169 } | 169 } |
170 | 170 |
171 void Window::Init(ui::LayerType layer_type) { | 171 void Window::Init(ui::LayerType layer_type) { |
172 SetLayer(new ui::Layer(layer_type)); | 172 SetLayer(base::MakeUnique<ui::Layer>(layer_type)); |
173 layer()->SetVisible(false); | 173 layer()->SetVisible(false); |
174 layer()->set_delegate(this); | 174 layer()->set_delegate(this); |
175 UpdateLayerName(); | 175 UpdateLayerName(); |
176 layer()->SetFillsBoundsOpaquely(!transparent_); | 176 layer()->SetFillsBoundsOpaquely(!transparent_); |
177 Env::GetInstance()->NotifyWindowInitialized(this); | 177 Env::GetInstance()->NotifyWindowInitialized(this); |
178 } | 178 } |
179 | 179 |
180 void Window::SetType(ui::wm::WindowType type) { | 180 void Window::SetType(ui::wm::WindowType type) { |
181 // Cannot change type after the window is initialized. | 181 // Cannot change type after the window is initialized. |
182 DCHECK(!layer()); | 182 DCHECK(!layer()); |
(...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1103 layer_name = "Unnamed Window"; | 1103 layer_name = "Unnamed Window"; |
1104 | 1104 |
1105 if (id_ != -1) | 1105 if (id_ != -1) |
1106 layer_name += " " + base::IntToString(id_); | 1106 layer_name += " " + base::IntToString(id_); |
1107 | 1107 |
1108 layer()->set_name(layer_name); | 1108 layer()->set_name(layer_name); |
1109 #endif | 1109 #endif |
1110 } | 1110 } |
1111 | 1111 |
1112 } // namespace aura | 1112 } // namespace aura |
OLD | NEW |