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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/elements/InspectElementModeController.js

Issue 2137773002: [DevTools] Replace the target type with capabilities (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 5 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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 10 *
(...skipping 22 matching lines...) Expand all
33 WebInspector.InspectElementModeController = function() 33 WebInspector.InspectElementModeController = function()
34 { 34 {
35 this._toggleSearchAction = WebInspector.actionRegistry.action("elements.togg le-element-search"); 35 this._toggleSearchAction = WebInspector.actionRegistry.action("elements.togg le-element-search");
36 if (Runtime.experiments.isEnabled("layoutEditor")) { 36 if (Runtime.experiments.isEnabled("layoutEditor")) {
37 this._layoutEditorButton = new WebInspector.ToolbarToggle(WebInspector.U IString("Toggle Layout Editor"), "layout-editor-toolbar-item"); 37 this._layoutEditorButton = new WebInspector.ToolbarToggle(WebInspector.U IString("Toggle Layout Editor"), "layout-editor-toolbar-item");
38 this._layoutEditorButton.addEventListener("click", this._toggleLayoutEdi tor, this); 38 this._layoutEditorButton.addEventListener("click", this._toggleLayoutEdi tor, this);
39 } 39 }
40 40
41 this._mode = DOMAgent.InspectMode.None; 41 this._mode = DOMAgent.InspectMode.None;
42 WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Event s.SuspendStateChanged, this._suspendStateChanged, this); 42 WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Event s.SuspendStateChanged, this._suspendStateChanged, this);
43 WebInspector.targetManager.observeTargets(this, WebInspector.Target.Type.Pag e); 43 WebInspector.targetManager.observeTargets(this, WebInspector.Target.Capabili ty.Browser);
44 } 44 }
45 45
46 WebInspector.InspectElementModeController.prototype = { 46 WebInspector.InspectElementModeController.prototype = {
47 /** 47 /**
48 * @override 48 * @override
49 * @param {!WebInspector.Target} target 49 * @param {!WebInspector.Target} target
50 */ 50 */
51 targetAdded: function(target) 51 targetAdded: function(target)
52 { 52 {
53 // When DevTools are opening in the inspect element mode, the first targ et comes in 53 // When DevTools are opening in the inspect element mode, the first targ et comes in
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 { 179 {
180 if (!WebInspector.inspectElementModeController) 180 if (!WebInspector.inspectElementModeController)
181 return null; 181 return null;
182 182
183 return WebInspector.inspectElementModeController._layoutEditorButton; 183 return WebInspector.inspectElementModeController._layoutEditorButton;
184 } 184 }
185 } 185 }
186 186
187 /** @type {?WebInspector.InspectElementModeController} */ 187 /** @type {?WebInspector.InspectElementModeController} */
188 WebInspector.inspectElementModeController = Runtime.queryParam("isSharedWorker") ? null : new WebInspector.InspectElementModeController(); 188 WebInspector.inspectElementModeController = Runtime.queryParam("isSharedWorker") ? null : new WebInspector.InspectElementModeController();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698