/**
* @constructor
+ * @implements {WebInspector.TargetManager.Observer}
*/
WebInspector.InspectElementModeController = function()
{
this._toggleSearchButton = new WebInspector.StatusBarButton(WebInspector.UIString("Select an element in the page to inspect it."), "node-search-status-bar-item");
this._shortcut = WebInspector.InspectElementModeController.createShortcut();
InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.EnterInspectElementMode, this._toggleSearch, this);
+ WebInspector.targetManager.observeTargets(this);
}
/**
WebInspector.InspectElementModeController.prototype = {
/**
+ * @param {!WebInspector.Target} target
+ */
+ targetAdded: function(target)
+ {
+ // When DevTools are opening in the inspect element mode, the first target comes in
+ // much later than the InspectorFrontendAPI.enterInspectElementMode event.
+ if (this.enabled())
+ target.domModel.setInspectModeEnabled(true, WebInspector.settings.showUAShadowDOM.get());
+ },
+
+ /**
+ * @param {!WebInspector.Target} target
+ */
+ targetRemoved: function(target)
+ {
+ },
+
+ /**
* @return {boolean}
*/
enabled: function()