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

Side by Side Diff: services/ui/ws/window_tree.cc

Issue 2667073002: mash: changes can_accept_events to an enum (Closed)
Patch Set: merge Created 3 years, 10 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 | « services/ui/ws/window_tree.h ('k') | services/ui/ws/window_tree_unittest.cc » ('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 "services/ui/ws/window_tree.h" 5 #include "services/ui/ws/window_tree.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 1546 matching lines...) Expand 10 before | Expand all | Expand 10 after
1557 WindowManagerDisplayRoot* display_root = 1557 WindowManagerDisplayRoot* display_root =
1558 GetWindowManagerDisplayRoot(window); 1558 GetWindowManagerDisplayRoot(window);
1559 WindowTree* wm_tree = display_root->window_manager_state()->window_tree(); 1559 WindowTree* wm_tree = display_root->window_manager_state()->window_tree();
1560 wm_tree->window_manager_internal_->WmSetCanFocus(transport_window_id, 1560 wm_tree->window_manager_internal_->WmSetCanFocus(transport_window_id,
1561 can_focus); 1561 can_focus);
1562 } else if (access_policy_->CanSetFocus(window)) { 1562 } else if (access_policy_->CanSetFocus(window)) {
1563 window->set_can_focus(can_focus); 1563 window->set_can_focus(can_focus);
1564 } 1564 }
1565 } 1565 }
1566 1566
1567 void WindowTree::SetCanAcceptEvents(Id transport_window_id, 1567 void WindowTree::SetEventTargetingPolicy(Id transport_window_id,
1568 bool can_accept_events) { 1568 mojom::EventTargetingPolicy policy) {
1569 ServerWindow* window = 1569 ServerWindow* window =
1570 GetWindowByClientId(ClientWindowId(transport_window_id)); 1570 GetWindowByClientId(ClientWindowId(transport_window_id));
1571 // TODO(riajiang): check |event_queue_| is empty for |window|. 1571 // TODO(riajiang): check |event_queue_| is empty for |window|.
1572 if (window && access_policy_->CanSetAcceptEvents(window)) 1572 if (window && access_policy_->CanSetEventTargetingPolicy(window))
1573 window->set_can_accept_events(can_accept_events); 1573 window->set_event_targeting_policy(policy);
1574 } 1574 }
1575 1575
1576 void WindowTree::SetPredefinedCursor(uint32_t change_id, 1576 void WindowTree::SetPredefinedCursor(uint32_t change_id,
1577 Id transport_window_id, 1577 Id transport_window_id,
1578 ui::mojom::Cursor cursor_id) { 1578 ui::mojom::Cursor cursor_id) {
1579 ServerWindow* window = 1579 ServerWindow* window =
1580 GetWindowByClientId(ClientWindowId(transport_window_id)); 1580 GetWindowByClientId(ClientWindowId(transport_window_id));
1581 1581
1582 // Only the owner of the window can change the bounds. 1582 // Only the owner of the window can change the bounds.
1583 bool success = window && access_policy_->CanSetCursorProperties(window); 1583 bool success = window && access_policy_->CanSetCursorProperties(window);
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
2151 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, 2151 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset,
2152 effect_bitmask, callback); 2152 effect_bitmask, callback);
2153 } 2153 }
2154 2154
2155 void WindowTree::PerformOnDragDropDone() { 2155 void WindowTree::PerformOnDragDropDone() {
2156 client()->OnDragDropDone(); 2156 client()->OnDragDropDone();
2157 } 2157 }
2158 2158
2159 } // namespace ws 2159 } // namespace ws
2160 } // namespace ui 2160 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/window_tree.h ('k') | services/ui/ws/window_tree_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698