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 3 // found in the LICENSE file. 4 5 /** 6 * Setup handlers for the minimize and close topbar buttons. 7 */ 8 function initializeHandlers() { 9 $('minimize-button').addEventListener('click', function(e) { 10 e.preventDefault(); 11 chrome.app.window.current().minimize(); 12 }); 13 14 $('minimize-button').addEventListener('mousedown', function(e) { 15 e.preventDefault(); 16 }); 17 18 $('close-button').addEventListener('click', function() { 19 window.close(); 20 }); 21 22 $('close-button').addEventListener('mousedown', function(e) { 23 e.preventDefault(); 24 }); 25 } 26 27 window.addEventListener('DOMContentLoaded', initializeHandlers); 28