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

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

Issue 2383263002: Generalize layer mirroring for phantom windows (Closed)
Patch Set: Rebase Created 4 years, 1 month 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
« no previous file with comments | « ui/arc/notification/arc_custom_notification_view.cc ('k') | ui/compositor/layer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 // acquired it. 136 // acquired it.
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(new ui::Layer(layer_type)); 146 SetLayer(base::MakeUnique<ui::Layer>(layer_type));
147 std::unique_ptr<WindowPortInitData> init_data = port_->OnPreInit(this); 147 std::unique_ptr<WindowPortInitData> init_data = port_->OnPreInit(this);
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 port_->OnPostInit(std::move(init_data)); 153 port_->OnPostInit(std::move(init_data));
154 } 154 }
155 155
156 void Window::SetType(ui::wm::WindowType type) { 156 void Window::SetType(ui::wm::WindowType type) {
(...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after
1104 layer_name = "Unnamed Window"; 1104 layer_name = "Unnamed Window";
1105 1105
1106 if (id_ != -1) 1106 if (id_ != -1)
1107 layer_name += " " + base::IntToString(id_); 1107 layer_name += " " + base::IntToString(id_);
1108 1108
1109 layer()->set_name(layer_name); 1109 layer()->set_name(layer_name);
1110 #endif 1110 #endif
1111 } 1111 }
1112 1112
1113 } // namespace aura 1113 } // namespace aura
OLDNEW
« no previous file with comments | « ui/arc/notification/arc_custom_notification_view.cc ('k') | ui/compositor/layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698