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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/accessibility/AccessibilityModel.js

Issue 2851913002: [DevTools] Do not expose agents on Target
Patch Set: storage and tests.js 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
OLDNEW
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 * @unrestricted 5 * @unrestricted
6 */ 6 */
7 Accessibility.AccessibilityNode = class { 7 Accessibility.AccessibilityNode = class {
8 /** 8 /**
9 * @param {!Accessibility.AccessibilityModel} accessibilityModel 9 * @param {!Accessibility.AccessibilityModel} accessibilityModel
10 * @param {!Protocol.Accessibility.AXNode} payload 10 * @param {!Protocol.Accessibility.AXNode} payload
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 return string; 219 return string;
220 } 220 }
221 }; 221 };
222 222
223 /** 223 /**
224 * @unrestricted 224 * @unrestricted
225 */ 225 */
226 Accessibility.AccessibilityModel = class extends SDK.SDKModel { 226 Accessibility.AccessibilityModel = class extends SDK.SDKModel {
227 /** 227 /**
228 * @param {!SDK.Target} target 228 * @param {!SDK.Target} target
229 * @param {!Protocol.Dispatcher} dispatcher
229 */ 230 */
230 constructor(target) { 231 constructor(target, dispatcher) {
231 super(target); 232 super(target, dispatcher);
232 this._agent = target.accessibilityAgent(); 233 this._agent = dispatcher.accessibilityAgent();
233 234
234 /** @type {!Map<string, !Accessibility.AccessibilityNode>} */ 235 /** @type {!Map<string, !Accessibility.AccessibilityNode>} */
235 this._axIdToAXNode = new Map(); 236 this._axIdToAXNode = new Map();
236 this._backendDOMNodeIdToAXNode = new Map(); 237 this._backendDOMNodeIdToAXNode = new Map();
237 } 238 }
238 239
239 clear() { 240 clear() {
240 this._axIdToAXNode.clear(); 241 this._axIdToAXNode.clear();
241 } 242 }
242 243
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 */ 311 */
311 logTree(inspectedNode) { 312 logTree(inspectedNode) {
312 var rootNode = inspectedNode; 313 var rootNode = inspectedNode;
313 while (rootNode.parentNode()) 314 while (rootNode.parentNode())
314 rootNode = rootNode.parentNode(); 315 rootNode = rootNode.parentNode();
315 console.log(rootNode.printSelfAndChildren(inspectedNode)); // eslint-disabl e-line no-console 316 console.log(rootNode.printSelfAndChildren(inspectedNode)); // eslint-disabl e-line no-console
316 } 317 }
317 }; 318 };
318 319
319 SDK.SDKModel.register(Accessibility.AccessibilityModel, SDK.Target.Capability.DO M, false); 320 SDK.SDKModel.register(Accessibility.AccessibilityModel, SDK.Target.Capability.DO M, false);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698