Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 15 matching lines...) Expand all Loading... | |
| 26 #include "services/ui/ws/window_server.h" | 26 #include "services/ui/ws/window_server.h" |
| 27 #include "services/ui/ws/window_server_delegate.h" | 27 #include "services/ui/ws/window_server_delegate.h" |
| 28 #include "services/ui/ws/window_tree.h" | 28 #include "services/ui/ws/window_tree.h" |
| 29 #include "services/ui/ws/window_tree_binding.h" | 29 #include "services/ui/ws/window_tree_binding.h" |
| 30 #include "ui/base/cursor/cursor.h" | 30 #include "ui/base/cursor/cursor.h" |
| 31 | 31 |
| 32 namespace ui { | 32 namespace ui { |
| 33 namespace ws { | 33 namespace ws { |
| 34 | 34 |
| 35 Display::Display(WindowServer* window_server, | 35 Display::Display(WindowServer* window_server, |
| 36 const PlatformDisplayInitParams& platform_display_init_params) | 36 PlatformDisplayInitParams init_params) |
|
Fady Samuel
2016/10/24 21:53:22
This is more or less the same in terms of cost, bu
kylechar
2016/10/25 18:15:01
Done.
| |
| 37 : window_server_(window_server), | 37 : window_server_(window_server), last_cursor_(mojom::Cursor::CURSOR_NULL) { |
| 38 platform_display_(PlatformDisplay::Create(platform_display_init_params)), | 38 // Create the root ServerWindow and pass the window id along. |
| 39 last_cursor_(mojom::Cursor::CURSOR_NULL) { | 39 CreateRootWindow(init_params.metrics.bounds.size()); |
| 40 init_params.root_window_id = root_->id(); | |
| 41 | |
| 42 platform_display_.reset(PlatformDisplay::Create(init_params)); | |
| 40 platform_display_->Init(this); | 43 platform_display_->Init(this); |
| 41 | 44 |
| 42 window_server_->window_manager_window_tree_factory_set()->AddObserver(this); | 45 window_server_->window_manager_window_tree_factory_set()->AddObserver(this); |
| 43 window_server_->user_id_tracker()->AddObserver(this); | 46 window_server_->user_id_tracker()->AddObserver(this); |
| 44 } | 47 } |
| 45 | 48 |
| 46 Display::~Display() { | 49 Display::~Display() { |
| 47 window_server_->user_id_tracker()->RemoveObserver(this); | 50 window_server_->user_id_tracker()->RemoveObserver(this); |
| 48 | 51 |
| 49 window_server_->window_manager_window_tree_factory_set()->RemoveObserver( | 52 window_server_->window_manager_window_tree_factory_set()->RemoveObserver( |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 396 } | 399 } |
| 397 | 400 |
| 398 void Display::OnWindowManagerWindowTreeFactoryReady( | 401 void Display::OnWindowManagerWindowTreeFactoryReady( |
| 399 WindowManagerWindowTreeFactory* factory) { | 402 WindowManagerWindowTreeFactory* factory) { |
| 400 if (!binding_) | 403 if (!binding_) |
| 401 CreateWindowManagerDisplayRootFromFactory(factory); | 404 CreateWindowManagerDisplayRootFromFactory(factory); |
| 402 } | 405 } |
| 403 | 406 |
| 404 } // namespace ws | 407 } // namespace ws |
| 405 } // namespace ui | 408 } // namespace ui |
| OLD | NEW |