| 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 2020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2031 callback(fileSelectorElement.files[0]); | 2031 callback(fileSelectorElement.files[0]); |
| 2032 } | 2032 } |
| 2033 return fileSelectorElement; | 2033 return fileSelectorElement; |
| 2034 }; | 2034 }; |
| 2035 | 2035 |
| 2036 /** | 2036 /** |
| 2037 * @const | 2037 * @const |
| 2038 * @type {number} | 2038 * @type {number} |
| 2039 */ | 2039 */ |
| 2040 UI.MaxLengthForDisplayedURLs = 150; | 2040 UI.MaxLengthForDisplayedURLs = 150; |
| 2041 |
| 2042 /** |
| 2043 * @unrestricted |
| 2044 */ |
| 2045 UI.ConfirmDialog = class extends UI.VBox { |
| 2046 /** |
| 2047 * @param {string} message |
| 2048 * @param {!Function} callback |
| 2049 */ |
| 2050 static show(message, callback) { |
| 2051 var dialog = new UI.Dialog(); |
| 2052 dialog.setWrapsContent(true); |
| 2053 dialog.addCloseButton(); |
| 2054 dialog.setDimmed(true); |
| 2055 new UI |
| 2056 .ConfirmDialog( |
| 2057 message, |
| 2058 () => { |
| 2059 dialog.detach(); |
| 2060 callback(); |
| 2061 }, |
| 2062 () => dialog.detach()) |
| 2063 .show(dialog.element); |
| 2064 dialog.show(); |
| 2065 } |
| 2066 |
| 2067 /** |
| 2068 * @param {string} message |
| 2069 * @param {!Function} okCallback |
| 2070 * @param {!Function} cancelCallback |
| 2071 */ |
| 2072 constructor(message, okCallback, cancelCallback) { |
| 2073 super(true); |
| 2074 this.registerRequiredCSS('ui/confirmDialog.css'); |
| 2075 this.contentElement.createChild('div', 'message').createChild('span').textCo
ntent = message; |
| 2076 var buttonsBar = this.contentElement.createChild('div', 'button'); |
| 2077 buttonsBar.appendChild(UI.createTextButton(Common.UIString('Ok'), okCallback
)); |
| 2078 buttonsBar.appendChild(UI.createTextButton(Common.UIString('Cancel'), cancel
Callback)); |
| 2079 } |
| 2080 }; |
| OLD | NEW |