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 /** @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 // We've taken our screenshot, show the feedback page without any | |
| 240 // further delay. | |
| 241 resizeAppWindow(); | |
| 242 chrome.app.window.current().show(); | |
|
xiyuan
2013/11/12 23:03:22
Should this be moved out of the takeScreenshot cal
rkc
2013/11/12 23:11:04
We can't. The screenshot must be taken before the
xiyuan
2013/11/12 23:16:30
I see.
| |
| 243 | |
| 244 var screenshotDataUrl = screenshotCanvas.toDataURL('image/png'); | |
| 239 $('screenshot-image').src = screenshotDataUrl; | 245 $('screenshot-image').src = screenshotDataUrl; |
| 240 feedbackInfo.screenshot = dataUrlToBlob(screenshotDataUrl); | 246 feedbackInfo.screenshot = dataUrlToBlob(screenshotDataUrl); |
| 247 | |
| 241 // TODO(rkc): Remove logging once crbug.com/284662 is closed. | 248 // TODO(rkc): Remove logging once crbug.com/284662 is closed. |
| 242 console.log('FEEDBACK_DEBUG: Taken screenshot. Showing window.'); | 249 console.log('FEEDBACK_DEBUG: Taken screenshot. Showing window.'); |
|
xiyuan
2013/11/12 23:03:22
nit: Remove 'Showing window' from the message sinc
rkc
2013/11/12 23:11:04
Already did in patchset #2 :)
Done.
| |
| 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 |