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

Side by Side Diff: chrome/browser/chromeos/extensions/file_manager/file_handler_util.cc

Issue 18286004: Move PathExists to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/extensions/file_manager/file_handler_util.h" 5 #include "chrome/browser/chromeos/extensions/file_manager/file_handler_util.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/i18n/case_conversion.h" 9 #include "base/i18n/case_conversion.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 641
642 base::FilePath local_path = url.path(); 642 base::FilePath local_path = url.path();
643 base::FilePath virtual_path = url.virtual_path(); 643 base::FilePath virtual_path = url.virtual_path();
644 644
645 bool is_drive_file = url.type() == fileapi::kFileSystemTypeDrive; 645 bool is_drive_file = url.type() == fileapi::kFileSystemTypeDrive;
646 DCHECK(!is_drive_file || drive::util::IsUnderDriveMountPoint(local_path)); 646 DCHECK(!is_drive_file || drive::util::IsUnderDriveMountPoint(local_path));
647 647
648 // If the file is under drive mount point, there is no actual file to be 648 // If the file is under drive mount point, there is no actual file to be
649 // found on the url.path(). 649 // found on the url.path().
650 if (!is_drive_file) { 650 if (!is_drive_file) {
651 if (!file_util::PathExists(local_path) || 651 if (!base::PathExists(local_path) ||
652 file_util::IsLink(local_path) || 652 file_util::IsLink(local_path) ||
653 !file_util::GetFileInfo(local_path, &file_info)) { 653 !file_util::GetFileInfo(local_path, &file_info)) {
654 continue; 654 continue;
655 } 655 }
656 } 656 }
657 657
658 // Grant access to this particular file to target extension. This will 658 // Grant access to this particular file to target extension. This will
659 // ensure that the target extension can access only this FS entry and 659 // ensure that the target extension can access only this FS entry and
660 // prevent from traversing FS hierarchy upward. 660 // prevent from traversing FS hierarchy upward.
661 backend->GrantFileAccessToExtension( 661 backend->GrantFileAccessToExtension(
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 ++iter) { 838 ++iter) {
839 content::ChildProcessSecurityPolicy::GetInstance()->GrantPermissionsForFile( 839 content::ChildProcessSecurityPolicy::GetInstance()->GrantPermissionsForFile(
840 handler_pid, 840 handler_pid,
841 iter->absolute_path, 841 iter->absolute_path,
842 GetAccessPermissionsForFileBrowserHandler(extension_.get(), 842 GetAccessPermissionsForFileBrowserHandler(extension_.get(),
843 action_id_)); 843 action_id_));
844 } 844 }
845 } 845 }
846 846
847 } // namespace file_handler_util 847 } // namespace file_handler_util
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698