| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 // This file adheres to closure-compiler conventions in order to enable | 5 // This file adheres to closure-compiler conventions in order to enable |
| 6 // compilation with ADVANCED_OPTIMIZATIONS. In particular, members that are to | 6 // compilation with ADVANCED_OPTIMIZATIONS. In particular, members that are to |
| 7 // be accessed externally should be specified in this['style'] as opposed to | 7 // be accessed externally should be specified in this['style'] as opposed to |
| 8 // this.style because member identifiers are minified by default. | 8 // this.style because member identifiers are minified by default. |
| 9 // See http://goo.gl/FwOgy | 9 // See http://goo.gl/FwOgy |
| 10 | 10 |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 | 356 |
| 357 var metaTags = document.getElementsByTagName('meta'); | 357 var metaTags = document.getElementsByTagName('meta'); |
| 358 for (var i = 0; i < metaTags.length; ++i) { | 358 for (var i = 0; i < metaTags.length; ++i) { |
| 359 if (metaTags[i].name.toLowerCase() == 'referrer') { | 359 if (metaTags[i].name.toLowerCase() == 'referrer') { |
| 360 return metaTags[i].content.toLowerCase(); | 360 return metaTags[i].content.toLowerCase(); |
| 361 } | 361 } |
| 362 } | 362 } |
| 363 return 'default'; | 363 return 'default'; |
| 364 }; | 364 }; |
| 365 | 365 |
| 366 // Provides a way for other injected javascript to access the page's referrer | |
| 367 // policy. | |
| 368 __gCrWeb['getPageReferrerPolicy'] = function() { | |
| 369 return getReferrerPolicy_(); | |
| 370 }; | |
| 371 | |
| 372 // Various aspects of global DOM behavior are overridden here. | 366 // Various aspects of global DOM behavior are overridden here. |
| 373 | 367 |
| 374 // A popstate event needs to be fired anytime the active history entry | 368 // A popstate event needs to be fired anytime the active history entry |
| 375 // changes without an associated document change. Either via back, forward, go | 369 // changes without an associated document change. Either via back, forward, go |
| 376 // navigation or by loading the URL, clicking on a link, etc. | 370 // navigation or by loading the URL, clicking on a link, etc. |
| 377 __gCrWeb['dispatchPopstateEvent'] = function(stateObject) { | 371 __gCrWeb['dispatchPopstateEvent'] = function(stateObject) { |
| 378 var popstateEvent = window.document.createEvent('HTMLEvents'); | 372 var popstateEvent = window.document.createEvent('HTMLEvents'); |
| 379 popstateEvent.initEvent('popstate', true, false); | 373 popstateEvent.initEvent('popstate', true, false); |
| 380 if (stateObject) | 374 if (stateObject) |
| 381 popstateEvent.state = JSON.parse(stateObject); | 375 popstateEvent.state = JSON.parse(stateObject); |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 'command': 'document.submit', | 566 'command': 'document.submit', |
| 573 'formName': __gCrWeb.common.getFormIdentifier(evt.srcElement), | 567 'formName': __gCrWeb.common.getFormIdentifier(evt.srcElement), |
| 574 'href': __gCrWeb['getFullyQualifiedURL'](action), | 568 'href': __gCrWeb['getFullyQualifiedURL'](action), |
| 575 'targetsFrame': targetsFrame | 569 'targetsFrame': targetsFrame |
| 576 }); | 570 }); |
| 577 }, false); | 571 }, false); |
| 578 | 572 |
| 579 addFormEventListeners_(); | 573 addFormEventListeners_(); |
| 580 | 574 |
| 581 }()); // End of anonymous object | 575 }()); // End of anonymous object |
| OLD | NEW |