Chromium Code Reviews| 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 // /var/log/messages | |
|
tbarzic
2017/06/01 19:23:46
Chrome OS system messages.
Simon Que
2017/06/01 21:49:10
Done.
| |
| 101 messages, | |
| 102 | |
| 103 // /var/log/ui/ui.LATEST | |
|
tbarzic
2017/06/01 19:23:46
Latest Chrome OS UI logs.
Simon Que
2017/06/01 21:49:10
Done.
| |
| 104 ui_latest | |
|
tbarzic
2017/06/01 19:23:47
uiLatest
or latestUi
Simon Que
2017/06/01 21:49:10
Done.
| |
| 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 readLogSource() is called, the file read will | |
| 114 // continue where it left off. readLogSource() can be called with | |
|
tbarzic
2017/06/01 19:23:47
s/readLogSource()/$(ref:readLogSource)/
Simon Que
2017/06/01 21:49:10
Done.
| |
| 115 // incremental=true repeatedly. To subsequently close the file handle, pass | |
|
tbarzic
2017/06/01 19:23:47
<code>incremental = true</code>
Simon Que
2017/06/01 21:49:10
Done.
| |
| 116 // in incremental=false. | |
| 117 boolean incremental; | |
| 118 | |
| 119 // To read from an existing file handle, set this to a valid readerId value | |
| 120 // that was returned from a previous readLogSource() call. The file handle | |
| 121 // must previously have been created for the same |source|. If no readerId | |
| 122 // is provided, readLogSource will attempt to open a new log source reader | |
| 123 // handle. | |
| 124 long? readerId; | |
| 125 }; | |
| 126 | |
| 98 callback GetUserEmailCallback = void(DOMString email); | 127 callback GetUserEmailCallback = void(DOMString email); |
| 99 callback GetSystemInformationCallback = | 128 callback GetSystemInformationCallback = |
| 100 void(SystemInformation[] systemInformation); | 129 void(SystemInformation[] systemInformation); |
| 101 callback SendFeedbackCallback = void(Status status); | 130 callback SendFeedbackCallback = void(Status status); |
| 102 callback GetStringsCallback = void(object result); | 131 callback GetStringsCallback = void(object result); |
| 132 callback ReadLogSourceCallback = void (long readerId, DOMString[] logLines); | |
|
tbarzic
2017/06/01 19:23:46
I'd consider returning result as object
{
option
Simon Que
2017/06/01 21:49:10
How do I define the object format in the IDL, if a
tbarzic
2017/06/01 21:57:23
Same as for ReadLogSourceParams
Simon Que
2017/06/02 22:54:32
Done.
| |
| 103 | 133 |
| 104 interface Functions { | 134 interface Functions { |
| 105 // Returns the email of the currently active or logged in user. | 135 // Returns the email of the currently active or logged in user. |
| 106 static void getUserEmail(GetUserEmailCallback callback); | 136 static void getUserEmail(GetUserEmailCallback callback); |
| 107 | 137 |
| 108 // Returns the system information dictionary. | 138 // Returns the system information dictionary. |
| 109 static void getSystemInformation(GetSystemInformationCallback callback); | 139 static void getSystemInformation(GetSystemInformationCallback callback); |
| 110 | 140 |
| 111 // Sends a feedback report. | 141 // Sends a feedback report. |
| 112 static void sendFeedback(FeedbackInfo feedback, | 142 static void sendFeedback(FeedbackInfo feedback, |
| 113 SendFeedbackCallback callback); | 143 SendFeedbackCallback callback); |
| 114 | 144 |
| 115 // Gets localized translated strings for feedback. It returns the | 145 // Gets localized translated strings for feedback. It returns the |
| 116 // strings as a dictionary mapping from string identifier to the | 146 // strings as a dictionary mapping from string identifier to the |
| 117 // translated string to use in the feedback app UI. | 147 // translated string to use in the feedback app UI. |
| 118 static void getStrings(FeedbackFlow flow, GetStringsCallback callback); | 148 static void getStrings(FeedbackFlow flow, GetStringsCallback callback); |
| 119 | 149 |
| 120 // Logs whether the user accepted a prompt to try the Software Removal | 150 // Logs whether the user accepted a prompt to try the Software Removal |
| 121 // Tool. | 151 // Tool. |
| 122 static void logSrtPromptResult(SrtPromptResult result); | 152 static void logSrtPromptResult(SrtPromptResult result); |
| 153 | |
| 154 // Reads from a log source indicated by |source|. | |
| 155 // | |
| 156 // If |incremental| is false: | |
| 157 // - Returns the entire contents of the log file. | |
|
tbarzic
2017/06/01 19:23:47
put lists in <ul></ul>
(so docs render better, y
Simon Que
2017/06/01 21:49:10
Done.
| |
| 158 // - Returns |readerId| value of 0 to callback. | |
| 159 // If |incremental| is true, and no |readerId| is provided: | |
| 160 // - Returns the entire contents of the log file. | |
| 161 // - Starts tracking the file read handle, which is returned as a nonzero | |
| 162 // |readerId| value in the callback. | |
| 163 // - If can't create a new file handle, returns |readerId| value of 0 in the | |
| 164 // callback. | |
| 165 // If |incremental| is true, and a valid non-zero |readerId| is provided: | |
|
tbarzic
2017/06/01 19:23:47
<code></code> where you use ||
Simon Que
2017/06/01 21:49:10
Done.
| |
| 166 // - Returns new lines written to the file since the last time this function | |
| 167 // was called for the same file and readerId. | |
| 168 // - Returns the same |readerId| value to the callback. | |
| 169 static void readLogSource(ReadLogSourceParams params, | |
| 170 ReadLogSourceCallback callback); | |
| 123 }; | 171 }; |
| 124 | 172 |
| 125 interface Events { | 173 interface Events { |
| 126 // Fired when the a user requests the launch of the feedback UI. We're | 174 // 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 | 175 // 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 | 176 // to be invoked, but not showing a UI, so the feedback extension can |
| 129 // take a screenshot of the user's desktop. | 177 // take a screenshot of the user's desktop. |
| 130 static void onFeedbackRequested(FeedbackInfo feedback); | 178 static void onFeedbackRequested(FeedbackInfo feedback); |
| 131 }; | 179 }; |
| 132 }; | 180 }; |
| OLD | NEW |