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

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

Issue 17111003: Implement the feedbackPrivate API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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
Index: chrome/renderer/resources/extensions/feedback_private_custom_bindings.js
diff --git a/chrome/renderer/resources/extensions/feedback_private_custom_bindings.js b/chrome/renderer/resources/extensions/feedback_private_custom_bindings.js
new file mode 100644
index 0000000000000000000000000000000000000000..6b2122b95121514e3fef0297fe03c993934d0c37
--- /dev/null
+++ b/chrome/renderer/resources/extensions/feedback_private_custom_bindings.js
@@ -0,0 +1,32 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Custom bindings for the feedbackPrivate API.
+
+var binding = require('binding').Binding.create('feedbackPrivate');
+
+var feedbackPrivateNatives = requireNative('feedback_private');
+
+binding.registerCustomHook(function(bindingsAPI) {
+ var apiFunctions = bindingsAPI.apiFunctions;
+ apiFunctions.setUpdateArgumentsPostValidate(
+ "sendFeedback", function(feedbackInfo, callback) {
+ var attachedFileBlobUrl = '';
+ var screenshotBlobUrl = '';
+
+ if (feedbackInfo.attachedFile)
+ attachedFileBlobUrl =
+ feedbackPrivateNatives.GetBlobUrl(feedbackInfo.attachedFile.data);
+ if (feedbackInfo.screenshot)
+ screenshotBlobUrl =
+ feedbackPrivateNatives.GetBlobUrl(feedbackInfo.screenshot);
+
+ feedbackInfo.attachedFileBlobUrl = attachedFileBlobUrl;
+ feedbackInfo.screenshotBlobUrl = screenshotBlobUrl;
+
+ return [feedbackInfo, callback];
+ });
+});
+
+exports.binding = binding.generate();

Powered by Google App Engine
This is Rietveld 408576698