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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "content/public/browser/child_process_security_policy.h" | 22 #include "content/public/browser/child_process_security_policy.h" |
23 #include "content/public/browser/render_view_host.h" | 23 #include "content/public/browser/render_view_host.h" |
24 #include "content/public/browser/render_process_host.h" | 24 #include "content/public/browser/render_process_host.h" |
25 #include "content/public/browser/web_contents.h" | 25 #include "content/public/browser/web_contents.h" |
26 #include "webkit/fileapi/file_system_types.h" | 26 #include "webkit/fileapi/file_system_types.h" |
27 #include "webkit/fileapi/file_system_util.h" | 27 #include "webkit/fileapi/file_system_util.h" |
28 #include "webkit/fileapi/isolated_context.h" | 28 #include "webkit/fileapi/isolated_context.h" |
29 #include "ui/base/l10n/l10n_util.h" | 29 #include "ui/base/l10n/l10n_util.h" |
30 #include "ui/base/dialogs/select_file_dialog.h" | 30 #include "ui/base/dialogs/select_file_dialog.h" |
31 | 31 |
| 32 #if defined(OS_WIN) |
| 33 #include "base/base_paths_win.h" |
| 34 #elif defined(OS_POSIX) |
| 35 #include "base/base_paths_posix.h" |
| 36 #endif |
| 37 |
32 using fileapi::IsolatedContext; | 38 using fileapi::IsolatedContext; |
33 | 39 |
34 const char kInvalidParameters[] = "Invalid parameters"; | 40 const char kInvalidParameters[] = "Invalid parameters"; |
35 const char kSecurityError[] = "Security error"; | 41 const char kSecurityError[] = "Security error"; |
36 const char kInvalidCallingPage[] = "Invalid calling page"; | 42 const char kInvalidCallingPage[] = "Invalid calling page"; |
37 const char kUserCancelled[] = "User cancelled"; | 43 const char kUserCancelled[] = "User cancelled"; |
38 const char kWritableFileError[] = "Invalid file for writing"; | 44 const char kWritableFileError[] = "Invalid file for writing"; |
39 const char kRequiresFileSystemWriteError[] = | 45 const char kRequiresFileSystemWriteError[] = |
40 "Operation requires fileSystemWrite permission"; | 46 "Operation requires fileSystemWrite permission"; |
41 const char kUnknownChooseFileType[] = "Unknown type"; | 47 const char kUnknownChooseFileType[] = "Unknown type"; |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 | 552 |
547 if (entry_type == WRITABLE && !HasFileSystemWritePermission()) { | 553 if (entry_type == WRITABLE && !HasFileSystemWritePermission()) { |
548 error_ = kRequiresFileSystemWriteError; | 554 error_ = kRequiresFileSystemWriteError; |
549 return false; | 555 return false; |
550 } | 556 } |
551 | 557 |
552 return ShowPicker(suggested_name, file_type_info, picker_type, entry_type); | 558 return ShowPicker(suggested_name, file_type_info, picker_type, entry_type); |
553 } | 559 } |
554 | 560 |
555 } // namespace extensions | 561 } // namespace extensions |
OLD | NEW |