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

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

Issue 2826753002: Fix a bug of black area on window close (Closed)
Patch Set: Write handling in one function to reduce coupling factor Created 3 years, 8 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
« no previous file with comments | « chrome/browser/resources/feedback/js/feedback.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 /** 5 /**
6 * Setup handlers for the minimize and close topbar buttons. 6 * Setup handlers for the minimize and close topbar buttons.
7 */ 7 */
8 function initializeHandlers() { 8 function initializeHandlers() {
9 // If this dialog is using system window controls, these elements aren't 9 // If this dialog is using system window controls, these elements aren't
10 // needed at all. 10 // needed at all.
11 if (window.feedbackInfo.useSystemWindowFrame) { 11 if (window.feedbackInfo.useSystemWindowFrame) {
12 $('minimize-button').hidden = true; 12 $('minimize-button').hidden = true;
13 $('close-button').hidden = true; 13 $('close-button').hidden = true;
14 return; 14 return;
15 } 15 }
16 $('minimize-button').addEventListener('click', function(e) { 16 $('minimize-button').addEventListener('click', function(e) {
17 e.preventDefault(); 17 e.preventDefault();
18 chrome.app.window.current().minimize(); 18 chrome.app.window.current().minimize();
19 }); 19 });
20 20
21 $('minimize-button').addEventListener('mousedown', function(e) { 21 $('minimize-button').addEventListener('mousedown', function(e) {
22 e.preventDefault(); 22 e.preventDefault();
23 }); 23 });
24 24
25 $('close-button').addEventListener('click', function() { 25 $('close-button').addEventListener('click', function() {
26 window.close(); 26 scheduleWindowClose();
27 }); 27 });
28 28
29 $('close-button').addEventListener('mousedown', function(e) { 29 $('close-button').addEventListener('mousedown', function(e) {
30 e.preventDefault(); 30 e.preventDefault();
31 }); 31 });
32 } 32 }
33 33
34 window.addEventListener('DOMContentLoaded', initializeHandlers); 34 window.addEventListener('DOMContentLoaded', initializeHandlers);
OLDNEW
« no previous file with comments | « chrome/browser/resources/feedback/js/feedback.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698