| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Use the <code>chrome.feedbackPrivate</code> API to provide Chrome [OS] | 5 // Use the <code>chrome.feedbackPrivate</code> API to provide Chrome [OS] |
| 6 // feedback to the Google Feedback servers. | 6 // feedback to the Google Feedback servers. |
| 7 namespace feedbackPrivate { | 7 namespace feedbackPrivate { |
| 8 | 8 |
| 9 dictionary AttachedFile { | 9 dictionary AttachedFile { |
| 10 DOMString name; | 10 DOMString name; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 // User clicked the "Learn More" button. | 88 // User clicked the "Learn More" button. |
| 89 accepted, | 89 accepted, |
| 90 | 90 |
| 91 // User declined the prompt and proceeded to the feedback page. | 91 // User declined the prompt and proceeded to the feedback page. |
| 92 declined, | 92 declined, |
| 93 | 93 |
| 94 // User closed the window altogether. | 94 // User closed the window altogether. |
| 95 closed | 95 closed |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 // Allowed log sources on Chrome OS. |
| 99 enum LogSource { |
| 100 // Chrome OS system messages. |
| 101 messages, |
| 102 |
| 103 // Latest Chrome OS UI logs. |
| 104 uiLatest |
| 105 }; |
| 106 |
| 107 // Input parameters for a readLogSource() call. |
| 108 dictionary ReadLogSourceParams { |
| 109 // The log source from which to read. |
| 110 LogSource source; |
| 111 |
| 112 // For file-based log sources, read from source without closing the file |
| 113 // handle. The next time $(ref:readLogSource) is called, the file read will |
| 114 // continue where it left off. $(ref:readLogSource) can be called with |
| 115 // <code>incremental=true</code> repeatedly. To subsequently close the file |
| 116 // handle, pass in <code>incremental=false</code>. |
| 117 boolean incremental; |
| 118 |
| 119 // To read from an existing file handle, set this to a valid |
| 120 // <code>readerId</code> value that was returned from a previous |
| 121 // $(ref:readLogSource) call. The reader must previously have been created |
| 122 // for the same value of <code>source</code>. If no <code>readerId</code> is |
| 123 // provided, $(ref:readLogSource) will attempt to open a new log source |
| 124 // reader handle. |
| 125 long? readerId; |
| 126 }; |
| 127 |
| 128 // Result returned from a $(ref:readLogSource) call. |
| 129 dictionary ReadLogSourceResult { |
| 130 // The ID of the log source reader that was created to read from the log |
| 131 // source. If the reader was destroyed at the end of a read by passing in |
| 132 // <code>incremental=false</code>, this is always set to 0. If the call was |
| 133 // to use an existing reader with an existing ID, this will be set to the |
| 134 // same <code>readerId</code> that was passed into $(ref:readLogSource). |
| 135 long readerId; |
| 136 |
| 137 // Each DOMString in this array represents one line of logging that was |
| 138 // fetched from the log source. |
| 139 DOMString[] logLines; |
| 140 }; |
| 141 |
| 98 callback GetUserEmailCallback = void(DOMString email); | 142 callback GetUserEmailCallback = void(DOMString email); |
| 99 callback GetSystemInformationCallback = | 143 callback GetSystemInformationCallback = |
| 100 void(SystemInformation[] systemInformation); | 144 void(SystemInformation[] systemInformation); |
| 101 callback SendFeedbackCallback = void(Status status); | 145 callback SendFeedbackCallback = void(Status status); |
| 102 callback GetStringsCallback = void(object result); | 146 callback GetStringsCallback = void(object result); |
| 147 callback ReadLogSourceCallback = void (ReadLogSourceResult result); |
| 103 | 148 |
| 104 interface Functions { | 149 interface Functions { |
| 105 // Returns the email of the currently active or logged in user. | 150 // Returns the email of the currently active or logged in user. |
| 106 static void getUserEmail(GetUserEmailCallback callback); | 151 static void getUserEmail(GetUserEmailCallback callback); |
| 107 | 152 |
| 108 // Returns the system information dictionary. | 153 // Returns the system information dictionary. |
| 109 static void getSystemInformation(GetSystemInformationCallback callback); | 154 static void getSystemInformation(GetSystemInformationCallback callback); |
| 110 | 155 |
| 111 // Sends a feedback report. | 156 // Sends a feedback report. |
| 112 static void sendFeedback(FeedbackInfo feedback, | 157 static void sendFeedback(FeedbackInfo feedback, |
| 113 SendFeedbackCallback callback); | 158 SendFeedbackCallback callback); |
| 114 | 159 |
| 115 // Gets localized translated strings for feedback. It returns the | 160 // Gets localized translated strings for feedback. It returns the |
| 116 // strings as a dictionary mapping from string identifier to the | 161 // strings as a dictionary mapping from string identifier to the |
| 117 // translated string to use in the feedback app UI. | 162 // translated string to use in the feedback app UI. |
| 118 static void getStrings(FeedbackFlow flow, GetStringsCallback callback); | 163 static void getStrings(FeedbackFlow flow, GetStringsCallback callback); |
| 119 | 164 |
| 120 // Logs whether the user accepted a prompt to try the Software Removal | 165 // Logs whether the user accepted a prompt to try the Software Removal |
| 121 // Tool. | 166 // Tool. |
| 122 static void logSrtPromptResult(SrtPromptResult result); | 167 static void logSrtPromptResult(SrtPromptResult result); |
| 168 |
| 169 // Reads from a log source indicated by <code>source</code>. |
| 170 // <p>If <code>incremental</code> is false: |
| 171 // <ul> |
| 172 // <li>Returns the entire contents of the log file.</li> |
| 173 // <li>Returns <code>readerId</code> value of 0 to callback.</li> |
| 174 // </ul> |
| 175 // If <code>incremental</code> is true, and no <code>readerId</code> is |
| 176 // provided: |
| 177 // <ul> |
| 178 // <li>Returns the entire contents of the log file.</li> |
| 179 // <li>Starts tracking the file read handle, which is returned as a |
| 180 // nonzero <code>readerId</code> value in the callback. |
| 181 // </li> |
| 182 // <li>If can't create a new file handle, returns <code>readerId</code> |
| 183 // value of 0 in the callback. |
| 184 // </li> |
| 185 // </ul> |
| 186 // If <code>incremental</code> is true, and a valid non-zero |
| 187 // <code>readerId</code> is provided: |
| 188 // <ul> |
| 189 // <li>Returns new lines written to the file since the last time this |
| 190 // function was called for the same file and <code>readerId</code>. |
| 191 // </li> |
| 192 // <li>Returns the same <code>readerId</code> value to the callback.</li> |
| 193 // </ul> |
| 194 static void readLogSource(ReadLogSourceParams params, |
| 195 ReadLogSourceCallback callback); |
| 123 }; | 196 }; |
| 124 | 197 |
| 125 interface Events { | 198 interface Events { |
| 126 // Fired when the a user requests the launch of the feedback UI. We're | 199 // Fired when the a user requests the launch of the feedback UI. We're |
| 127 // using an event for this versus using the override API since we want | 200 // using an event for this versus using the override API since we want |
| 128 // to be invoked, but not showing a UI, so the feedback extension can | 201 // to be invoked, but not showing a UI, so the feedback extension can |
| 129 // take a screenshot of the user's desktop. | 202 // take a screenshot of the user's desktop. |
| 130 static void onFeedbackRequested(FeedbackInfo feedback); | 203 static void onFeedbackRequested(FeedbackInfo feedback); |
| 131 }; | 204 }; |
| 132 }; | 205 }; |
| OLD | NEW |