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

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

Issue 12193007: Deprecate MountPointProvider::IsAccessAllowed in favor of GetPermissionPolicy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: test fix Created 7 years, 10 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_handler_util.h" 5 #include "chrome/browser/chromeos/extensions/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/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 652
653 if (!external_provider) 653 if (!external_provider)
654 return false; 654 return false;
655 655
656 for (size_t i = 0; i < files.size(); ++i) { 656 for (size_t i = 0; i < files.size(); ++i) {
657 // Make sure this url really being used by the right caller extension. 657 // Make sure this url really being used by the right caller extension.
658 if (source_url_.GetOrigin() != files[i].origin()) 658 if (source_url_.GetOrigin() != files[i].origin())
659 return false; 659 return false;
660 660
661 if (!chromeos::CrosMountPointProvider::CanHandleURL(files[i]) || 661 if (!chromeos::CrosMountPointProvider::CanHandleURL(files[i]) ||
662 !external_provider->IsAccessAllowed(files[i])) { 662 (external_provider->GetPermissionPolicy(
663 files[i], fileapi::kReadFilePermissions) ==
664 fileapi::FILE_PERMISSION_ALWAYS_DENY)) {
ericu 2013/02/05 21:51:57 This seems potentially more fragile than asking Is
kinuko 2013/02/06 03:36:17 I think actually we should also check ChildProcess
tonibarzic 2013/02/06 06:20:17 yeah, checking ChildProcessSecurityPolicy would pr
kinuko 2013/02/06 09:24:50 Yes, that sounds reasonable to me too. My intentio
ericu 2013/02/11 22:29:17 I don't know about this specific case vs. others,
kinuko 2013/02/12 08:19:52 The primary intention of this series of changes ar
663 return false; 665 return false;
664 } 666 }
665 } 667 }
666 668
667 return true; 669 return true;
668 } 670 }
669 671
670 // TODO(kaznacheev): Remove this method and inline its implementation at the 672 // TODO(kaznacheev): Remove this method and inline its implementation at the
671 // only place where it is used (DriveTaskExecutor::OnAppAuthorized) 673 // only place where it is used (DriveTaskExecutor::OnAppAuthorized)
672 Browser* FileTaskExecutor::GetBrowser() const { 674 Browser* FileTaskExecutor::GetBrowser() const {
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
1063 extensions::LaunchPlatformAppWithFileHandler(profile(), GetExtension(), 1065 extensions::LaunchPlatformAppWithFileHandler(profile(), GetExtension(),
1064 action_id_, file_urls[i].path()); 1066 action_id_, file_urls[i].path());
1065 } 1067 }
1066 1068
1067 if (!done.is_null()) 1069 if (!done.is_null())
1068 done.Run(true); 1070 done.Run(true);
1069 return true; 1071 return true;
1070 } 1072 }
1071 1073
1072 } // namespace file_handler_util 1074 } // namespace file_handler_util
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698