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

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

Issue 2057793002: Reorganize event mojom files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed typos in comments. Created 4 years, 6 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_tree.h" 5 #include "components/mus/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 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after
1134 event_observer_id_ = 0; 1134 event_observer_id_ = 0;
1135 return; 1135 return;
1136 } 1136 }
1137 1137
1138 // Do not allow key events to be observed, as a compromised app could register 1138 // Do not allow key events to be observed, as a compromised app could register
1139 // itself as an event observer and spy on keystrokes to another app. 1139 // itself as an event observer and spy on keystrokes to another app.
1140 if (!matcher->type_matcher) { 1140 if (!matcher->type_matcher) {
1141 DVLOG(1) << "SetEventObserver must specify an event type."; 1141 DVLOG(1) << "SetEventObserver must specify an event type.";
1142 return; 1142 return;
1143 } 1143 }
1144 const mojom::EventType event_type_whitelist[] = { 1144 const ui::mojom::EventType event_type_whitelist[] = {
1145 mojom::EventType::POINTER_CANCEL, 1145 ui::mojom::EventType::POINTER_CANCEL, ui::mojom::EventType::POINTER_DOWN,
1146 mojom::EventType::POINTER_DOWN, 1146 ui::mojom::EventType::POINTER_MOVE, ui::mojom::EventType::POINTER_UP,
1147 mojom::EventType::POINTER_MOVE, 1147 ui::mojom::EventType::MOUSE_EXIT, ui::mojom::EventType::WHEEL,
1148 mojom::EventType::POINTER_UP,
1149 mojom::EventType::MOUSE_EXIT,
1150 mojom::EventType::WHEEL,
1151 }; 1148 };
1152 bool allowed = false; 1149 bool allowed = false;
1153 for (mojom::EventType event_type : event_type_whitelist) { 1150 for (ui::mojom::EventType event_type : event_type_whitelist) {
1154 if (matcher->type_matcher->type == event_type) { 1151 if (matcher->type_matcher->type == event_type) {
1155 allowed = true; 1152 allowed = true;
1156 break; 1153 break;
1157 } 1154 }
1158 } 1155 }
1159 if (!allowed) { 1156 if (!allowed) {
1160 DVLOG(1) << "SetEventObserver event type not allowed"; 1157 DVLOG(1) << "SetEventObserver event type not allowed";
1161 return; 1158 return;
1162 } 1159 }
1163 1160
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
1499 } 1496 }
1500 1497
1501 bool WindowTree::IsWindowRootOfAnotherTreeForAccessPolicy( 1498 bool WindowTree::IsWindowRootOfAnotherTreeForAccessPolicy(
1502 const ServerWindow* window) const { 1499 const ServerWindow* window) const {
1503 WindowTree* tree = window_server_->GetTreeWithRoot(window); 1500 WindowTree* tree = window_server_->GetTreeWithRoot(window);
1504 return tree && tree != this; 1501 return tree && tree != this;
1505 } 1502 }
1506 1503
1507 } // namespace ws 1504 } // namespace ws
1508 } // namespace mus 1505 } // namespace mus
OLDNEW
« no previous file with comments | « components/mus/ws/window_manager_state_unittest.cc ('k') | components/mus/ws/window_tree_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698