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 /** | 5 /** |
6 * Returns a function that throws a 'not available' exception when called. | 6 * Returns a function that throws a 'not available' exception when called. |
7 * | 7 * |
8 * @param {string} messagePrefix text to prepend to the exception message. | 8 * @param {string} messagePrefix text to prepend to the exception message. |
9 */ | 9 */ |
10 function generateDisabledMethodStub(messagePrefix, opt_messageSuffix) { | 10 function generateDisabledMethodStub(messagePrefix, opt_messageSuffix) { |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 'onbeforeunload', generateDisabledMethodStub('onbeforeunload')); | 109 'onbeforeunload', generateDisabledMethodStub('onbeforeunload')); |
110 Window.prototype.__defineSetter__( | 110 Window.prototype.__defineSetter__( |
111 'onunload', generateDisabledMethodStub('onunload')); | 111 'onunload', generateDisabledMethodStub('onunload')); |
112 var windowAddEventListener = Window.prototype.addEventListener; | 112 var windowAddEventListener = Window.prototype.addEventListener; |
113 Window.prototype.addEventListener = function(type) { | 113 Window.prototype.addEventListener = function(type) { |
114 if (type === 'unload' || type === 'beforeunload') | 114 if (type === 'unload' || type === 'beforeunload') |
115 generateDisabledMethodStub(type)(); | 115 generateDisabledMethodStub(type)(); |
116 else | 116 else |
117 return windowAddEventListener.apply(window, arguments); | 117 return windowAddEventListener.apply(window, arguments); |
118 }; | 118 }; |
| 119 |
| 120 window._setHasTitlebarInternal = function(hasTitlebar) { |
| 121 require('injectAppTitlebar').setHasTitlebar(hasTitlebar); |
| 122 } |
OLD | NEW |