| Index: webkit/fileapi/media/media_path_filter.cc
|
| diff --git a/webkit/fileapi/media/media_path_filter.cc b/webkit/fileapi/media/media_path_filter.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..111735dd719155682ab524d7724206483a17d54a
|
| --- /dev/null
|
| +++ b/webkit/fileapi/media/media_path_filter.cc
|
| @@ -0,0 +1,27 @@
|
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "webkit/fileapi/media/media_path_filter.h"
|
| +
|
| +#include <algorithm>
|
| +
|
| +#include "base/string_util.h"
|
| +#include "net/base/mime_util.h"
|
| +
|
| +namespace fileapi {
|
| +
|
| +MediaPathFilter::MediaPathFilter() {
|
| + net::GetImageExtensions(&media_file_extensions_);
|
| + net::GetAudioExtensions(&media_file_extensions_);
|
| + net::GetVideoExtensions(&media_file_extensions_);
|
| + std::sort(media_file_extensions_.begin(), media_file_extensions_.end());
|
| +}
|
| +
|
| +bool MediaPathFilter::Match(const FilePath& path) const {
|
| + return std::binary_search(media_file_extensions_.begin(),
|
| + media_file_extensions_.end(),
|
| + StringToLowerASCII(path.Extension()));
|
| +}
|
| +
|
| +} // namespace fileapi
|
|
|