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

Side by Side Diff: chrome/browser/resources/options/options_page.js

Issue 6973031: Options: Notify overlays that they will be closed if the options tab is closed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/resources/options/options.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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 cr.define('options', function() { 5 cr.define('options', function() {
6 ///////////////////////////////////////////////////////////////////////////// 6 /////////////////////////////////////////////////////////////////////////////
7 // OptionsPage class: 7 // OptionsPage class:
8 8
9 /** 9 /**
10 * Base class for options page. 10 * Base class for options page.
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 if (this.isOverlayVisible_() && 453 if (this.isOverlayVisible_() &&
454 !this.registeredOverlayPages[data.pageName.toLowerCase()]) { 454 !this.registeredOverlayPages[data.pageName.toLowerCase()]) {
455 this.hideOverlay_(); 455 this.hideOverlay_();
456 } 456 }
457 457
458 this.showPageByName(data.pageName, false); 458 this.showPageByName(data.pageName, false);
459 } 459 }
460 }; 460 };
461 461
462 /** 462 /**
463 * Callback for window.onbeforeunload. Used to notify overlays that they will
464 * be closed.
465 */
466 OptionsPage.willClose = function() {
467 var overlay = this.getVisibleOverlay_();
468 if (overlay && overlay.didClosePage)
469 overlay.didClosePage();
470 };
471
472 /**
463 * Freezes/unfreezes the scroll position of given level's page container. 473 * Freezes/unfreezes the scroll position of given level's page container.
464 * @param {boolean} freeze Whether the page should be frozen. 474 * @param {boolean} freeze Whether the page should be frozen.
465 * @param {number} level The level to freeze/unfreeze. 475 * @param {number} level The level to freeze/unfreeze.
466 * @private 476 * @private
467 */ 477 */
468 OptionsPage.setPageFrozenAtLevel_ = function(freeze, level) { 478 OptionsPage.setPageFrozenAtLevel_ = function(freeze, level) {
469 var container = level == 0 ? $('toplevel-page-container') 479 var container = level == 0 ? $('toplevel-page-container')
470 : $('subpage-sheet-container-' + level); 480 : $('subpage-sheet-container-' + level);
471 481
472 if (container.classList.contains('frozen') == freeze) 482 if (container.classList.contains('frozen') == freeze)
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 shouldClose: function() { 999 shouldClose: function() {
990 return true; 1000 return true;
991 }, 1001 },
992 }; 1002 };
993 1003
994 // Export 1004 // Export
995 return { 1005 return {
996 OptionsPage: OptionsPage 1006 OptionsPage: OptionsPage
997 }; 1007 };
998 }); 1008 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/options/options.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698