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

Unified Diff: chrome/renderer/resources/extensions/omnibox_custom_bindings.js

Issue 12314164: Modified Omnibox extension api to use JSON Schema Compiler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replaced include with forward declaration Created 7 years, 8 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/common/extensions/api/omnibox.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/resources/extensions/omnibox_custom_bindings.js
diff --git a/chrome/renderer/resources/extensions/omnibox_custom_bindings.js b/chrome/renderer/resources/extensions/omnibox_custom_bindings.js
index fa0ced3aa34515132f9f4c72a0a07b71fe0ea065..32ff65a7f6867880a8e901693ae63b5d5203d597 100644
--- a/chrome/renderer/resources/extensions/omnibox_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/omnibox_custom_bindings.js
@@ -84,6 +84,16 @@ function parseOmniboxDescription(input) {
binding.registerCustomHook(function(bindingsAPI) {
var apiFunctions = bindingsAPI.apiFunctions;
+ apiFunctions.setUpdateArgumentsPreValidate('setDefaultSuggestion',
+ function(suggestResult) {
+ if (suggestResult.content != undefined) { // null, etc.
+ throw new Error(
+ 'setDefaultSuggestion cannot contain the "content" field');
+ }
+ suggestResult.content = '';
+ return [suggestResult];
+ });
+
apiFunctions.setHandleRequest('setDefaultSuggestion', function(details) {
var parseResult = parseOmniboxDescription(details.description);
sendRequest(this.name, [parseResult], this.definition.parameters);
« no previous file with comments | « chrome/common/extensions/api/omnibox.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698