Chromium Code Reviews| Index: services/ui/ws/display_manager.cc |
| diff --git a/services/ui/ws/display_manager.cc b/services/ui/ws/display_manager.cc |
| index 2cbaa8ebadeae044443241addcdebbd60547d170..8dd9a16e2a4b8149ae61d004a436423dd4a466fd 100644 |
| --- a/services/ui/ws/display_manager.cc |
| +++ b/services/ui/ws/display_manager.cc |
| @@ -8,11 +8,11 @@ |
| #include "base/memory/ptr_util.h" |
| #include "base/trace_event/trace_event.h" |
| +#include "services/ui/display/viewport_metrics.h" |
| #include "services/ui/ws/cursor_location_manager.h" |
| #include "services/ui/ws/display.h" |
| #include "services/ui/ws/display_binding.h" |
| #include "services/ui/ws/event_dispatcher.h" |
| -#include "services/ui/ws/platform_display_init_params.h" |
| #include "services/ui/ws/server_window.h" |
| #include "services/ui/ws/user_display_manager.h" |
| #include "services/ui/ws/user_display_manager_delegate.h" |
| @@ -98,9 +98,9 @@ std::set<const Display*> DisplayManager::displays() const { |
| return ret_value; |
| } |
| -void DisplayManager::OnDisplayUpdate(Display* display) { |
| +void DisplayManager::OnDisplayUpdate(const display::Display& display) { |
| for (const auto& pair : user_display_managers_) |
| - pair.second->OnDisplayUpdate(display->ToDisplay()); |
| + pair.second->OnDisplayUpdate(display); |
| } |
| Display* DisplayManager::GetDisplayContaining(const ServerWindow* window) { |
| @@ -181,34 +181,33 @@ void DisplayManager::OnActiveUserIdChanged(const UserId& previously_active_id, |
| current_window_manager_state->Activate(mouse_location_on_screen); |
| } |
| -void DisplayManager::OnDisplayAdded(int64_t id, |
| +void DisplayManager::OnDisplayAdded(const display::Display& display, |
| const display::ViewportMetrics& metrics) { |
| - TRACE_EVENT1("mus-ws", "OnDisplayAdded", "id", id); |
| - PlatformDisplayInitParams params; |
| - params.display_id = id; |
| - params.metrics = metrics; |
| + VLOG(1) << "OnDisplayAdded: " << display.ToString(); |
|
sky
2017/03/13 18:29:06
We've been using level 3 for informational message
kylechar
2017/03/13 19:28:02
Done.
|
| - ws::Display* display = new ws::Display(window_server_); |
| - display->Init(params, nullptr); |
| + ws::Display* ws_display = new ws::Display(window_server_); |
| + ws_display->SetDisplay(display); |
| + ws_display->Init(metrics, nullptr); |
| } |
| -void DisplayManager::OnDisplayRemoved(int64_t id) { |
| - TRACE_EVENT1("mus-ws", "OnDisplayRemoved", "id", id); |
| - Display* display = GetDisplayById(id); |
| +void DisplayManager::OnDisplayRemoved(int64_t display_id) { |
| + VLOG(1) << "OnDisplayRemoved: " << display_id; |
| + Display* display = GetDisplayById(display_id); |
| if (display) |
| DestroyDisplay(display); |
| } |
| void DisplayManager::OnDisplayModified( |
| - int64_t id, |
| + const display::Display& display, |
| const display::ViewportMetrics& metrics) { |
| - TRACE_EVENT1("mus-ws", "OnDisplayModified", "id", id); |
| + VLOG(1) << "OnDisplayModified: " << display.ToString(); |
| - Display* display = GetDisplayById(id); |
| - DCHECK(display); |
| + Display* ws_display = GetDisplayById(display.id()); |
| + DCHECK(ws_display); |
| + ws_display->SetDisplay(display); |
| // Update the platform display and check if anything has actually changed. |
| - if (!display->platform_display()->UpdateViewportMetrics(metrics)) |
| + if (!ws_display->platform_display()->UpdateViewportMetrics(metrics)) |
| return; |
| // Send IPCs to WM clients first with new display information. |
| @@ -216,15 +215,16 @@ void DisplayManager::OnDisplayModified( |
| window_server_->window_manager_window_tree_factory_set()->GetFactories(); |
| for (WindowManagerWindowTreeFactory* factory : factories) { |
| if (factory->window_tree()) |
| - factory->window_tree()->OnWmDisplayModified(display->ToDisplay()); |
| + factory->window_tree()->OnWmDisplayModified(display); |
| } |
| // Change the root ServerWindow size after sending IPC to WM. |
| - display->OnViewportMetricsChanged(metrics); |
| + ws_display->OnViewportMetricsChanged(metrics); |
| OnDisplayUpdate(display); |
| } |
| void DisplayManager::OnPrimaryDisplayChanged(int64_t primary_display_id) { |
| + VLOG(1) << "OnPrimaryDisplayChanged: " << primary_display_id; |
| // TODO(kylechar): Send IPCs to WM clients first. |
| // Send IPCs to any DisplayManagerObservers. |