Index: chrome/tools/test/reference_build/chrome_linux/resources/inspector/inspector_controller_impl.js |
diff --git a/chrome/tools/test/reference_build/chrome_linux/resources/inspector/inspector_controller_impl.js b/chrome/tools/test/reference_build/chrome_linux/resources/inspector/inspector_controller_impl.js |
index 2f6f65e7b39631d54eadb76ae1114260023029a4..1a18a45956cd596a7803b8db7ab5a19e0177d7ca 100644 |
--- a/chrome/tools/test/reference_build/chrome_linux/resources/inspector/inspector_controller_impl.js |
+++ b/chrome/tools/test/reference_build/chrome_linux/resources/inspector/inspector_controller_impl.js |
@@ -12,6 +12,34 @@ goog.provide('devtools.InspectorControllerImpl'); |
devtools.InspectorControllerImpl = function() { |
devtools.InspectorController.call(this); |
this.frame_element_id_ = 1; |
+ |
+ this.installInspectorControllerDelegate_('clearMessages'); |
+ this.installInspectorControllerDelegate_('storeLastActivePanel'); |
+ this.installInspectorControllerDelegate_('highlightDOMNode'); |
+ this.installInspectorControllerDelegate_('hideDOMNodeHighlight'); |
+ this.installInspectorControllerDelegate_('getChildNodes'); |
+ this.installInspectorControllerDelegate_('setAttribute'); |
+ this.installInspectorControllerDelegate_('removeAttribute'); |
+ this.installInspectorControllerDelegate_('setTextNodeValue'); |
+ this.installInspectorControllerDelegate_('enableResourceTracking'); |
+ this.installInspectorControllerDelegate_('disableResourceTracking'); |
+ |
+ this.installInjectedScriptDelegate_('getStyles'); |
+ this.installInjectedScriptDelegate_('getComputedStyle'); |
+ this.installInjectedScriptDelegate_('getInlineStyle'); |
+ this.installInjectedScriptDelegate_('applyStyleText'); |
+ this.installInjectedScriptDelegate_('setStyleText'); |
+ this.installInjectedScriptDelegate_('toggleStyleEnabled'); |
+ this.installInjectedScriptDelegate_('applyStyleRuleText'); |
+ this.installInjectedScriptDelegate_('addStyleSelector'); |
+ this.installInjectedScriptDelegate_('setStyleProperty'); |
+ this.installInjectedScriptDelegate_('getPrototypes'); |
+ this.installInjectedScriptDelegate_('setPropertyValue'); |
+ this.installInjectedScriptDelegate_('evaluate'); |
+ this.installInjectedScriptDelegate_('addInspectedNode'); |
+ this.installInjectedScriptDelegate_('pushNodeToFrontend'); |
+ this.installInjectedScriptDelegate_('performSearch'); |
+ this.installInjectedScriptDelegate_('searchCanceled'); |
}; |
goog.inherits(devtools.InspectorControllerImpl, |
devtools.InspectorController); |
@@ -20,8 +48,32 @@ goog.inherits(devtools.InspectorControllerImpl, |
/** |
* {@inheritDoc}. |
*/ |
-devtools.InspectorController.prototype.clearMessages = function() { |
- RemoteToolsAgent.ClearConsoleMessages(); |
+devtools.InspectorControllerImpl.prototype.platform = function() { |
+ return DevToolsHost.getPlatform(); |
+}; |
+ |
+ |
+/** |
+ * {@inheritDoc}. |
+ */ |
+devtools.InspectorControllerImpl.prototype.closeWindow = function() { |
+ DevToolsHost.closeWindow(); |
+}; |
+ |
+ |
+/** |
+ * {@inheritDoc}. |
+ */ |
+devtools.InspectorControllerImpl.prototype.attach = function() { |
+ DevToolsHost.dockWindow(); |
+}; |
+ |
+ |
+/** |
+ * {@inheritDoc}. |
+ */ |
+devtools.InspectorControllerImpl.prototype.detach = function() { |
+ DevToolsHost.undockWindow(); |
}; |
@@ -29,14 +81,14 @@ devtools.InspectorController.prototype.clearMessages = function() { |
* {@inheritDoc}. |
*/ |
devtools.InspectorControllerImpl.prototype.hiddenPanels = function() { |
- return 'profiles,databases'; |
+ return 'databases'; |
}; |
/** |
* {@inheritDoc}. |
*/ |
-devtools.InspectorController.prototype.search = function(sourceRow, query) { |
+devtools.InspectorControllerImpl.prototype.search = function(sourceRow, query) { |
return DevToolsHost.search(sourceRow, query); |
}; |
@@ -44,26 +96,48 @@ devtools.InspectorController.prototype.search = function(sourceRow, query) { |
/** |
* {@inheritDoc}. |
*/ |
-devtools.InspectorControllerImpl.prototype.addSourceToFrame = |
- function(mimeType, source, element) { |
- return DevToolsHost.addSourceToFrame(mimeType, source, element); |
+devtools.InspectorControllerImpl.prototype.toggleNodeSearch = function() { |
+ devtools.InspectorController.prototype.toggleNodeSearch.call(this); |
+ DevToolsHost.toggleInspectElementMode(this.searchingForNode()); |
}; |
/** |
* {@inheritDoc}. |
*/ |
-devtools.InspectorControllerImpl.prototype.hideDOMNodeHighlight = function() { |
- RemoteToolsAgent.HideDOMNodeHighlight(); |
+devtools.InspectorControllerImpl.prototype.localizedStringsURL = |
+ function(opt_prefix) { |
+ // l10n is turned off in test mode because delayed loading of strings |
+ // causes test failures. |
+ if (false) { |
+ var locale = DevToolsHost.getApplicationLocale(); |
+ locale = locale.replace('_', '-'); |
+ return 'l10n/localizedStrings_' + locale + '.js'; |
+ } else { |
+ return undefined; |
+ } |
}; |
/** |
* {@inheritDoc}. |
*/ |
-devtools.InspectorControllerImpl.prototype.highlightDOMNode = |
- function(hoveredNode) { |
- RemoteToolsAgent.HighlightDOMNode(hoveredNode.id_); |
+devtools.InspectorControllerImpl.prototype.addSourceToFrame = |
+ function(mimeType, source, element) { |
+ return DevToolsHost.addSourceToFrame(mimeType, source, element); |
+}; |
+ |
+ |
+/** |
+ * {@inheritDoc}. |
+ */ |
+devtools.InspectorControllerImpl.prototype.addResourceSourceToFrame = |
+ function(identifier, element) { |
+ var resource = WebInspector.resources[identifier]; |
+ if (!resource) { |
+ return; |
+ } |
+ DevToolsHost.addResourceSourceToFrame(identifier, resource.mimeType, element); |
}; |
@@ -71,7 +145,7 @@ devtools.InspectorControllerImpl.prototype.highlightDOMNode = |
* {@inheritDoc}. |
*/ |
devtools.InspectorControllerImpl.prototype.inspectedWindow = function() { |
- return devtools.tools.getDomAgent().getWindow(); |
+ return null; |
}; |
@@ -83,11 +157,6 @@ devtools.InspectorControllerImpl.prototype.debuggerEnabled = function() { |
}; |
-devtools.InspectorControllerImpl.prototype.currentCallFrame = function() { |
- return devtools.tools.getDebuggerAgent().getCurrentCallFrame(); |
-}; |
- |
- |
devtools.InspectorControllerImpl.prototype.addBreakpoint = function( |
sourceID, line) { |
devtools.tools.getDebuggerAgent().addBreakpoint(sourceID, line); |
@@ -100,7 +169,7 @@ devtools.InspectorControllerImpl.prototype.removeBreakpoint = function( |
}; |
-devtools.InspectorController.prototype.pauseInDebugger = function() { |
+devtools.InspectorControllerImpl.prototype.pauseInDebugger = function() { |
devtools.tools.getDebuggerAgent().pauseExecution(); |
}; |
@@ -131,7 +200,7 @@ devtools.InspectorControllerImpl.prototype.stepOverStatementInDebugger = |
/** |
* @override |
*/ |
-devtools.InspectorControllerImpl.prototype.pauseOnExceptions = function() { |
+devtools.InspectorControllerImpl.prototype.pauseOnExceptions = function() { |
return devtools.tools.getDebuggerAgent().pauseOnExceptions(); |
}; |
@@ -149,7 +218,8 @@ devtools.InspectorControllerImpl.prototype.setPauseOnExceptions = function( |
* @override |
*/ |
devtools.InspectorControllerImpl.prototype.startProfiling = function() { |
- devtools.tools.getDebuggerAgent().startProfiling(); |
+ devtools.tools.getDebuggerAgent().startProfiling( |
+ devtools.DebuggerAgent.ProfilerModules.PROFILER_MODULE_CPU); |
}; |
@@ -157,8 +227,103 @@ devtools.InspectorControllerImpl.prototype.startProfiling = function() { |
* @override |
*/ |
devtools.InspectorControllerImpl.prototype.stopProfiling = function() { |
- devtools.tools.getDebuggerAgent().stopProfiling(); |
+ devtools.tools.getDebuggerAgent().stopProfiling( |
+ devtools.DebuggerAgent.ProfilerModules.PROFILER_MODULE_CPU); |
+}; |
+ |
+ |
+/** |
+ * @override |
+ */ |
+devtools.InspectorControllerImpl.prototype.getCallFrames = function(callback) { |
+ callback(devtools.tools.getDebuggerAgent().getCallFrames()); |
+}; |
+ |
+ |
+/** |
+ * @override |
+ */ |
+devtools.InspectorControllerImpl.prototype.evaluateInCallFrame = |
+ function(callFrameId, code, callback) { |
+ devtools.tools.getDebuggerAgent().evaluateInCallFrame(callFrameId, code, |
+ callback); |
+}; |
+ |
+ |
+/** |
+ * @override |
+ */ |
+devtools.InspectorControllerImpl.prototype.getProperties = function( |
+ objectProxy, ignoreHasOwnProperty, callback) { |
+ if (objectProxy.isScope) { |
+ devtools.tools.getDebuggerAgent().resolveScope(objectProxy.objectId, |
+ callback); |
+ } else if (objectProxy.isV8Ref) { |
+ devtools.tools.getDebuggerAgent().resolveChildren(objectProxy.objectId, |
+ callback, true); |
+ } else { |
+ this.callInjectedScript_('getProperties', objectProxy, |
+ ignoreHasOwnProperty, callback); |
+ } |
+}; |
+ |
+ |
+/** |
+ * Installs delegating handler into the inspector controller. |
+ * @param {string} methodName Method to install delegating handler for. |
+ */ |
+devtools.InspectorControllerImpl.prototype.installInjectedScriptDelegate_ = |
+ function(methodName) { |
+ this[methodName] = goog.bind(this.callInjectedScript_, this, |
+ methodName); |
+}; |
+ |
+ |
+/** |
+ * Bound function with the installInjectedScriptDelegate_ actual |
+ * implementation. |
+ */ |
+devtools.InspectorControllerImpl.prototype.callInjectedScript_ = |
+ function(methodName, var_arg) { |
+ var allArgs = Array.prototype.slice.call(arguments); |
+ var callback = allArgs[allArgs.length - 1]; |
+ var args = Array.prototype.slice.call(allArgs, 0, allArgs.length - 1); |
+ RemoteToolsAgent.ExecuteUtilityFunction( |
+ devtools.InspectorControllerImpl.parseWrap_(callback), |
+ 'InjectedScript', JSON.stringify(args)); |
+}; |
+ |
+ |
+/** |
+ * Installs delegating handler into the inspector controller. |
+ * @param {string} methodName Method to install delegating handler for. |
+ */ |
+devtools.InspectorControllerImpl.prototype.installInspectorControllerDelegate_ |
+ = function(methodName) { |
+ this[methodName] = goog.bind(this.callInspectorController_, this, |
+ methodName); |
+}; |
+ |
+ |
+/** |
+ * Bound function with the installInjectedScriptDelegate_ actual |
+ * implementation. |
+ */ |
+devtools.InspectorControllerImpl.prototype.callInspectorController_ = |
+ function(methodName, var_arg) { |
+ var args = Array.prototype.slice.call(arguments); |
+ RemoteToolsAgent.ExecuteUtilityFunction( |
+ devtools.Callback.wrap(function(){}), |
+ 'InspectorController', JSON.stringify(args)); |
+}; |
+ |
+ |
+devtools.InspectorControllerImpl.parseWrap_ = function(callback) { |
+ return devtools.Callback.wrap( |
+ function(data) { |
+ callback.call(this, JSON.parse(data)); |
+ }); |
}; |
-var InspectorController = new devtools.InspectorControllerImpl(); |
+InspectorController = new devtools.InspectorControllerImpl(); |