feedback_private_custom_bindings.js 1.0 KB

12345678910111213141516171819202122232425262728
  1. // Copyright 2013 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. // Custom bindings for the feedbackPrivate API.
  5. var blobNatives = requireNative('blob_natives');
  6. apiBridge.registerCustomHook(function(bindingsAPI) {
  7. var apiFunctions = bindingsAPI.apiFunctions;
  8. apiFunctions.setUpdateArgumentsPostValidate(
  9. 'sendFeedback',
  10. function(feedbackInfo, loadSystemInfo, formOpenTime, callback) {
  11. var attachedFileBlobUuid = '';
  12. var screenshotBlobUuid = '';
  13. if (feedbackInfo.attachedFile)
  14. attachedFileBlobUuid =
  15. blobNatives.GetBlobUuid(feedbackInfo.attachedFile.data);
  16. if (feedbackInfo.screenshot)
  17. screenshotBlobUuid = blobNatives.GetBlobUuid(feedbackInfo.screenshot);
  18. feedbackInfo.attachedFileBlobUuid = attachedFileBlobUuid;
  19. feedbackInfo.screenshotBlobUuid = screenshotBlobUuid;
  20. return [feedbackInfo, loadSystemInfo, formOpenTime, callback];
  21. });
  22. });