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

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: Handled @kinaba's comments 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::GetURLForBrowserTab(
391 const storage::FileSystemURL& url,
392 const URLCallback& callback) {
393 switch (url.type()) {
mtomasz 2014/09/04 05:30:01 I think we should add a DCHECK for url_is_valid(),
hirono 2014/09/04 06:10:59 Done.
394 case storage::kFileSystemTypeDrive:
395 drive_delegate_->GetURLForBrowserTab(url, callback);
396 return;
397 case storage::kFileSystemTypeProvided:
398 file_system_provider_delegate_->GetURLForBrowserTab(url, callback);
399 return;
400 case storage::kFileSystemTypeDeviceMediaAsFileStorage:
401 mtp_delegate_->GetURLForBrowserTab(url, callback);
402 return;
403 case storage::kFileSystemTypeNativeLocal:
404 case storage::kFileSystemTypeRestrictedNativeLocal:
405 callback.Run(GURL());
406 return;
407 default:
408 NOTREACHED();
409 callback.Run(GURL());
410 return;
mtomasz 2014/09/04 05:30:01 In another switch-case statements in this file we
hirono 2014/09/04 06:10:59 Done.
411 }
412 }
413
390 } // namespace chromeos 414 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698