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 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 569 | 569 |
| 570 fileapi::FileSystemURL url(origin_file_url); | 570 fileapi::FileSystemURL url(origin_file_url); |
| 571 if (!chromeos::CrosMountPointProvider::CanHandleURL(url)) | 571 if (!chromeos::CrosMountPointProvider::CanHandleURL(url)) |
| 572 return false; | 572 return false; |
| 573 | 573 |
| 574 fileapi::ExternalFileSystemMountPointProvider* external_provider = | 574 fileapi::ExternalFileSystemMountPointProvider* external_provider = |
| 575 file_system_context_->external_provider(); | 575 file_system_context_->external_provider(); |
| 576 if (!external_provider) | 576 if (!external_provider) |
| 577 return false; | 577 return false; |
| 578 | 578 |
| 579 if (!external_provider->IsAccessAllowed(url.origin(), | 579 if (!external_provider->IsAccessAllowed(url)) |
|
hashimoto
2012/08/27 06:43:22
nit: Combine this 'if' with the above one using '|
| |
| 580 url.type(), | |
| 581 url.virtual_path())) { | |
| 582 return false; | 580 return false; |
| 583 } | |
| 584 | 581 |
| 585 // Make sure this url really being used by the right caller extension. | 582 // Make sure this url really being used by the right caller extension. |
| 586 if (source_url_.GetOrigin() != url.origin()) { | 583 if (source_url_.GetOrigin() != url.origin()) { |
| 587 DidFail(base::PLATFORM_FILE_ERROR_SECURITY); | 584 DidFail(base::PLATFORM_FILE_ERROR_SECURITY); |
| 588 return false; | 585 return false; |
| 589 } | 586 } |
| 590 | 587 |
| 591 // Check if this file system entry exists first. | 588 // Check if this file system entry exists first. |
| 592 base::PlatformFileInfo file_info; | 589 base::PlatformFileInfo file_info; |
| 593 | 590 |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 878 handler_pid, | 875 handler_pid, |
| 879 handler_host_permissions_[i].first, | 876 handler_host_permissions_[i].first, |
| 880 handler_host_permissions_[i].second); | 877 handler_host_permissions_[i].second); |
| 881 } | 878 } |
| 882 | 879 |
| 883 // We don't need this anymore. | 880 // We don't need this anymore. |
| 884 handler_host_permissions_.clear(); | 881 handler_host_permissions_.clear(); |
| 885 } | 882 } |
| 886 | 883 |
| 887 } // namespace file_handler_util | 884 } // namespace file_handler_util |
| OLD | NEW |