Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(309)

Side by Side Diff: Source/core/fileapi/FileList.cpp

Issue 235373005: Handle JS-created files in <input type="file">. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed visibility bug. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/fileapi/FileList.h ('k') | Source/core/html/forms/FileInputType.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 23 matching lines...) Expand all
34 ScriptWrappable::init(this); 34 ScriptWrappable::init(this);
35 } 35 }
36 36
37 File* FileList::item(unsigned index) const 37 File* FileList::item(unsigned index) const
38 { 38 {
39 if (index >= m_files.size()) 39 if (index >= m_files.size())
40 return 0; 40 return 0;
41 return m_files[index].get(); 41 return m_files[index].get();
42 } 42 }
43 43
44 Vector<String> FileList::paths() const 44 Vector<String> FileList::pathsForUserVisibleFiles() const
45 { 45 {
46 Vector<String> paths; 46 Vector<String> paths;
47 for (unsigned i = 0; i < m_files.size(); ++i) 47 for (unsigned i = 0; i < m_files.size(); ++i) {
48 paths.append(m_files[i]->path()); 48 if (m_files[i]->userVisibility() == File::IsUserVisible)
49 paths.append(m_files[i]->path());
50 }
49 51
50 return paths; 52 return paths;
51 } 53 }
52 54
53 void FileList::trace(Visitor* visitor) 55 void FileList::trace(Visitor* visitor)
54 { 56 {
55 visitor->trace(m_files); 57 visitor->trace(m_files);
56 } 58 }
57 59
58 } // namespace blink 60 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/fileapi/FileList.h ('k') | Source/core/html/forms/FileInputType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698