Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(290)

Side by Side Diff: chrome/common/extensions/api/feedback_private.idl

Issue 2840103002: Add new API function: feedbackPrivate.readLogSource (Closed)
Patch Set: Refactor passing of params from API into Log Source Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 incremental=false.
tbarzic 2017/06/06 20:27:26 <code>incremental=false</code>
Simon Que 2017/06/06 22:29:15 Done.
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
tbarzic 2017/06/06 20:27:26 $(ref:readLogSoruce)
Simon Que 2017/06/06 22:29:15 Done.
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
127 // Result returned from a readLogSource() call.
128 dictionary ReadLogSourceResult {
129 // The ID of the log source reader that was created to read from the log
130 // source. If the reader was destroyed at the end of a read by passing in
131 // <code>incremental=false</false>, this is always set to 0. If the call was
tbarzic 2017/06/06 20:27:26 s/</false>/</code>
Simon Que 2017/06/06 22:29:15 Done.
132 // to use an existing reader with an existing ID, this will be set to the
133 // same <code>readerId</code> that was passed into readLogSource().
134 long readerId;
135
136 // Each DOMString in this array represents one line of logging that was
137 // fetched from the log source.
138 DOMString[] logLines;
139 };
140
98 callback GetUserEmailCallback = void(DOMString email); 141 callback GetUserEmailCallback = void(DOMString email);
99 callback GetSystemInformationCallback = 142 callback GetSystemInformationCallback =
100 void(SystemInformation[] systemInformation); 143 void(SystemInformation[] systemInformation);
101 callback SendFeedbackCallback = void(Status status); 144 callback SendFeedbackCallback = void(Status status);
102 callback GetStringsCallback = void(object result); 145 callback GetStringsCallback = void(object result);
146 callback ReadLogSourceCallback = void (ReadLogSourceResult result);
103 147
104 interface Functions { 148 interface Functions {
105 // Returns the email of the currently active or logged in user. 149 // Returns the email of the currently active or logged in user.
106 static void getUserEmail(GetUserEmailCallback callback); 150 static void getUserEmail(GetUserEmailCallback callback);
107 151
108 // Returns the system information dictionary. 152 // Returns the system information dictionary.
109 static void getSystemInformation(GetSystemInformationCallback callback); 153 static void getSystemInformation(GetSystemInformationCallback callback);
110 154
111 // Sends a feedback report. 155 // Sends a feedback report.
112 static void sendFeedback(FeedbackInfo feedback, 156 static void sendFeedback(FeedbackInfo feedback,
113 SendFeedbackCallback callback); 157 SendFeedbackCallback callback);
114 158
115 // Gets localized translated strings for feedback. It returns the 159 // Gets localized translated strings for feedback. It returns the
116 // strings as a dictionary mapping from string identifier to the 160 // strings as a dictionary mapping from string identifier to the
117 // translated string to use in the feedback app UI. 161 // translated string to use in the feedback app UI.
118 static void getStrings(FeedbackFlow flow, GetStringsCallback callback); 162 static void getStrings(FeedbackFlow flow, GetStringsCallback callback);
119 163
120 // Logs whether the user accepted a prompt to try the Software Removal 164 // Logs whether the user accepted a prompt to try the Software Removal
121 // Tool. 165 // Tool.
122 static void logSrtPromptResult(SrtPromptResult result); 166 static void logSrtPromptResult(SrtPromptResult result);
167
168 // Reads from a log source indicated by <code>source</code>.
169 // <br>If <code>incremental</code> is false:
tbarzic 2017/06/06 20:27:26 prefer <p></p> over <br>
Simon Que 2017/06/06 22:29:15 Done.
170 // <ul><li>Returns the entire contents of the log file.</li>
171 // <li>Returns <code>readerId</code> value of 0 to callback.</li></ul>
tbarzic 2017/06/06 20:27:26 can you format this so it's a bit more readable fr
Simon Que 2017/06/06 22:29:15 Done.
172 // If <code>incremental</code> is true, and no <code>readerId</code> is
173 // provided:
174 // <ul><li>Returns the entire contents of the log file.</li>
175 // <li>Starts tracking the file read handle, which is returned as a nonzero
176 // <code>readerId</code> value in the callback.</li>
177 // <li>If can't create a new file handle, returns <code>readerId</code>
178 // value of 0 in the callback.</li></ul>
179 // If <code>incremental</code> is true, and a valid non-zero
180 // <code>readerId</code> is provided:
181 // <ul><li>Returns new lines written to the file since the last time this
182 // function was called for the same file and readerId.</li>
183 // <li>Returns the same <code>readerId</code> value to the
184 // callback.</li></ul>
185 static void readLogSource(ReadLogSourceParams params,
186 ReadLogSourceCallback callback);
123 }; 187 };
124 188
125 interface Events { 189 interface Events {
126 // Fired when the a user requests the launch of the feedback UI. We're 190 // 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 191 // 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 192 // to be invoked, but not showing a UI, so the feedback extension can
129 // take a screenshot of the user's desktop. 193 // take a screenshot of the user's desktop.
130 static void onFeedbackRequested(FeedbackInfo feedback); 194 static void onFeedbackRequested(FeedbackInfo feedback);
131 }; 195 };
132 }; 196 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698