Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Side by Side Diff: ui/aura/window.cc

Issue 2582823002: WIP: Surface Synchronization System
Patch Set: Only create ClientSurfaceEmbedder if window is visible. Trash it otherwise. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 layer()->set_delegate(NULL); 137 layer()->set_delegate(NULL);
138 DestroyLayer(); 138 DestroyLayer();
139 } 139 }
140 140
141 void Window::Init(ui::LayerType layer_type) { 141 void Window::Init(ui::LayerType layer_type) {
142 if (!port_owner_) { 142 if (!port_owner_) {
143 port_owner_ = Env::GetInstance()->CreateWindowPort(this); 143 port_owner_ = Env::GetInstance()->CreateWindowPort(this);
144 port_ = port_owner_.get(); 144 port_ = port_owner_.get();
145 } 145 }
146 SetLayer(base::MakeUnique<ui::Layer>(layer_type)); 146 SetLayer(base::MakeUnique<ui::Layer>(layer_type));
147 port_->OnPreInit(this); 147 port_->OnPreInit(this, layer_type);
148 layer()->SetVisible(false); 148 layer()->SetVisible(false);
149 layer()->set_delegate(this); 149 layer()->set_delegate(this);
150 UpdateLayerName(); 150 UpdateLayerName();
151 layer()->SetFillsBoundsOpaquely(!transparent_); 151 layer()->SetFillsBoundsOpaquely(!transparent_);
152 Env::GetInstance()->NotifyWindowInitialized(this); 152 Env::GetInstance()->NotifyWindowInitialized(this);
153 } 153 }
154 154
155 void Window::SetType(ui::wm::WindowType type) { 155 void Window::SetType(ui::wm::WindowType type) {
156 // Cannot change type after the window is initialized. 156 // Cannot change type after the window is initialized.
157 DCHECK(!layer()); 157 DCHECK(!layer());
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698