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

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

Issue 21097005: Fix up some tests for copy-or-move validator and nearby. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: enum simplification 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 unified diff | Download patch
« no previous file with comments | « no previous file | webkit/browser/fileapi/copy_or_move_file_validator_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_image_type_validator. h" 9 #include "chrome/browser/media_galleries/fileapi/supported_image_type_validator. h"
10 #include "webkit/browser/fileapi/copy_or_move_file_validator.h" 10 #include "webkit/browser/fileapi/copy_or_move_file_validator.h"
11 #include "webkit/browser/fileapi/file_system_url.h" 11 #include "webkit/browser/fileapi/file_system_url.h"
12 #include "webkit/common/blob/shareable_file_reference.h"
13 12
14 namespace chrome { 13 namespace chrome {
15 14
16 namespace { 15 namespace {
17 16
18 class InvalidFileValidator : public fileapi::CopyOrMoveFileValidator { 17 class InvalidFileValidator : public fileapi::CopyOrMoveFileValidator {
19 public: 18 public:
20 virtual ~InvalidFileValidator() {} 19 virtual ~InvalidFileValidator() {}
21 virtual void StartPreWriteValidation( 20 virtual void StartPreWriteValidation(
22 const fileapi::CopyOrMoveFileValidator::ResultCallback& 21 const fileapi::CopyOrMoveFileValidator::ResultCallback&
(...skipping 27 matching lines...) Expand all
50 const base::FilePath& platform_path) { 49 const base::FilePath& platform_path) {
51 base::FilePath src_path = src.virtual_path(); 50 base::FilePath src_path = src.virtual_path();
52 if (SupportedImageTypeValidator::SupportsFileType(src_path)) 51 if (SupportedImageTypeValidator::SupportsFileType(src_path))
53 return new SupportedImageTypeValidator(platform_path); 52 return new SupportedImageTypeValidator(platform_path);
54 // TODO(vandebo): Support other file types. 53 // TODO(vandebo): Support other file types.
55 54
56 return new InvalidFileValidator(); 55 return new InvalidFileValidator();
57 } 56 }
58 57
59 } // namespace chrome 58 } // namespace chrome
OLDNEW
« no previous file with comments | « no previous file | webkit/browser/fileapi/copy_or_move_file_validator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698