| OLD | NEW |
| 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 OptionsPage = options.OptionsPage; | 6 /** @const */ var OptionsPage = options.OptionsPage; |
| 7 | 7 |
| 8 ////////////////////////////////////////////////////////////////////////////// | 8 ////////////////////////////////////////////////////////////////////////////// |
| 9 // ContentSettings class: | 9 // ContentSettings class: |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 var exceptionsButtons = | 30 var exceptionsButtons = |
| 31 this.pageDiv.querySelectorAll('.exceptions-list-button'); | 31 this.pageDiv.querySelectorAll('.exceptions-list-button'); |
| 32 for (var i = 0; i < exceptionsButtons.length; i++) { | 32 for (var i = 0; i < exceptionsButtons.length; i++) { |
| 33 exceptionsButtons[i].onclick = function(event) { | 33 exceptionsButtons[i].onclick = function(event) { |
| 34 var page = ContentSettingsExceptionsArea.getInstance(); | 34 var page = ContentSettingsExceptionsArea.getInstance(); |
| 35 | 35 |
| 36 // Add on the proper hash for the content type, and store that in the | 36 // Add on the proper hash for the content type, and store that in the |
| 37 // history so back/forward and tab restore works. | 37 // history so back/forward and tab restore works. |
| 38 var hash = event.currentTarget.getAttribute('contentType'); | 38 var hash = event.currentTarget.getAttribute('contentType'); |
| 39 var url = page.name + '#' + hash; | 39 var url = page.name + '#' + hash; |
| 40 window.history.pushState({pageName: page.name}, | 40 uber.pushState({pageName: page.name}, url); |
| 41 page.title, | |
| 42 '/' + url); | |
| 43 | 41 |
| 44 // Navigate after the history has been replaced in order to have the | 42 // Navigate after the local history has been replaced in order to have |
| 45 // correct hash loaded. | 43 // the correct hash loaded. |
| 46 OptionsPage.showPageByName('contentExceptions', false); | 44 OptionsPage.showPageByName('contentExceptions', false); |
| 47 | |
| 48 uber.invokeMethodOnParent('setPath', {path: url}); | |
| 49 uber.invokeMethodOnParent('setTitle', | |
| 50 {title: loadTimeData.getString(hash + 'TabTitle')}); | |
| 51 }; | 45 }; |
| 52 } | 46 } |
| 53 | 47 |
| 54 var manageHandlersButton = $('manage-handlers-button'); | 48 var manageHandlersButton = $('manage-handlers-button'); |
| 55 if (manageHandlersButton) { | 49 if (manageHandlersButton) { |
| 56 manageHandlersButton.onclick = function(event) { | 50 manageHandlersButton.onclick = function(event) { |
| 57 OptionsPage.navigateToPage('handlers'); | 51 OptionsPage.navigateToPage('handlers'); |
| 58 }; | 52 }; |
| 59 } | 53 } |
| 60 | 54 |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 var deviceSelect = $('media-select-camera'); | 294 var deviceSelect = $('media-select-camera'); |
| 301 chrome.send('setDefaultCaptureDevice', ['camera', deviceSelect.value]); | 295 chrome.send('setDefaultCaptureDevice', ['camera', deviceSelect.value]); |
| 302 }; | 296 }; |
| 303 | 297 |
| 304 // Export | 298 // Export |
| 305 return { | 299 return { |
| 306 ContentSettings: ContentSettings | 300 ContentSettings: ContentSettings |
| 307 }; | 301 }; |
| 308 | 302 |
| 309 }); | 303 }); |
| OLD | NEW |