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

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: rebase 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/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "components/mus/ws/display.h" 10 #include "components/mus/ws/display.h"
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 pair.second->ProcessCursorChanged(window, cursor_id, 404 pair.second->ProcessCursorChanged(window, cursor_id,
405 IsOperationSource(pair.first)); 405 IsOperationSource(pair.first));
406 } 406 }
407 407
408 // Pass the cursor change to the native window. 408 // Pass the cursor change to the native window.
409 Display* display = display_manager_->GetDisplayContaining(window); 409 Display* display = display_manager_->GetDisplayContaining(window);
410 if (display) 410 if (display)
411 display->OnCursorUpdated(window); 411 display->OnCursorUpdated(window);
412 } 412 }
413 413
414 void WindowServer::SendToEventObservers(const ui::Event& event,
415 const UserId& user_id,
416 WindowTree* ignore_tree) {
417 for (auto& pair : tree_map_) {
418 WindowTree* tree = pair.second.get();
419 if (tree->user_id() == user_id && tree != ignore_tree)
420 tree->SendToEventObserver(event);
421 }
422 }
423
414 void WindowServer::SetPaintCallback( 424 void WindowServer::SetPaintCallback(
415 const base::Callback<void(ServerWindow*)>& callback) { 425 const base::Callback<void(ServerWindow*)>& callback) {
416 DCHECK(delegate_->IsTestConfig()) << "Paint callbacks are expensive, and " 426 DCHECK(delegate_->IsTestConfig()) << "Paint callbacks are expensive, and "
417 << "allowed only in tests."; 427 << "allowed only in tests.";
418 DCHECK(window_paint_callback_.is_null() || callback.is_null()); 428 DCHECK(window_paint_callback_.is_null() || callback.is_null());
419 window_paint_callback_ = callback; 429 window_paint_callback_ = callback;
420 } 430 }
421 431
422 void WindowServer::ProcessViewportMetricsChanged( 432 void WindowServer::ProcessViewportMetricsChanged(
423 Display* display, 433 Display* display,
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 void WindowServer::OnFirstDisplayReady() { 680 void WindowServer::OnFirstDisplayReady() {
671 delegate_->OnFirstDisplayReady(); 681 delegate_->OnFirstDisplayReady();
672 } 682 }
673 683
674 void WindowServer::OnNoMoreDisplays() { 684 void WindowServer::OnNoMoreDisplays() {
675 delegate_->OnNoMoreDisplays(); 685 delegate_->OnNoMoreDisplays();
676 } 686 }
677 687
678 } // namespace ws 688 } // namespace ws
679 } // namespace mus 689 } // namespace mus
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698