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

Side by Side Diff: components/mus/ws/window_server.cc

Issue 1909733002: mus: Add EventObserver to allow passively listening to UI events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 4 years, 8 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/mus/ws/window_server.h" 5 #include "components/mus/ws/window_server.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "components/mus/ws/display.h" 9 #include "components/mus/ws/display.h"
10 #include "components/mus/ws/display_binding.h" 10 #include "components/mus/ws/display_binding.h"
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 pair.second->ProcessCursorChanged(window, cursor_id, 392 pair.second->ProcessCursorChanged(window, cursor_id,
393 IsOperationSource(pair.first)); 393 IsOperationSource(pair.first));
394 } 394 }
395 395
396 // Pass the cursor change to the native window. 396 // Pass the cursor change to the native window.
397 Display* display = display_manager_->GetDisplayContaining(window); 397 Display* display = display_manager_->GetDisplayContaining(window);
398 if (display) 398 if (display)
399 display->OnCursorUpdated(window); 399 display->OnCursorUpdated(window);
400 } 400 }
401 401
402 void WindowServer::SendToEventObservers(const ui::Event& event,
403 const UserId& user_id,
404 WindowTree* ignore_tree) {
405 for (auto& pair : tree_map_) {
406 WindowTree* tree = pair.second.get();
407 if (tree->user_id() == user_id && tree != ignore_tree)
408 tree->SendToEventObserver(event);
409 }
410 }
411
402 void WindowServer::ProcessViewportMetricsChanged( 412 void WindowServer::ProcessViewportMetricsChanged(
403 Display* display, 413 Display* display,
404 const mojom::ViewportMetrics& old_metrics, 414 const mojom::ViewportMetrics& old_metrics,
405 const mojom::ViewportMetrics& new_metrics) { 415 const mojom::ViewportMetrics& new_metrics) {
406 for (auto& pair : tree_map_) { 416 for (auto& pair : tree_map_) {
407 pair.second->ProcessViewportMetricsChanged( 417 pair.second->ProcessViewportMetricsChanged(
408 display, old_metrics, new_metrics, IsOperationSource(pair.first)); 418 display, old_metrics, new_metrics, IsOperationSource(pair.first));
409 } 419 }
410 } 420 }
411 421
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 void WindowServer::OnFirstDisplayReady() { 656 void WindowServer::OnFirstDisplayReady() {
647 delegate_->OnFirstDisplayReady(); 657 delegate_->OnFirstDisplayReady();
648 } 658 }
649 659
650 void WindowServer::OnNoMoreDisplays() { 660 void WindowServer::OnNoMoreDisplays() {
651 delegate_->OnNoMoreDisplays(); 661 delegate_->OnNoMoreDisplays();
652 } 662 }
653 663
654 } // namespace ws 664 } // namespace ws
655 } // namespace mus 665 } // namespace mus
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698