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

Side by Side Diff: services/ui/ws/display.cc

Issue 2712203002: c++ / mojo changes for 'external window mode'
Patch Set: . Created 3 years, 9 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "services/ui/ws/display.h" 5 #include "services/ui/ws/display.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 } 197 }
198 198
199 void Display::SetSize(const gfx::Size& size) { 199 void Display::SetSize(const gfx::Size& size) {
200 platform_display_->SetViewportSize(size); 200 platform_display_->SetViewportSize(size);
201 } 201 }
202 202
203 void Display::SetTitle(const std::string& title) { 203 void Display::SetTitle(const std::string& title) {
204 platform_display_->SetTitle(base::UTF8ToUTF16(title)); 204 platform_display_->SetTitle(base::UTF8ToUTF16(title));
205 } 205 }
206 206
207 void Display::InitWindowManagerDisplayRoots() { 207 void Display::InitWindowManagerDisplayRoots() {
kylechar 2017/02/28 21:17:16 In general you probably don't want to ever hit any
208 if (binding_) { 208 if (binding_) {
209 std::unique_ptr<WindowManagerDisplayRoot> display_root_ptr( 209 std::unique_ptr<WindowManagerDisplayRoot> display_root_ptr(
210 new WindowManagerDisplayRoot(this)); 210 new WindowManagerDisplayRoot(this));
211 WindowManagerDisplayRoot* display_root = display_root_ptr.get(); 211 WindowManagerDisplayRoot* display_root = display_root_ptr.get();
212 // For this case we never create additional displays roots, so any 212 // For this case we never create additional displays roots, so any
213 // id works. 213 // id works.
214 window_manager_display_root_map_[service_manager::mojom::kRootUserID] = 214 window_manager_display_root_map_[service_manager::mojom::kRootUserID] =
215 display_root_ptr.get(); 215 display_root_ptr.get();
216 WindowTree* window_tree = binding_->CreateWindowTree(display_root->root()); 216
217 DCHECK(window_server_->window_tree_host_factory());
218 WindowTree* window_tree =
219 window_server_->window_tree_host_factory()->window_tree();
220 window_tree->AddRoot(display_root->root());
221 window_tree->DoOnEmbed(nullptr /*mojom::WindowTreePtr*/,
fwang 2017/02/28 08:23:53 Is commenting nullptr parameter something common i
222 display_root->root());
223
224 window_tree->ConfigureWindowManager();
217 display_root->window_manager_state_ = window_tree->window_manager_state(); 225 display_root->window_manager_state_ = window_tree->window_manager_state();
218 window_tree->window_manager_state()->AddWindowManagerDisplayRoot( 226 window_tree->window_manager_state()->AddWindowManagerDisplayRoot(
219 std::move(display_root_ptr)); 227 std::move(display_root_ptr));
220 } else { 228 } else {
221 CreateWindowManagerDisplayRootsFromFactories(); 229 CreateWindowManagerDisplayRootsFromFactories();
222 } 230 }
223 display_manager()->OnDisplayUpdate(this); 231 display_manager()->OnDisplayUpdate(this);
224 } 232 }
225 233
226 void Display::CreateWindowManagerDisplayRootsFromFactories() { 234 void Display::CreateWindowManagerDisplayRootsFromFactories() {
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 } 401 }
394 402
395 void Display::OnWindowManagerWindowTreeFactoryReady( 403 void Display::OnWindowManagerWindowTreeFactoryReady(
396 WindowManagerWindowTreeFactory* factory) { 404 WindowManagerWindowTreeFactory* factory) {
397 if (!binding_) 405 if (!binding_)
398 CreateWindowManagerDisplayRootFromFactory(factory); 406 CreateWindowManagerDisplayRootFromFactory(factory);
399 } 407 }
400 408
401 } // namespace ws 409 } // namespace ws
402 } // namespace ui 410 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698