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

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: . 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 for (auto& pair : tree_map_) {
sky 2016/04/21 17:23:04 nit: no {}
James Cook 2016/04/22 18:22:54 Done.
404 pair.second->SendToEventObserver(event);
405 }
sadrul 2016/04/21 19:15:29 It should send only if the requestor and the targe
James Cook 2016/04/22 18:22:54 Done.
406 }
407
402 void WindowServer::ProcessViewportMetricsChanged( 408 void WindowServer::ProcessViewportMetricsChanged(
403 Display* display, 409 Display* display,
404 const mojom::ViewportMetrics& old_metrics, 410 const mojom::ViewportMetrics& old_metrics,
405 const mojom::ViewportMetrics& new_metrics) { 411 const mojom::ViewportMetrics& new_metrics) {
406 for (auto& pair : tree_map_) { 412 for (auto& pair : tree_map_) {
407 pair.second->ProcessViewportMetricsChanged( 413 pair.second->ProcessViewportMetricsChanged(
408 display, old_metrics, new_metrics, IsOperationSource(pair.first)); 414 display, old_metrics, new_metrics, IsOperationSource(pair.first));
409 } 415 }
410 } 416 }
411 417
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 void WindowServer::OnFirstDisplayReady() { 652 void WindowServer::OnFirstDisplayReady() {
647 delegate_->OnFirstDisplayReady(); 653 delegate_->OnFirstDisplayReady();
648 } 654 }
649 655
650 void WindowServer::OnNoMoreDisplays() { 656 void WindowServer::OnNoMoreDisplays() {
651 delegate_->OnNoMoreDisplays(); 657 delegate_->OnNoMoreDisplays();
652 } 658 }
653 659
654 } // namespace ws 660 } // namespace ws
655 } // namespace mus 661 } // namespace mus
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698