• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
7namespace 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    // Optional id for performance trace data that can be included in this
43    // report.
44    long? traceId;
45
46    // An array of key/value pairs providing system information for this
47    // feedback report.
48    SystemInformation[]? systemInformation;
49
50    // True if we have permission to add histograms to this feedback report.
51    boolean sendHistograms;
52
53    // TODO(rkc): Remove these once we have bindings to send blobs to Chrome.
54    // Used internally to store the blob uuid after parameter customization.
55    DOMString? attachedFileBlobUuid;
56    DOMString? screenshotBlobUuid;
57  };
58
59  // Status of the sending of a feedback report.
60  enum Status {success, delayed};
61
62  callback GetUserEmailCallback = void(DOMString email);
63  callback GetSystemInformationCallback =
64      void(SystemInformation[] systemInformation);
65  callback SendFeedbackCallback = void(Status status);
66  callback GetStringsCallback = void(object result);
67
68  interface Functions {
69    // Returns the email of the currently active or logged in user.
70    static void getUserEmail(GetUserEmailCallback callback);
71
72    // Returns the system information dictionary.
73    static void getSystemInformation(GetSystemInformationCallback callback);
74
75    // Sends a feedback report.
76    static void sendFeedback(FeedbackInfo feedback,
77                             SendFeedbackCallback callback);
78
79    // Gets localized translated strings for feedback. It returns the
80    // strings as a dictionary mapping from string identifier to the
81    // translated string to use in the feedback app UI.
82    static void getStrings(GetStringsCallback callback);
83  };
84
85  interface Events {
86    // Fired when the a user requests the launch of the feedback UI. We're
87    // using an event for this versus using the override API since we want
88    // to be invoked, but not showing a UI, so the feedback extension can
89    // take a screenshot of the user's desktop.
90    static void onFeedbackRequested(FeedbackInfo feedback);
91  };
92};
93