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

Side by Side Diff: chrome/browser/media_galleries/fileapi/media_file_validator_factory.cc

Issue 23727009: Cleanup: Remove chrome namespace for storage monitor and media galleries. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix nit Created 7 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/media_galleries/fileapi/media_file_validator_factory.h" 5 #include "chrome/browser/media_galleries/fileapi/media_file_validator_factory.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/platform_file.h" 8 #include "base/platform_file.h"
9 #include "chrome/browser/media_galleries/fileapi/supported_audio_video_checker.h " 9 #include "chrome/browser/media_galleries/fileapi/supported_audio_video_checker.h "
10 #include "chrome/browser/media_galleries/fileapi/supported_image_type_validator. h" 10 #include "chrome/browser/media_galleries/fileapi/supported_image_type_validator. h"
11 #include "webkit/browser/fileapi/copy_or_move_file_validator.h" 11 #include "webkit/browser/fileapi/copy_or_move_file_validator.h"
12 #include "webkit/browser/fileapi/file_system_url.h" 12 #include "webkit/browser/fileapi/file_system_url.h"
13 13
14 namespace chrome {
15
16 namespace { 14 namespace {
17 15
18 class InvalidFileValidator : public fileapi::CopyOrMoveFileValidator { 16 class InvalidFileValidator : public fileapi::CopyOrMoveFileValidator {
19 public: 17 public:
20 virtual ~InvalidFileValidator() {} 18 virtual ~InvalidFileValidator() {}
21 virtual void StartPreWriteValidation( 19 virtual void StartPreWriteValidation(
22 const fileapi::CopyOrMoveFileValidator::ResultCallback& 20 const fileapi::CopyOrMoveFileValidator::ResultCallback&
23 result_callback) OVERRIDE { 21 result_callback) OVERRIDE {
24 result_callback.Run(base::PLATFORM_FILE_ERROR_SECURITY); 22 result_callback.Run(base::PLATFORM_FILE_ERROR_SECURITY);
25 } 23 }
26 24
27 virtual void StartPostWriteValidation( 25 virtual void StartPostWriteValidation(
28 const base::FilePath& dest_platform_path, 26 const base::FilePath& dest_platform_path,
29 const fileapi::CopyOrMoveFileValidator::ResultCallback& 27 const fileapi::CopyOrMoveFileValidator::ResultCallback&
30 result_callback) OVERRIDE { 28 result_callback) OVERRIDE {
31 result_callback.Run(base::PLATFORM_FILE_ERROR_SECURITY); 29 result_callback.Run(base::PLATFORM_FILE_ERROR_SECURITY);
32 } 30 }
33 31
34 private: 32 private:
35 friend class chrome::MediaFileValidatorFactory; 33 friend class ::MediaFileValidatorFactory;
36 34
37 InvalidFileValidator() {} 35 InvalidFileValidator() {}
38 36
39 DISALLOW_COPY_AND_ASSIGN(InvalidFileValidator); 37 DISALLOW_COPY_AND_ASSIGN(InvalidFileValidator);
40 }; 38 };
41 39
42 } // namespace 40 } // namespace
43 41
44 MediaFileValidatorFactory::MediaFileValidatorFactory() {} 42 MediaFileValidatorFactory::MediaFileValidatorFactory() {}
45 MediaFileValidatorFactory::~MediaFileValidatorFactory() {} 43 MediaFileValidatorFactory::~MediaFileValidatorFactory() {}
46 44
47 fileapi::CopyOrMoveFileValidator* 45 fileapi::CopyOrMoveFileValidator*
48 MediaFileValidatorFactory::CreateCopyOrMoveFileValidator( 46 MediaFileValidatorFactory::CreateCopyOrMoveFileValidator(
49 const fileapi::FileSystemURL& src, 47 const fileapi::FileSystemURL& src,
50 const base::FilePath& platform_path) { 48 const base::FilePath& platform_path) {
51 base::FilePath src_path = src.virtual_path(); 49 base::FilePath src_path = src.virtual_path();
52 if (SupportedImageTypeValidator::SupportsFileType(src_path)) 50 if (SupportedImageTypeValidator::SupportsFileType(src_path))
53 return new SupportedImageTypeValidator(platform_path); 51 return new SupportedImageTypeValidator(platform_path);
54 if (SupportedAudioVideoChecker::SupportsFileType(src_path)) 52 if (SupportedAudioVideoChecker::SupportsFileType(src_path))
55 return new SupportedAudioVideoChecker(platform_path); 53 return new SupportedAudioVideoChecker(platform_path);
56 54
57 return new InvalidFileValidator(); 55 return new InvalidFileValidator();
58 } 56 }
59
60 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698