| 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 "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 fileapi::IsolatedContext* isolated_context = | 398 fileapi::IsolatedContext* isolated_context = |
| 399 fileapi::IsolatedContext::GetInstance(); | 399 fileapi::IsolatedContext::GetInstance(); |
| 400 DCHECK(isolated_context); | 400 DCHECK(isolated_context); |
| 401 | 401 |
| 402 bool writable = entry_type == WRITABLE; | 402 bool writable = entry_type == WRITABLE; |
| 403 extensions::app_file_handler_util::GrantedFileEntry file_entry = | 403 extensions::app_file_handler_util::GrantedFileEntry file_entry = |
| 404 extensions::app_file_handler_util::CreateFileEntry(profile(), | 404 extensions::app_file_handler_util::CreateFileEntry(profile(), |
| 405 GetExtension()->id(), render_view_host_->GetProcess()->GetID(), path, | 405 GetExtension()->id(), render_view_host_->GetProcess()->GetID(), path, |
| 406 writable); | 406 writable); |
| 407 | 407 |
| 408 DictionaryValue* dict = new DictionaryValue(); | 408 base::DictionaryValue* dict = new base::DictionaryValue(); |
| 409 SetResult(dict); | 409 SetResult(dict); |
| 410 dict->SetString("fileSystemId", file_entry.filesystem_id); | 410 dict->SetString("fileSystemId", file_entry.filesystem_id); |
| 411 dict->SetString("baseName", file_entry.registered_name); | 411 dict->SetString("baseName", file_entry.registered_name); |
| 412 if (id.empty()) | 412 if (id.empty()) |
| 413 dict->SetString("id", file_entry.id); | 413 dict->SetString("id", file_entry.id); |
| 414 else | 414 else |
| 415 dict->SetString("id", id); | 415 dict->SetString("id", id); |
| 416 | 416 |
| 417 SendResponse(true); | 417 SendResponse(true); |
| 418 } | 418 } |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 841 // ID that was passed to restoreEntry. | 841 // ID that was passed to restoreEntry. |
| 842 RegisterFileSystemAndSendResponseWithIdOverride( | 842 RegisterFileSystemAndSendResponseWithIdOverride( |
| 843 file_entry->path, | 843 file_entry->path, |
| 844 file_entry->writable ? WRITABLE : READ_ONLY, | 844 file_entry->writable ? WRITABLE : READ_ONLY, |
| 845 file_entry->id); | 845 file_entry->id); |
| 846 } | 846 } |
| 847 return true; | 847 return true; |
| 848 } | 848 } |
| 849 | 849 |
| 850 } // namespace extensions | 850 } // namespace extensions |
| OLD | NEW |