| 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_delegate.h" | 26 #include "services/ui/ws/window_server_delegate.h" |
| 27 #include "services/ui/ws/window_tree.h" | 27 #include "services/ui/ws/window_tree.h" |
| 28 #include "services/ui/ws/window_tree_binding.h" | 28 #include "services/ui/ws/window_tree_binding.h" |
| 29 #include "ui/base/cursor/cursor.h" | 29 #include "ui/base/cursor/cursor.h" |
| 30 #include "ui/display/screen.h" | 30 #include "ui/display/screen.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 : window_server_(window_server), last_cursor_(mojom::Cursor::CURSOR_NULL) { | 36 : window_server_(window_server), |
| 37 last_cursor_(mojom::CursorType::CURSOR_NULL) { |
| 37 window_server_->window_manager_window_tree_factory_set()->AddObserver(this); | 38 window_server_->window_manager_window_tree_factory_set()->AddObserver(this); |
| 38 window_server_->user_id_tracker()->AddObserver(this); | 39 window_server_->user_id_tracker()->AddObserver(this); |
| 39 } | 40 } |
| 40 | 41 |
| 41 Display::~Display() { | 42 Display::~Display() { |
| 42 window_server_->user_id_tracker()->RemoveObserver(this); | 43 window_server_->user_id_tracker()->RemoveObserver(this); |
| 43 | 44 |
| 44 window_server_->window_manager_window_tree_factory_set()->RemoveObserver( | 45 window_server_->window_manager_window_tree_factory_set()->RemoveObserver( |
| 45 this); | 46 this); |
| 46 | 47 |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 void Display::OnWillDestroyTree(WindowTree* tree) { | 175 void Display::OnWillDestroyTree(WindowTree* tree) { |
| 175 for (auto it = window_manager_display_root_map_.begin(); | 176 for (auto it = window_manager_display_root_map_.begin(); |
| 176 it != window_manager_display_root_map_.end(); ++it) { | 177 it != window_manager_display_root_map_.end(); ++it) { |
| 177 if (it->second->window_manager_state()->window_tree() == tree) { | 178 if (it->second->window_manager_state()->window_tree() == tree) { |
| 178 window_manager_display_root_map_.erase(it); | 179 window_manager_display_root_map_.erase(it); |
| 179 break; | 180 break; |
| 180 } | 181 } |
| 181 } | 182 } |
| 182 } | 183 } |
| 183 | 184 |
| 184 void Display::UpdateNativeCursor(mojom::Cursor cursor_id) { | 185 void Display::UpdateNativeCursor(mojom::CursorType cursor_id) { |
| 185 if (cursor_id != last_cursor_) { | 186 if (cursor_id != last_cursor_) { |
| 186 platform_display_->SetCursorById(cursor_id); | 187 platform_display_->SetCursorById(cursor_id); |
| 187 last_cursor_ = cursor_id; | 188 last_cursor_ = cursor_id; |
| 188 } | 189 } |
| 189 } | 190 } |
| 190 | 191 |
| 191 void Display::SetSize(const gfx::Size& size) { | 192 void Display::SetSize(const gfx::Size& size) { |
| 192 platform_display_->SetViewportSize(size); | 193 platform_display_->SetViewportSize(size); |
| 193 } | 194 } |
| 194 | 195 |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 | 388 |
| 388 UserActivityMonitor* activity_monitor = | 389 UserActivityMonitor* activity_monitor = |
| 389 window_server_->GetUserActivityMonitorForUser( | 390 window_server_->GetUserActivityMonitorForUser( |
| 390 window_server_->user_id_tracker()->active_id()); | 391 window_server_->user_id_tracker()->active_id()); |
| 391 activity_monitor->OnUserActivity(); | 392 activity_monitor->OnUserActivity(); |
| 392 return EventDispatchDetails(); | 393 return EventDispatchDetails(); |
| 393 } | 394 } |
| 394 | 395 |
| 395 } // namespace ws | 396 } // namespace ws |
| 396 } // namespace ui | 397 } // namespace ui |
| OLD | NEW |