| 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 * This view displays options for importing data from a log file. | 6 * This view displays options for importing data from a log file. |
| 7 */ | 7 */ |
| 8 var ImportView = (function() { | 8 var ImportView = (function() { |
| 9 'use strict'; | 9 'use strict'; |
| 10 | 10 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 * security reasons, which is why we allow the |files| array to be empty. | 112 * security reasons, which is why we allow the |files| array to be empty. |
| 113 */ | 113 */ |
| 114 onDrag: function(event) { | 114 onDrag: function(event) { |
| 115 // NOTE: Use Array.prototype.indexOf here is necessary while WebKit | 115 // NOTE: Use Array.prototype.indexOf here is necessary while WebKit |
| 116 // decides which type of data structure dataTransfer.types will be | 116 // decides which type of data structure dataTransfer.types will be |
| 117 // (currently between DOMStringList and Array). These have different APIs | 117 // (currently between DOMStringList and Array). These have different APIs |
| 118 // so assuming one type or the other was breaking things. See | 118 // so assuming one type or the other was breaking things. See |
| 119 // http://crbug.com/115433. TODO(dbeam): Remove when standardized more. | 119 // http://crbug.com/115433. TODO(dbeam): Remove when standardized more. |
| 120 var indexOf = Array.prototype.indexOf; | 120 var indexOf = Array.prototype.indexOf; |
| 121 return indexOf.call(event.dataTransfer.types, 'Files') == -1 || | 121 return indexOf.call(event.dataTransfer.types, 'Files') == -1 || |
| 122 event.dataTransfer.files.length > 1; | 122 event.dataTransfer.files.length > 1; |
| 123 }, | 123 }, |
| 124 | 124 |
| 125 /** | 125 /** |
| 126 * Called when something is dropped onto the drop target. If it's a single | 126 * Called when something is dropped onto the drop target. If it's a single |
| 127 * file, tries to load it as a log file. | 127 * file, tries to load it as a log file. |
| 128 */ | 128 */ |
| 129 onDrop: function(event) { | 129 onDrop: function(event) { |
| 130 var indexOf = Array.prototype.indexOf; | 130 var indexOf = Array.prototype.indexOf; |
| 131 if (indexOf.call(event.dataTransfer.types, 'Files') == -1 || | 131 if (indexOf.call(event.dataTransfer.types, 'Files') == -1 || |
| 132 event.dataTransfer.files.length != 1) { | 132 event.dataTransfer.files.length != 1) { |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 }, | 218 }, |
| 219 | 219 |
| 220 enableLoadFileElement_: function(enabled) { | 220 enableLoadFileElement_: function(enabled) { |
| 221 this.loadFileElement_.disabled = !enabled; | 221 this.loadFileElement_.disabled = !enabled; |
| 222 }, | 222 }, |
| 223 }; | 223 }; |
| 224 | 224 |
| 225 return ImportView; | 225 return ImportView; |
| 226 })(); | 226 })(); |
| 227 | 227 |
| OLD | NEW |