diff options
-rw-r--r-- | chrome/browser/resources/feedback/js/event_handler.js | 5 | ||||
-rw-r--r-- | chrome/browser/resources/feedback/js/feedback.js | 21 |
2 files changed, 20 insertions, 6 deletions
diff --git a/chrome/browser/resources/feedback/js/event_handler.js b/chrome/browser/resources/feedback/js/event_handler.js index 8b15a47..74c1955 100644 --- a/chrome/browser/resources/feedback/js/event_handler.js +++ b/chrome/browser/resources/feedback/js/event_handler.js @@ -12,11 +12,6 @@ var FEEDBACK_WIDTH = 500; * @const */ var FEEDBACK_HEIGHT = 625; -/** - * @type {number} - * @const - */ -var TRACING_CHECKBOX_HEIGHT = 29; var initialFeedbackInfo = null; diff --git a/chrome/browser/resources/feedback/js/feedback.js b/chrome/browser/resources/feedback/js/feedback.js index 2726150..1edda2d 100644 --- a/chrome/browser/resources/feedback/js/feedback.js +++ b/chrome/browser/resources/feedback/js/feedback.js @@ -12,6 +12,17 @@ var FEEDBACK_LANDING_PAGE = */ var MAX_ATTACH_FILE_SIZE = 3 * 1024 * 1024; +/** + * @type {number} + * @const + */ +var FEEDBACK_MIN_WIDTH = 500; +/** + * @type {number} + * @const + */ +var FEEDBACK_MIN_HEIGHT = 625; + /** @type {number} * @const */ @@ -218,11 +229,17 @@ function performanceFeedbackChanged() { function resizeAppWindow() { // We pick the width from the titlebar, which has no margins. var width = $('title-bar').scrollWidth; + if (width < FEEDBACK_MIN_WIDTH) + width = FEEDBACK_MIN_WIDTH; + // We get the height by adding the titlebar height and the content height + // margins. We can't get the margins for the content-pane here by using // style.margin - the variable seems to not exist. var height = $('title-bar').scrollHeight + $('content-pane').scrollHeight + CONTENT_MARGIN_HEIGHT; + if (height < FEEDBACK_MIN_HEIGHT) + height = FEEDBACK_MIN_HEIGHT; + chrome.app.window.current().resizeTo(width, height); } @@ -257,7 +274,9 @@ function initialize() { // We've taken our screenshot, show the feedback page without any // further delay. - resizeAppWindow(); + window.webkitRequestAnimationFrame(function() { + resizeAppWindow(); + }); chrome.app.window.current().show(); var screenshotDataUrl = screenshotCanvas.toDataURL('image/png'); |