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

Side by Side Diff: ui/aura/mus/window_tree_client.cc

Issue 2830703003: [views-mus] Support custom cursors. (Closed)
Patch Set: fix cast_shell_linux Created 3 years, 7 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
« no previous file with comments | « ui/aura/mus/window_tree_client.h ('k') | ui/aura/test/mus/test_window_manager_client.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 "ui/aura/mus/window_tree_client.h" 5 #include "ui/aura/mus/window_tree_client.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 automatically_create_display_roots); 295 automatically_create_display_roots);
296 SetWindowTree(std::move(window_tree)); 296 SetWindowTree(std::move(window_tree));
297 } 297 }
298 298
299 void WindowTreeClient::SetCanFocus(Window* window, bool can_focus) { 299 void WindowTreeClient::SetCanFocus(Window* window, bool can_focus) {
300 DCHECK(tree_); 300 DCHECK(tree_);
301 DCHECK(window); 301 DCHECK(window);
302 tree_->SetCanFocus(WindowMus::Get(window)->server_id(), can_focus); 302 tree_->SetCanFocus(WindowMus::Get(window)->server_id(), can_focus);
303 } 303 }
304 304
305 void WindowTreeClient::SetPredefinedCursor(WindowMus* window, 305 void WindowTreeClient::SetCursor(WindowMus* window,
306 ui::mojom::CursorType old_cursor, 306 const ui::CursorData& old_cursor,
307 ui::mojom::CursorType new_cursor) { 307 const ui::CursorData& new_cursor) {
308 DCHECK(tree_); 308 DCHECK(tree_);
309 309
310 const uint32_t change_id = ScheduleInFlightChange( 310 const uint32_t change_id = ScheduleInFlightChange(
311 base::MakeUnique<InFlightPredefinedCursorChange>(window, old_cursor)); 311 base::MakeUnique<InFlightCursorChange>(window, old_cursor));
312 tree_->SetPredefinedCursor(change_id, window->server_id(), new_cursor); 312 tree_->SetCursor(change_id, window->server_id(), new_cursor);
313 } 313 }
314 314
315 void WindowTreeClient::SetWindowTextInputState(WindowMus* window, 315 void WindowTreeClient::SetWindowTextInputState(WindowMus* window,
316 mojo::TextInputStatePtr state) { 316 mojo::TextInputStatePtr state) {
317 DCHECK(tree_); 317 DCHECK(tree_);
318 tree_->SetWindowTextInputState(window->server_id(), std::move(state)); 318 tree_->SetWindowTextInputState(window->server_id(), std::move(state));
319 } 319 }
320 320
321 void WindowTreeClient::SetImeVisibility(WindowMus* window, 321 void WindowTreeClient::SetImeVisibility(WindowMus* window,
322 bool visible, 322 bool visible,
(...skipping 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after
1334 void WindowTreeClient::OnWindowFocused(Id focused_window_id) { 1334 void WindowTreeClient::OnWindowFocused(Id focused_window_id) {
1335 WindowMus* focused_window = GetWindowByServerId(focused_window_id); 1335 WindowMus* focused_window = GetWindowByServerId(focused_window_id);
1336 InFlightFocusChange new_change(this, focus_synchronizer_.get(), 1336 InFlightFocusChange new_change(this, focus_synchronizer_.get(),
1337 focused_window); 1337 focused_window);
1338 if (ApplyServerChangeToExistingInFlightChange(new_change)) 1338 if (ApplyServerChangeToExistingInFlightChange(new_change))
1339 return; 1339 return;
1340 1340
1341 focus_synchronizer_->SetFocusFromServer(focused_window); 1341 focus_synchronizer_->SetFocusFromServer(focused_window);
1342 } 1342 }
1343 1343
1344 void WindowTreeClient::OnWindowPredefinedCursorChanged( 1344 void WindowTreeClient::OnWindowCursorChanged(Id window_id,
1345 Id window_id, 1345 ui::CursorData cursor) {
1346 ui::mojom::CursorType cursor) {
1347 WindowMus* window = GetWindowByServerId(window_id); 1346 WindowMus* window = GetWindowByServerId(window_id);
1348 if (!window) 1347 if (!window)
1349 return; 1348 return;
1350 1349
1351 InFlightPredefinedCursorChange new_change(window, cursor); 1350 InFlightCursorChange new_change(window, cursor);
1352 if (ApplyServerChangeToExistingInFlightChange(new_change)) 1351 if (ApplyServerChangeToExistingInFlightChange(new_change))
1353 return; 1352 return;
1354 1353
1355 window->SetPredefinedCursorFromServer(cursor); 1354 window->SetCursorFromServer(cursor);
1356 } 1355 }
1357 1356
1358 void WindowTreeClient::OnWindowSurfaceChanged( 1357 void WindowTreeClient::OnWindowSurfaceChanged(
1359 Id window_id, 1358 Id window_id,
1360 const cc::SurfaceInfo& surface_info) { 1359 const cc::SurfaceInfo& surface_info) {
1361 WindowMus* window = GetWindowByServerId(window_id); 1360 WindowMus* window = GetWindowByServerId(window_id);
1362 if (!window) 1361 if (!window)
1363 return; 1362 return;
1364 if (enable_surface_synchronization_) { 1363 if (enable_surface_synchronization_) {
1365 // If surface synchronization is enabled, and the parent is informed 1364 // If surface synchronization is enabled, and the parent is informed
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
1763 1762
1764 void WindowTreeClient::SetFrameDecorationValues( 1763 void WindowTreeClient::SetFrameDecorationValues(
1765 ui::mojom::FrameDecorationValuesPtr values) { 1764 ui::mojom::FrameDecorationValuesPtr values) {
1766 if (window_manager_client_) { 1765 if (window_manager_client_) {
1767 normal_client_area_insets_ = values->normal_client_area_insets; 1766 normal_client_area_insets_ = values->normal_client_area_insets;
1768 window_manager_client_->WmSetFrameDecorationValues(std::move(values)); 1767 window_manager_client_->WmSetFrameDecorationValues(std::move(values));
1769 } 1768 }
1770 } 1769 }
1771 1770
1772 void WindowTreeClient::SetNonClientCursor(Window* window, 1771 void WindowTreeClient::SetNonClientCursor(Window* window,
1773 ui::mojom::CursorType cursor_id) { 1772 const ui::CursorData& cursor) {
1774 if (window_manager_client_) { 1773 if (window_manager_client_) {
1775 window_manager_client_->WmSetNonClientCursor( 1774 window_manager_client_->WmSetNonClientCursor(
1776 WindowMus::Get(window)->server_id(), cursor_id); 1775 WindowMus::Get(window)->server_id(), cursor);
1777 } 1776 }
1778 } 1777 }
1779 1778
1780 void WindowTreeClient::AddAccelerators( 1779 void WindowTreeClient::AddAccelerators(
1781 std::vector<ui::mojom::WmAcceleratorPtr> accelerators, 1780 std::vector<ui::mojom::WmAcceleratorPtr> accelerators,
1782 const base::Callback<void(bool)>& callback) { 1781 const base::Callback<void(bool)>& callback) {
1783 if (window_manager_client_) { 1782 if (window_manager_client_) {
1784 window_manager_client_->AddAccelerators(std::move(accelerators), callback); 1783 window_manager_client_->AddAccelerators(std::move(accelerators), callback);
1785 } 1784 }
1786 } 1785 }
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
2028 return ScheduleInFlightChange(base::MakeUnique<InFlightCaptureChange>( 2027 return ScheduleInFlightChange(base::MakeUnique<InFlightCaptureChange>(
2029 this, capture_synchronizer_.get(), window)); 2028 this, capture_synchronizer_.get(), window));
2030 } 2029 }
2031 2030
2032 uint32_t WindowTreeClient::CreateChangeIdForFocus(WindowMus* window) { 2031 uint32_t WindowTreeClient::CreateChangeIdForFocus(WindowMus* window) {
2033 return ScheduleInFlightChange(base::MakeUnique<InFlightFocusChange>( 2032 return ScheduleInFlightChange(base::MakeUnique<InFlightFocusChange>(
2034 this, focus_synchronizer_.get(), window)); 2033 this, focus_synchronizer_.get(), window));
2035 } 2034 }
2036 2035
2037 } // namespace aura 2036 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/mus/window_tree_client.h ('k') | ui/aura/test/mus/test_window_manager_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698