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

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

Issue 423583003: Fix TypeError when closing overlay (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | « no previous file | 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) 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 cr.define('options', function() { 5 cr.define('options', function() {
6 /** @const */ var FocusOutlineManager = cr.ui.FocusOutlineManager; 6 /** @const */ var FocusOutlineManager = cr.ui.FocusOutlineManager;
7 7
8 ///////////////////////////////////////////////////////////////////////////// 8 /////////////////////////////////////////////////////////////////////////////
9 // OptionsPage class: 9 // OptionsPage class:
10 10
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 } 348 }
349 }; 349 };
350 350
351 /** 351 /**
352 * Cancels (closes) the overlay, due to the user pressing <Esc>. 352 * Cancels (closes) the overlay, due to the user pressing <Esc>.
353 */ 353 */
354 OptionsPage.cancelOverlay = function() { 354 OptionsPage.cancelOverlay = function() {
355 // Blur the active element to ensure any changed pref value is saved. 355 // Blur the active element to ensure any changed pref value is saved.
356 document.activeElement.blur(); 356 document.activeElement.blur();
357 var overlay = this.getVisibleOverlay_(); 357 var overlay = this.getVisibleOverlay_();
358 if (!overlay)
359 return;
358 // Let the overlay handle the <Esc> if it wants to. 360 // Let the overlay handle the <Esc> if it wants to.
359 if (overlay.handleCancel) { 361 if (overlay.handleCancel) {
360 overlay.handleCancel(); 362 overlay.handleCancel();
361 this.restoreLastFocusedElement_(); 363 this.restoreLastFocusedElement_();
362 } else { 364 } else {
363 this.closeOverlay(); 365 this.closeOverlay();
364 } 366 }
365 }; 367 };
366 368
367 /** 369 /**
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
1015 canShowPage: function() { 1017 canShowPage: function() {
1016 return true; 1018 return true;
1017 }, 1019 },
1018 }; 1020 };
1019 1021
1020 // Export 1022 // Export
1021 return { 1023 return {
1022 OptionsPage: OptionsPage 1024 OptionsPage: OptionsPage
1023 }; 1025 };
1024 }); 1026 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698