OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
3 * Copyright (C) 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2011 Google Inc. All rights reserved. |
4 * Copyright (C) 2009 Joseph Pecoraro | 4 * Copyright (C) 2009 Joseph Pecoraro |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * | 9 * |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 1264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1275 return; | 1275 return; |
1276 } | 1276 } |
1277 element->focus(); | 1277 element->focus(); |
1278 } | 1278 } |
1279 | 1279 |
1280 void InspectorDOMAgent::setFileInputFiles(ErrorString* errorString, int nodeId,
const RefPtr<InspectorArray>& files) | 1280 void InspectorDOMAgent::setFileInputFiles(ErrorString* errorString, int nodeId,
const RefPtr<InspectorArray>& files) |
1281 { | 1281 { |
1282 Node* node = assertNode(errorString, nodeId); | 1282 Node* node = assertNode(errorString, nodeId); |
1283 if (!node) | 1283 if (!node) |
1284 return; | 1284 return; |
1285 HTMLInputElement* element = node->toInputElement(); | 1285 Handle<HTMLInputElement> element = node->toInputElement(); |
1286 if (!element || !element->isFileUpload()) { | 1286 if (!element || !element->isFileUpload()) { |
1287 *errorString = "Node is not a file input element"; | 1287 *errorString = "Node is not a file input element"; |
1288 return; | 1288 return; |
1289 } | 1289 } |
1290 | 1290 |
1291 RefPtr<FileList> fileList = FileList::create(); | 1291 RefPtr<FileList> fileList = FileList::create(); |
1292 for (InspectorArray::const_iterator iter = files->begin(); iter != files->en
d(); ++iter) { | 1292 for (InspectorArray::const_iterator iter = files->begin(); iter != files->en
d(); ++iter) { |
1293 String path; | 1293 String path; |
1294 if (!(*iter)->asString(&path)) { | 1294 if (!(*iter)->asString(&path)) { |
1295 *errorString = "Files must be strings"; | 1295 *errorString = "Files must be strings"; |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1815 | 1815 |
1816 InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(m
ainWorldScriptState(frame)); | 1816 InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(m
ainWorldScriptState(frame)); |
1817 if (injectedScript.hasNoValue()) | 1817 if (injectedScript.hasNoValue()) |
1818 return 0; | 1818 return 0; |
1819 | 1819 |
1820 return injectedScript.wrapNode(node, objectGroup); | 1820 return injectedScript.wrapNode(node, objectGroup); |
1821 } | 1821 } |
1822 | 1822 |
1823 } // namespace WebCore | 1823 } // namespace WebCore |
1824 | 1824 |
OLD | NEW |