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

Unified Diff: chrome/browser/media_galleries/fileapi/supported_audio_video_checker.h

Issue 20190002: Add a copy or move validator to that can handle support audio and video files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test file name Created 7 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 side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698