#include "base/files/file_path.h"
#include "base/message_loop/message_loop.h"
#include "chrome/browser/chromeos/drive/drive.pb.h"
+#include "chrome/browser/chromeos/drive/drive_integration_service.h"
#include "chrome/browser/chromeos/drive/file_errors.h"
#include "chrome/browser/chromeos/drive/file_system_interface.h"
#include "chrome/browser/chromeos/drive/file_system_util.h"
#include "chrome/browser/chromeos/file_manager/app_id.h"
#include "chrome/browser/chromeos/file_manager/fileapi_util.h"
+#include "chrome/browser/chromeos/file_manager/path_util.h"
#include "chrome/browser/chromeos/file_manager/volume_manager.h"
#include "chrome/browser/chromeos/fileapi/file_system_backend.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/extensions/api/file_browser_private.h"
+#include "content/public/browser/child_process_security_policy.h"
#include "ui/shell_dialogs/selected_file_info.h"
#include "webkit/browser/fileapi/file_system_context.h"
#include "webkit/browser/fileapi/file_system_url.h"
base::Bind(&GetSelectedFileInfoInternal, profile, base::Passed(¶ms)));
}
+void SetupProfileFileAccessPermissions(int render_view_process_id,
+ Profile* profile) {
+ const base::FilePath paths[] = {
+ drive::util::GetDriveMountPointPath(profile),
+ util::GetDownloadsFolderForProfile(profile),
+ };
+ for (size_t i = 0; i < arraysize(paths); ++i) {
+ content::ChildProcessSecurityPolicy::GetInstance(
+ )->GrantCreateReadWriteFile(render_view_process_id, paths[i]);
+ }
+}
+
+drive::EventLogger* GetLogger(Profile* profile) {
+ drive::DriveIntegrationService* service =
+ drive::DriveIntegrationServiceFactory::FindForProfileRegardlessOfStates(
+ profile);
+ return service ? service->event_logger() : NULL;
+}
+
} // namespace util
} // namespace file_manager