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

Unified Diff: chrome/browser/resources/file_manager/js/file_manager.js

Issue 15121002: Merge 199387 "Add window buttons (close and maximize) to the Fil..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1500/src/
Patch Set: Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/file_manager/js/file_manager.js
===================================================================
--- chrome/browser/resources/file_manager/js/file_manager.js (revision 199674)
+++ chrome/browser/resources/file_manager/js/file_manager.js (working copy)
@@ -566,18 +566,10 @@
if (util.platform.newUI() && this.dialogType == DialogType.FULL_PAGE) {
var maximizeButton = this.dialogDom_.querySelector('#maximize-button');
- maximizeButton.addEventListener('click', function() {
- var appWindow = chrome.app.window.current();
- if (appWindow.isMaximized())
- appWindow.restore();
- else
- appWindow.maximize();
- });
+ maximizeButton.addEventListener('click', this.onMaximize.bind(this));
var closeButton = this.dialogDom_.querySelector('#close-button');
- closeButton.addEventListener('click', function() {
- window.close();
- });
+ closeButton.addEventListener('click', this.onClose.bind(this));
}
this.syncButton.checkable = true;
@@ -588,6 +580,18 @@
}
};
+ FileManager.prototype.onMaximize = function() {
+ var appWindow = chrome.app.window.current();
+ if (appWindow.isMaximized())
+ appWindow.restore();
+ else
+ appWindow.maximize();
+ };
+
+ FileManager.prototype.onClose = function() {
+ window.close();
+ };
+
/**
* One-time initialization of commands.
* @private
« no previous file with comments | « chrome/browser/resources/file_manager/css/gallery.css ('k') | chrome/browser/resources/file_manager/js/file_tasks.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698