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

Unified Diff: chrome_linux/resources/inspector/devtools_extension_api.js

Issue 23466010: Roll reference builds to r221697. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/reference_builds/
Patch Set: Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome_linux/resources/inspector/devtools.html ('k') | chrome_linux/resources/inspector/elementsPanel.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_linux/resources/inspector/devtools_extension_api.js
===================================================================
--- chrome_linux/resources/inspector/devtools_extension_api.js (revision 221742)
+++ chrome_linux/resources/inspector/devtools_extension_api.js (working copy)
@@ -65,7 +65,6 @@
NetworkRequestFinished: "network-request-finished",
OpenResource: "open-resource",
PanelSearch: "panel-search-",
- Reload: "Reload",
ResourceAdded: "resource-added",
ResourceContentCommitted: "resource-content-committed",
TimelineEventRecorded: "timeline-event-recorded",
@@ -82,11 +81,13 @@
CreateSidebarPane: "createSidebarPane",
CreateStatusBarButton: "createStatusBarButton",
EvaluateOnInspectedPage: "evaluateOnInspectedPage",
+ ForwardKeyboardEvent: "_forwardKeyboardEvent",
GetConsoleMessages: "getConsoleMessages",
GetHAR: "getHAR",
GetPageResources: "getPageResources",
GetRequestContent: "getRequestContent",
GetResourceContent: "getResourceContent",
+ Reload: "Reload",
Subscribe: "subscribe",
SetOpenResourceHandler: "setOpenResourceHandler",
SetResourceContent: "setResourceContent",
@@ -95,6 +96,8 @@
SetSidebarPage: "setSidebarPage",
ShowPanel: "showPanel",
StopAuditCategoryRun: "stopAuditCategoryRun",
+ OpenResource: "openResource",
+ Reload: "Reload",
Unsubscribe: "unsubscribe",
UpdateAuditProgress: "updateAuditProgress",
UpdateButton: "updateButton",
@@ -187,16 +190,6 @@
/**
* @constructor
*/
-InspectorExtensionAPI.prototype = {
- log: function(message)
- {
- extensionServer.sendRequest({ command: commands.Log, message: message });
- }
-}
-
-/**
- * @constructor
- */
function ConsoleAPI()
{
this.onMessageAdded = new EventSink(events.ConsoleMessageAdded);
@@ -330,6 +323,11 @@
extensionServer.sendRequest({ command: commands.SetOpenResourceHandler, "handlerPresent": !!callback });
},
+ openResource: function(url, lineNumber, callback)
+ {
+ extensionServer.sendRequest({ command: commands.OpenResource, "url": url, "lineNumber": lineNumber }, callback);
+ },
+
get SearchAction()
{
return apiPrivate.panels.SearchAction;
@@ -728,6 +726,27 @@
this.onEventRecorded = new EventSink(events.TimelineEventRecorded);
}
+function forwardKeyboardEvent(event)
+{
+ const Esc = "U+001B";
+ // We only care about global hotkeys, not about random text
+ if (!event.ctrlKey && !event.altKey && !event.metaKey && !/^F\d+$/.test(event.keyIdentifier) && event.keyIdentifier !== Esc)
+ return;
+ var request = {
+ command: commands.ForwardKeyboardEvent,
+ eventType: event.type,
+ ctrlKey: event.ctrlKey,
+ altKey: event.altKey,
+ metaKey: event.metaKey,
+ keyIdentifier: event.keyIdentifier,
+ location: event.location
+ };
+ extensionServer.sendRequest(request);
+}
+
+document.addEventListener("keydown", forwardKeyboardEvent, false);
+document.addEventListener("keypress", forwardKeyboardEvent, false);
+
/**
* @constructor
*/
« no previous file with comments | « chrome_linux/resources/inspector/devtools.html ('k') | chrome_linux/resources/inspector/elementsPanel.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698