Index: chrome/browser/media_galleries/fileapi/supported_audio_video_checker.h |
diff --git a/chrome/browser/media_galleries/fileapi/supported_audio_video_checker.h b/chrome/browser/media_galleries/fileapi/supported_audio_video_checker.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..33b37c77cbe59adc0cf8bca2d146f15df8ee75d3 |
--- /dev/null |
+++ b/chrome/browser/media_galleries/fileapi/supported_audio_video_checker.h |
@@ -0,0 +1,49 @@ |
+// Copyright 2013 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. |
+ |
+#ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_SUPPORTED_AUDIO_VIDEO_CHECKER_H_ |
+#define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_SUPPORTED_AUDIO_VIDEO_CHECKER_H_ |
+ |
+#include "base/basictypes.h" |
+#include "base/files/file_path.h" |
+#include "base/memory/ref_counted.h" |
+#include "base/memory/weak_ptr.h" |
+#include "base/platform_file.h" |
+#include "webkit/browser/fileapi/copy_or_move_file_validator.h" |
+ |
+class SafeAudioVideoChecker; |
+ |
+namespace chrome { |
+class MediaFileValidatorFactory; |
+} |
+ |
+class SupportedAudioVideoChecker : public fileapi::CopyOrMoveFileValidator { |
Lei Zhang
2013/08/08 00:08:02
Can you add a class description?
vandebo (ex-Chrome)
2013/08/08 17:34:01
Done.
|
+ public: |
+ virtual ~SupportedAudioVideoChecker(); |
+ |
+ static bool SupportsFileType(const base::FilePath& path); |
+ |
+ virtual void StartPreWriteValidation( |
+ const ResultCallback& result_callback) OVERRIDE; |
+ |
+ virtual void StartPostWriteValidation( |
+ const base::FilePath& dest_platform_path, |
+ const ResultCallback& result_callback) OVERRIDE; |
+ |
+ private: |
+ friend class chrome::MediaFileValidatorFactory; |
+ |
+ explicit SupportedAudioVideoChecker(const base::FilePath& file); |
+ |
+ void OnFileOpen(const base::PlatformFile& file); |
+ |
+ base::FilePath path_; |
+ fileapi::CopyOrMoveFileValidator::ResultCallback callback_; |
+ scoped_refptr<SafeAudioVideoChecker> safe_checker_; |
+ base::WeakPtrFactory<SupportedAudioVideoChecker> weak_factory_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(SupportedAudioVideoChecker); |
+}; |
+ |
+#endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_SUPPORTED_AUDIO_VIDEO_CHECKER_H_ |