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

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

Issue 1465803003: mus: Let clients set the cursor of their window. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Do it the other way + explicit checks that it is a mouse pointer. Created 5 years 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
« no previous file with comments | « components/mus/ws/connection_manager.h ('k') | components/mus/ws/default_access_policy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/connection_manager.h" 5 #include "components/mus/ws/connection_manager.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/client_connection.h" 9 #include "components/mus/ws/client_connection.h"
10 #include "components/mus/ws/connection_manager_delegate.h" 10 #include "components/mus/ws/connection_manager_delegate.h"
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 } 331 }
332 } 332 }
333 333
334 void ConnectionManager::ProcessWindowDeleted(const WindowId& window) { 334 void ConnectionManager::ProcessWindowDeleted(const WindowId& window) {
335 for (auto& pair : connection_map_) { 335 for (auto& pair : connection_map_) {
336 pair.second->service()->ProcessWindowDeleted(window, 336 pair.second->service()->ProcessWindowDeleted(window,
337 IsOperationSource(pair.first)); 337 IsOperationSource(pair.first));
338 } 338 }
339 } 339 }
340 340
341 void ConnectionManager::ProcessWillChangeWindowPredefinedCursor(
342 ServerWindow* window,
343 int32_t cursor_id) {
344 for (auto& pair : connection_map_) {
345 pair.second->service()->ProcessCursorChanged(window, cursor_id,
346 IsOperationSource(pair.first));
347 }
348
349 // Pass the cursor change to the native window.
350 WindowTreeHostImpl* host = GetWindowTreeHostByWindow(window);
351 if (host)
352 host->OnCursorUpdated(window);
353 }
354
341 void ConnectionManager::ProcessViewportMetricsChanged( 355 void ConnectionManager::ProcessViewportMetricsChanged(
342 const mojom::ViewportMetrics& old_metrics, 356 const mojom::ViewportMetrics& old_metrics,
343 const mojom::ViewportMetrics& new_metrics) { 357 const mojom::ViewportMetrics& new_metrics) {
344 for (auto& pair : connection_map_) { 358 for (auto& pair : connection_map_) {
345 pair.second->service()->ProcessViewportMetricsChanged( 359 pair.second->service()->ProcessViewportMetricsChanged(
346 old_metrics, new_metrics, IsOperationSource(pair.first)); 360 old_metrics, new_metrics, IsOperationSource(pair.first));
347 } 361 }
348 } 362 }
349 363
350 void ConnectionManager::PrepareForOperation(Operation* op) { 364 void ConnectionManager::PrepareForOperation(Operation* op) {
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 (!window->visible() && window->parent()->IsDrawn()))) { 475 (!window->visible() && window->parent()->IsDrawn()))) {
462 SchedulePaint(window->parent(), window->bounds()); 476 SchedulePaint(window->parent(), window->bounds());
463 } 477 }
464 478
465 for (auto& pair : connection_map_) { 479 for (auto& pair : connection_map_) {
466 pair.second->service()->ProcessWillChangeWindowVisibility( 480 pair.second->service()->ProcessWillChangeWindowVisibility(
467 window, IsOperationSource(pair.first)); 481 window, IsOperationSource(pair.first));
468 } 482 }
469 } 483 }
470 484
485 void ConnectionManager::OnWindowPredefinedCursorChanged(ServerWindow* window,
486 int32_t cursor_id) {
487 if (in_destructor_)
488 return;
489
490 ProcessWillChangeWindowPredefinedCursor(window, cursor_id);
491 }
492
471 void ConnectionManager::OnWindowSharedPropertyChanged( 493 void ConnectionManager::OnWindowSharedPropertyChanged(
472 ServerWindow* window, 494 ServerWindow* window,
473 const std::string& name, 495 const std::string& name,
474 const std::vector<uint8_t>* new_data) { 496 const std::vector<uint8_t>* new_data) {
475 for (auto& pair : connection_map_) { 497 for (auto& pair : connection_map_) {
476 pair.second->service()->ProcessWindowPropertyChanged( 498 pair.second->service()->ProcessWindowPropertyChanged(
477 window, name, new_data, IsOperationSource(pair.first)); 499 window, name, new_data, IsOperationSource(pair.first));
478 } 500 }
479 } 501 }
480 502
(...skipping 20 matching lines...) Expand all
501 return; 523 return;
502 for (auto& pair : connection_map_) { 524 for (auto& pair : connection_map_) {
503 pair.second->service()->ProcessTransientWindowRemoved( 525 pair.second->service()->ProcessTransientWindowRemoved(
504 window, transient_child, IsOperationSource(pair.first)); 526 window, transient_child, IsOperationSource(pair.first));
505 } 527 }
506 } 528 }
507 529
508 } // namespace ws 530 } // namespace ws
509 531
510 } // namespace mus 532 } // namespace mus
OLDNEW
« no previous file with comments | « components/mus/ws/connection_manager.h ('k') | components/mus/ws/default_access_policy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698