| 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 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 858 } | 858 } |
| 859 | 859 |
| 860 if (gdata_paths->empty()) { | 860 if (gdata_paths->empty()) { |
| 861 // Invoke callback if none of the files are on gdata mount point. | 861 // Invoke callback if none of the files are on gdata mount point. |
| 862 callback.Run(); | 862 callback.Run(); |
| 863 return; | 863 return; |
| 864 } | 864 } |
| 865 | 865 |
| 866 // For files on gdata mount point, we'll have to give handler host permissions | 866 // For files on gdata mount point, we'll have to give handler host permissions |
| 867 // for their cache paths. This has to be called on UI thread. | 867 // for their cache paths. This has to be called on UI thread. |
| 868 gdata::util::InsertGDataCachePathsPermissions(profile(), | 868 gdata::util::InsertDriveCachePathsPermissions(profile(), |
| 869 gdata_paths.Pass(), | 869 gdata_paths.Pass(), |
| 870 &handler_host_permissions_, | 870 &handler_host_permissions_, |
| 871 callback); | 871 callback); |
| 872 } | 872 } |
| 873 | 873 |
| 874 void ExtensionTaskExecutor::SetupHandlerHostFileAccessPermissions( | 874 void ExtensionTaskExecutor::SetupHandlerHostFileAccessPermissions( |
| 875 int handler_pid) { | 875 int handler_pid) { |
| 876 for (size_t i = 0; i < handler_host_permissions_.size(); i++) { | 876 for (size_t i = 0; i < handler_host_permissions_.size(); i++) { |
| 877 content::ChildProcessSecurityPolicy::GetInstance()->GrantPermissionsForFile( | 877 content::ChildProcessSecurityPolicy::GetInstance()->GrantPermissionsForFile( |
| 878 handler_pid, | 878 handler_pid, |
| 879 handler_host_permissions_[i].first, | 879 handler_host_permissions_[i].first, |
| 880 handler_host_permissions_[i].second); | 880 handler_host_permissions_[i].second); |
| 881 } | 881 } |
| 882 | 882 |
| 883 // We don't need this anymore. | 883 // We don't need this anymore. |
| 884 handler_host_permissions_.clear(); | 884 handler_host_permissions_.clear(); |
| 885 } | 885 } |
| 886 | 886 |
| 887 } // namespace file_handler_util | 887 } // namespace file_handler_util |
| OLD | NEW |