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 5 // Use the <code>chrome.feedbackPrivate</code> API to provide Chrome [OS] 6 // feedback to the Google Feedback servers. 7 namespace feedbackPrivate { 8 9 dictionary AttachedFile { 10 DOMString name; 11 [instanceOf=Blob] object data; 12 }; 13 14 dictionary SystemInformation { 15 DOMString key; 16 DOMString value; 17 }; 18 19 dictionary FeedbackInfo { 20 // File to attach to the feedback report. 21 AttachedFile? attachedFile; 22 23 // An optional tag to label what type this feedback is. 24 DOMString? categoryTag; 25 26 // The feedback text describing the user issue. 27 DOMString description; 28 29 // The e-mail of the user that initiated this feedback. 30 DOMString? email; 31 32 // The URL of the page that this issue was being experienced on. 33 DOMString? pageUrl; 34 35 // Optional product ID to override the Chrome [OS] product id that is 36 // usually passed to the feedback server. 37 DOMString? productId; 38 39 // Screenshot to send with this feedback. 40 [instanceOf=Blob] object? screenshot; 41 42 // An array of key/value pairs providing system information for this 43 // feedback report. 44 SystemInformation[]? systemInformation; 45 46 // TODO(rkc): Remove these once we have bindings to send blobs to Chrome. 47 // Used internally to store the blob Url after parameter customization. 48 DOMString? attachedFileBlobUrl; 49 DOMString? screenshotBlobUrl; 50 }; 51 52 // Status of the sending of a feedback report. 53 enum Status {success, delayed}; 54 55 callback GetUserEmailCallback = void(DOMString email); 56 callback GetSystemInformationCallback = 57 void(SystemInformation[] systemInformation); 58 callback SendFeedbackCallback = void(Status status); 59 callback GetStringsCallback = void(object result); 60 61 interface Functions { 62 // Returns the email of the currently active or logged in user. 63 static void getUserEmail(GetUserEmailCallback callback); 64 65 // Returns the system information dictionary. 66 static void getSystemInformation(GetSystemInformationCallback callback); 67 68 // Sends a feedback report. 69 static void sendFeedback(FeedbackInfo feedback, 70 SendFeedbackCallback callback); 71 }; 72 73 interface Events { 74 // Fired when the a user requests the launch of the feedback UI. We're 75 // using an event for this versus using the override API since we want 76 // to be invoked, but not showing a UI, so the feedback extension can 77 // take a screenshot of the user's desktop. 78 static void onFeedbackRequested(FeedbackInfo feedback); 79 }; 80 }; 81