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 /** @type {string} | 5 /** @type {string} |
6 * @const | 6 * @const |
7 */ | 7 */ |
8 var FEEDBACK_LANDING_PAGE = | 8 var FEEDBACK_LANDING_PAGE = |
9 'https://www.google.com/support/chrome/go/feedback_confirmation'; | 9 'https://www.google.com/support/chrome/go/feedback_confirmation'; |
10 /** @type {number} | 10 /** @type {number} |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 // Add listener to receive the feedback info object. | 228 // Add listener to receive the feedback info object. |
229 chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) { | 229 chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) { |
230 if (request.sentFromEventPage) { | 230 if (request.sentFromEventPage) { |
231 // TODO(rkc): Remove logging once crbug.com/284662 is closed. | 231 // TODO(rkc): Remove logging once crbug.com/284662 is closed. |
232 console.log('FEEDBACK_DEBUG: Received feedbackInfo.'); | 232 console.log('FEEDBACK_DEBUG: Received feedbackInfo.'); |
233 feedbackInfo = request.data; | 233 feedbackInfo = request.data; |
234 $('description-text').textContent = feedbackInfo.description; | 234 $('description-text').textContent = feedbackInfo.description; |
235 if (feedbackInfo.pageUrl) | 235 if (feedbackInfo.pageUrl) |
236 $('page-url-text').value = feedbackInfo.pageUrl; | 236 $('page-url-text').value = feedbackInfo.pageUrl; |
237 | 237 |
238 takeScreenshot(function(screenshotDataUrl) { | 238 takeScreenshot(function(screenshotCanvas) { |
| 239 // TODO(rkc): Remove logging once crbug.com/284662 is closed. |
| 240 console.log('FEEDBACK_DEBUG: Taken screenshot. Showing window.'); |
| 241 |
| 242 // We've taken our screenshot, show the feedback page without any |
| 243 // further delay. |
| 244 resizeAppWindow(); |
| 245 chrome.app.window.current().show(); |
| 246 |
| 247 var screenshotDataUrl = screenshotCanvas.toDataURL('image/png'); |
239 $('screenshot-image').src = screenshotDataUrl; | 248 $('screenshot-image').src = screenshotDataUrl; |
240 feedbackInfo.screenshot = dataUrlToBlob(screenshotDataUrl); | 249 feedbackInfo.screenshot = dataUrlToBlob(screenshotDataUrl); |
241 // TODO(rkc): Remove logging once crbug.com/284662 is closed. | |
242 console.log('FEEDBACK_DEBUG: Taken screenshot. Showing window.'); | |
243 resizeAppWindow(); | |
244 chrome.app.window.current().show(); | |
245 }); | 250 }); |
246 | 251 |
247 chrome.feedbackPrivate.getUserEmail(function(email) { | 252 chrome.feedbackPrivate.getUserEmail(function(email) { |
248 $('user-email-text').value = email; | 253 $('user-email-text').value = email; |
249 }); | 254 }); |
250 | 255 |
251 chrome.feedbackPrivate.getSystemInformation(function(sysInfo) { | 256 chrome.feedbackPrivate.getSystemInformation(function(sysInfo) { |
252 systemInfo = sysInfo; | 257 systemInfo = sysInfo; |
253 }); | 258 }); |
254 | 259 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 if (windowId == systemInfoWindowId) | 302 if (windowId == systemInfoWindowId) |
298 systemInfoWindowId = 0; | 303 systemInfoWindowId = 0; |
299 }); | 304 }); |
300 if ($('sysinfo-url')) { | 305 if ($('sysinfo-url')) { |
301 $('sysinfo-url').onclick = openSystemInfoWindow; | 306 $('sysinfo-url').onclick = openSystemInfoWindow; |
302 } | 307 } |
303 }); | 308 }); |
304 } | 309 } |
305 | 310 |
306 initialize(); | 311 initialize(); |
OLD | NEW |