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

Side by Side Diff: chrome/browser/resources/feedback.js

Issue 12737006: Allow feedback form to be shown in an App Launcher feedback mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: First round of feedback Created 7 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // Constants. 5 // Constants.
6 /** @const */ var FEEDBACK_LANDING_PAGE = 6 /** @const */ var FEEDBACK_LANDING_PAGE =
7 'https://www.google.com/support/chrome/go/feedback_confirmation'; 7 'https://www.google.com/support/chrome/go/feedback_confirmation';
8 /** @const */ var MAX_ATTACH_FILE_SIZE = 3 * 1024 * 1024; 8 /** @const */ var MAX_ATTACH_FILE_SIZE = 3 * 1024 * 1024;
9 9
10 var selectedThumbnailDivId = ''; 10 var selectedThumbnailDivId = '';
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 innerDiv.appendChild(thumbnail); 88 innerDiv.appendChild(thumbnail);
89 89
90 thumbnailDiv.appendChild(innerDiv); 90 thumbnailDiv.appendChild(innerDiv);
91 $(divId).appendChild(thumbnailDiv); 91 $(divId).appendChild(thumbnailDiv);
92 92
93 if (!selectedThumbnailId) 93 if (!selectedThumbnailId)
94 selectImage(divId, thumbnailDiv.id); 94 selectImage(divId, thumbnailDiv.id);
95 } 95 }
96 96
97 /** 97 /**
98 * Disables screenshots completely. 98 * Shows the app launcher version of the feedback form.
99 */
100 function showLauncherFeedback() {
101 $('page-url').hidden = true;
Dan Beam 2013/03/15 15:29:51 nit: if you want, you can make a class called .lau
rkc 2013/03/15 16:58:40 I'd strongly recommend that we go with the approac
benwells 2013/03/18 05:21:19 Done. Note I didn't roll the disabled / enabled sc
102 $('screenshot-row').hidden = true;
103 $('title').hidden = true;
104 $('description').hidden = true;
105 $('launcher-title').hidden = false;
106 $('launcher-description').hidden = false;
107 }
108
109 /**
110 * Enables screenshots.
99 */ 111 */
100 function enableScreenshots() { 112 function enableScreenshots() {
101 if (forceDisableScreenshots) 113 if (forceDisableScreenshots)
102 return; 114 return;
103 $('screenshot-row').hidden = false; 115 $('screenshot-row').hidden = false;
104 } 116 }
105 117
106 /** 118 /**
107 * Reads the selected file when the user selects a file. 119 * Reads the selected file when the user selects a file.
108 * @param {event} evtFileSelected The on changed event for the file input box. 120 * @param {event} evtFileSelected The on changed event for the file input box.
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 function setupDialogDefaults(defaults) { 403 function setupDialogDefaults(defaults) {
392 // Current url. 404 // Current url.
393 if ($('page-url-text').value == '') 405 if ($('page-url-text').value == '')
394 $('page-url-text').value = defaults.currentUrl; 406 $('page-url-text').value = defaults.currentUrl;
395 if (defaults.currentUrl == '') 407 if (defaults.currentUrl == '')
396 $('page-url-checkbox').checked = false; 408 $('page-url-checkbox').checked = false;
397 // User e-mail. 409 // User e-mail.
398 $('user-email-text').value = defaults.userEmail; 410 $('user-email-text').value = defaults.userEmail;
399 $('user-email-checkbox').checked = defaults.emailCheckboxDefault; 411 $('user-email-checkbox').checked = defaults.emailCheckboxDefault;
400 412
401 // Are screenshots disabled? 413 if (defaults.launcherFeedback)
402 if (!defaults.disableScreenshots) 414 showLauncherFeedback();
415 else if (!defaults.disableScreenshots)
403 enableScreenshots(); 416 enableScreenshots();
404 417
405 if (defaults.useSaved) { 418 if (defaults.useSaved) {
406 $('screenshot-link-tosaved').hidden = false; 419 $('screenshot-link-tosaved').hidden = false;
407 } 420 }
408 } 421 }
409 422
410 window.addEventListener('DOMContentLoaded', load); 423 window.addEventListener('DOMContentLoaded', load);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698