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

Side by Side Diff: chrome/browser/chromeos/fileapi/file_system_backend.cc

Issue 527773003: Add GetURLForBrowserTab method to the external file system backend. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed. Created 6 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
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/chromeos/fileapi/file_system_backend.h" 5 #include "chrome/browser/chromeos/fileapi/file_system_backend.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "chrome/browser/chromeos/fileapi/file_access_permissions.h" 10 #include "chrome/browser/chromeos/fileapi/file_access_permissions.h"
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 return scoped_ptr<storage::FileStreamWriter>(); 380 return scoped_ptr<storage::FileStreamWriter>();
381 } 381 }
382 382
383 bool FileSystemBackend::GetVirtualPath( 383 bool FileSystemBackend::GetVirtualPath(
384 const base::FilePath& filesystem_path, 384 const base::FilePath& filesystem_path,
385 base::FilePath* virtual_path) { 385 base::FilePath* virtual_path) {
386 return mount_points_->GetVirtualPath(filesystem_path, virtual_path) || 386 return mount_points_->GetVirtualPath(filesystem_path, virtual_path) ||
387 system_mount_points_->GetVirtualPath(filesystem_path, virtual_path); 387 system_mount_points_->GetVirtualPath(filesystem_path, virtual_path);
388 } 388 }
389 389
390 void FileSystemBackend::GetRedirectURLForContents(
391 const storage::FileSystemURL& url,
392 const storage::URLCallback& callback) {
393 DCHECK(url.is_valid());
394
395 if (!IsAccessAllowed(url))
396 return callback.Run(GURL());
397
398 switch (url.type()) {
399 case storage::kFileSystemTypeDrive:
400 drive_delegate_->GetRedirectURLForContents(url, callback);
401 return;
402 case storage::kFileSystemTypeProvided:
403 file_system_provider_delegate_->GetRedirectURLForContents(url,
404 callback);
405 return;
406 case storage::kFileSystemTypeDeviceMediaAsFileStorage:
407 mtp_delegate_->GetRedirectURLForContents(url, callback);
408 return;
409 case storage::kFileSystemTypeNativeLocal:
410 case storage::kFileSystemTypeRestrictedNativeLocal:
411 callback.Run(GURL());
412 return;
413 default:
414 NOTREACHED();
415 }
416 callback.Run(GURL());
417 }
418
390 } // namespace chromeos 419 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/fileapi/file_system_backend.h ('k') | chrome/browser/chromeos/fileapi/file_system_backend_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698