| 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/extensions/api/file_system/file_system_api.h" | 5 #include "chrome/browser/extensions/api/file_system/file_system_api.h" |
| 6 | 6 |
| 7 #include "apps/saved_files_service.h" | 7 #include "apps/saved_files_service.h" |
| 8 #include "apps/shell_window.h" |
| 8 #include "base/bind.h" | 9 #include "base/bind.h" |
| 9 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| 10 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 11 #include "base/logging.h" | 12 #include "base/logging.h" |
| 12 #include "base/path_service.h" | 13 #include "base/path_service.h" |
| 13 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
| 14 #include "base/strings/sys_string_conversions.h" | 15 #include "base/strings/sys_string_conversions.h" |
| 15 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
| 16 #include "chrome/browser/extensions/api/file_handlers/app_file_handler_util.h" | 17 #include "chrome/browser/extensions/api/file_handlers/app_file_handler_util.h" |
| 17 #include "chrome/browser/extensions/extension_service.h" | 18 #include "chrome/browser/extensions/extension_service.h" |
| 18 #include "chrome/browser/extensions/extension_system.h" | 19 #include "chrome/browser/extensions/extension_system.h" |
| 19 #include "chrome/browser/extensions/shell_window_registry.h" | 20 #include "chrome/browser/extensions/shell_window_registry.h" |
| 20 #include "chrome/browser/platform_util.h" | 21 #include "chrome/browser/platform_util.h" |
| 21 #include "chrome/browser/ui/chrome_select_file_policy.h" | 22 #include "chrome/browser/ui/chrome_select_file_policy.h" |
| 22 #include "chrome/browser/ui/extensions/shell_window.h" | |
| 23 #include "chrome/common/chrome_paths.h" | 23 #include "chrome/common/chrome_paths.h" |
| 24 #include "chrome/common/extensions/api/file_system.h" | 24 #include "chrome/common/extensions/api/file_system.h" |
| 25 #include "chrome/common/extensions/permissions/api_permission.h" | 25 #include "chrome/common/extensions/permissions/api_permission.h" |
| 26 #include "content/public/browser/browser_thread.h" | 26 #include "content/public/browser/browser_thread.h" |
| 27 #include "content/public/browser/child_process_security_policy.h" | 27 #include "content/public/browser/child_process_security_policy.h" |
| 28 #include "content/public/browser/render_process_host.h" | 28 #include "content/public/browser/render_process_host.h" |
| 29 #include "content/public/browser/render_view_host.h" | 29 #include "content/public/browser/render_view_host.h" |
| 30 #include "content/public/browser/web_contents.h" | 30 #include "content/public/browser/web_contents.h" |
| 31 #include "content/public/browser/web_contents_view.h" | 31 #include "content/public/browser/web_contents_view.h" |
| 32 #include "grit/generated_resources.h" | 32 #include "grit/generated_resources.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 43 #include <CoreFoundation/CoreFoundation.h> | 43 #include <CoreFoundation/CoreFoundation.h> |
| 44 #include "base/mac/foundation_util.h" | 44 #include "base/mac/foundation_util.h" |
| 45 #endif | 45 #endif |
| 46 | 46 |
| 47 #if defined(OS_CHROMEOS) | 47 #if defined(OS_CHROMEOS) |
| 48 #include "chrome/browser/chromeos/drive/file_system_util.h" | 48 #include "chrome/browser/chromeos/drive/file_system_util.h" |
| 49 #endif | 49 #endif |
| 50 | 50 |
| 51 using apps::SavedFileEntry; | 51 using apps::SavedFileEntry; |
| 52 using apps::SavedFilesService; | 52 using apps::SavedFilesService; |
| 53 using apps::ShellWindow; |
| 53 using fileapi::IsolatedContext; | 54 using fileapi::IsolatedContext; |
| 54 | 55 |
| 55 const char kInvalidParameters[] = "Invalid parameters"; | 56 const char kInvalidParameters[] = "Invalid parameters"; |
| 56 const char kSecurityError[] = "Security error"; | 57 const char kSecurityError[] = "Security error"; |
| 57 const char kInvalidCallingPage[] = "Invalid calling page. This function can't " | 58 const char kInvalidCallingPage[] = "Invalid calling page. This function can't " |
| 58 "be called from a background page."; | 59 "be called from a background page."; |
| 59 const char kUserCancelled[] = "User cancelled"; | 60 const char kUserCancelled[] = "User cancelled"; |
| 60 const char kWritableFileError[] = | 61 const char kWritableFileError[] = |
| 61 "Cannot write to file in a restricted location"; | 62 "Cannot write to file in a restricted location"; |
| 62 const char kRequiresFileSystemWriteError[] = | 63 const char kRequiresFileSystemWriteError[] = |
| (...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 841 // ID that was passed to restoreEntry. | 842 // ID that was passed to restoreEntry. |
| 842 RegisterFileSystemAndSendResponseWithIdOverride( | 843 RegisterFileSystemAndSendResponseWithIdOverride( |
| 843 file_entry->path, | 844 file_entry->path, |
| 844 file_entry->writable ? WRITABLE : READ_ONLY, | 845 file_entry->writable ? WRITABLE : READ_ONLY, |
| 845 file_entry->id); | 846 file_entry->id); |
| 846 } | 847 } |
| 847 return true; | 848 return true; |
| 848 } | 849 } |
| 849 | 850 |
| 850 } // namespace extensions | 851 } // namespace extensions |
| OLD | NEW |