| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 4 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). | 4 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). |
| 5 * Copyright (C) 2009 Joseph Pecoraro | 5 * Copyright (C) 2009 Joseph Pecoraro |
| 6 * | 6 * |
| 7 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
| 8 * modification, are permitted provided that the following conditions | 8 * modification, are permitted provided that the following conditions |
| 9 * are met: | 9 * are met: |
| 10 * | 10 * |
| (...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1103 this._element.addEventListener('click', this._longClickData.reset, true); | 1103 this._element.addEventListener('click', this._longClickData.reset, true); |
| 1104 delete this._longClickData; | 1104 delete this._longClickData; |
| 1105 } | 1105 } |
| 1106 }; | 1106 }; |
| 1107 | 1107 |
| 1108 /** | 1108 /** |
| 1109 * @param {!Document} document | 1109 * @param {!Document} document |
| 1110 * @param {!Common.Setting} themeSetting | 1110 * @param {!Common.Setting} themeSetting |
| 1111 */ | 1111 */ |
| 1112 UI.initializeUIUtils = function(document, themeSetting) { | 1112 UI.initializeUIUtils = function(document, themeSetting) { |
| 1113 document.body.classList.toggle('inactive', !document.hasFocus()); |
| 1113 document.defaultView.addEventListener('focus', UI._windowFocused.bind(UI, docu
ment), false); | 1114 document.defaultView.addEventListener('focus', UI._windowFocused.bind(UI, docu
ment), false); |
| 1114 document.defaultView.addEventListener('blur', UI._windowBlurred.bind(UI, docum
ent), false); | 1115 document.defaultView.addEventListener('blur', UI._windowBlurred.bind(UI, docum
ent), false); |
| 1115 document.addEventListener('focus', UI._focusChanged.bind(UI), true); | 1116 document.addEventListener('focus', UI._focusChanged.bind(UI), true); |
| 1116 document.addEventListener('keydown', event => { | 1117 document.addEventListener('keydown', event => { |
| 1117 UI._keyboardFocus = true; | 1118 UI._keyboardFocus = true; |
| 1118 document.defaultView.requestAnimationFrame(() => UI._keyboardFocus = false); | 1119 document.defaultView.requestAnimationFrame(() => UI._keyboardFocus = false); |
| 1119 }, true); | 1120 }, true); |
| 1120 | 1121 |
| 1121 if (!UI.themeSupport) | 1122 if (!UI.themeSupport) |
| 1122 UI.themeSupport = new UI.ThemeSupport(themeSetting); | 1123 UI.themeSupport = new UI.ThemeSupport(themeSetting); |
| (...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2006 */ | 2007 */ |
| 2007 constructor(message, okCallback, cancelCallback) { | 2008 constructor(message, okCallback, cancelCallback) { |
| 2008 super(true); | 2009 super(true); |
| 2009 this.registerRequiredCSS('ui/confirmDialog.css'); | 2010 this.registerRequiredCSS('ui/confirmDialog.css'); |
| 2010 this.contentElement.createChild('div', 'message').createChild('span').textCo
ntent = message; | 2011 this.contentElement.createChild('div', 'message').createChild('span').textCo
ntent = message; |
| 2011 var buttonsBar = this.contentElement.createChild('div', 'button'); | 2012 var buttonsBar = this.contentElement.createChild('div', 'button'); |
| 2012 buttonsBar.appendChild(UI.createTextButton(Common.UIString('Ok'), okCallback
)); | 2013 buttonsBar.appendChild(UI.createTextButton(Common.UIString('Ok'), okCallback
)); |
| 2013 buttonsBar.appendChild(UI.createTextButton(Common.UIString('Cancel'), cancel
Callback)); | 2014 buttonsBar.appendChild(UI.createTextButton(Common.UIString('Cancel'), cancel
Callback)); |
| 2014 } | 2015 } |
| 2015 }; | 2016 }; |
| OLD | NEW |