Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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)) { | |
|
kinuko
2013/02/04 08:58:25
Maybe this change needs some more care too
tbarzic
2013/02/05 00:09:34
hmm, this should be ok.. to be honest I've started
| |
| 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 Loading... | |
| 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 |
| OLD | NEW |