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

Side by Side Diff: Source/core/fileapi/File.h

Issue 423283003: Fix userVisibility() for files dragged into the renderer. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addressed 2nd round of feedback. Created 6 years, 4 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/core.gypi ('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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 } 82 }
83 83
84 static PassRefPtrWillBeRawPtr<File> createForFileSystemFile(const KURL& url, const FileMetadata& metadata) 84 static PassRefPtrWillBeRawPtr<File> createForFileSystemFile(const KURL& url, const FileMetadata& metadata)
85 { 85 {
86 return adoptRefWillBeNoop(new File(url, metadata)); 86 return adoptRefWillBeNoop(new File(url, metadata));
87 } 87 }
88 88
89 KURL fileSystemURL() const { ASSERT(hasValidFileSystemURL()); return m_fileS ystemURL; } 89 KURL fileSystemURL() const { ASSERT(hasValidFileSystemURL()); return m_fileS ystemURL; }
90 90
91 // Create a file with a name exposed to the author (via File.name and associ ated DOM properties) that differs from the one provided in the path. 91 // Create a file with a name exposed to the author (via File.name and associ ated DOM properties) that differs from the one provided in the path.
92 static PassRefPtrWillBeRawPtr<File> createWithName(const String& path, const String& name, ContentTypeLookupPolicy policy = WellKnownContentTypes) 92 static PassRefPtrWillBeRawPtr<File> createForUserProvidedFile(const String& path, const String& displayName)
93 { 93 {
94 if (name.isEmpty()) 94 if (displayName.isEmpty())
95 return adoptRefWillBeNoop(new File(path, policy, File::IsNotUserVisi ble)); 95 return adoptRefWillBeNoop(new File(path, File::AllContentTypes, File ::IsUserVisible));
96 return adoptRefWillBeNoop(new File(path, name, policy, File::IsNotUserVi sible)); 96 return adoptRefWillBeNoop(new File(path, displayName, File::AllContentTy pes, File::IsUserVisible));
97 } 97 }
98 98
99 static PassRefPtrWillBeRawPtr<File> createForFileSystemFile(const String& pa th, const String& name, ContentTypeLookupPolicy policy = WellKnownContentTypes) 99 static PassRefPtrWillBeRawPtr<File> createForFileSystemFile(const String& pa th, const String& name, ContentTypeLookupPolicy policy = WellKnownContentTypes)
100 { 100 {
101 if (name.isEmpty()) 101 if (name.isEmpty())
102 return adoptRefWillBeNoop(new File(path, policy, File::IsNotUserVisi ble)); 102 return adoptRefWillBeNoop(new File(path, policy, File::IsNotUserVisi ble));
103 return adoptRefWillBeNoop(new File(path, name, policy, File::IsNotUserVi sible)); 103 return adoptRefWillBeNoop(new File(path, name, policy, File::IsNotUserVi sible));
104 } 104 }
105 105
106 virtual unsigned long long size() const OVERRIDE; 106 virtual unsigned long long size() const OVERRIDE;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 const double m_snapshotModificationTime; 158 const double m_snapshotModificationTime;
159 159
160 String m_relativePath; 160 String m_relativePath;
161 }; 161 };
162 162
163 DEFINE_TYPE_CASTS(File, Blob, blob, blob->isFile(), blob.isFile()); 163 DEFINE_TYPE_CASTS(File, Blob, blob, blob->isFile(), blob.isFile());
164 164
165 } // namespace blink 165 } // namespace blink
166 166
167 #endif // File_h 167 #endif // File_h
OLDNEW
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/html/forms/FileInputType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698