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

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: Remove GURL header. 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::GetAlternativeURL(
391 const storage::FileSystemURL& url,
392 base::Callback<void(const GURL& url)> callback) {
393
394 switch (url.type()) {
395 case storage::kFileSystemTypeDrive:
396 drive_delegate_->GetAlternativeURL(url, callback);
397 return;
398 case storage::kFileSystemTypeProvided:
399 file_system_provider_delegate_->GetAlternativeURL(url, callback);
400 return;
401 case storage::kFileSystemTypeDeviceMediaAsFileStorage:
402 mtp_delegate_->GetAlternativeURL(url, callback);
403 return;
404 case storage::kFileSystemTypeNativeLocal:
405 case storage::kFileSystemTypeRestrictedNativeLocal:
406 callback.Run(GURL());
407 return;
408 default:
409 NOTREACHED();
410 callback.Run(GURL());
411 return;
412 }
413 }
414
390 } // namespace chromeos 415 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698