| 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 #include "chrome/browser/chromeos/extensions/file_manager_util.h" | 4 #include "chrome/browser/chromeos/extensions/file_manager_util.h" |
| 5 | 5 |
| 6 #include "base/bind.h" | 6 #include "base/bind.h" |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
| 9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 587 // to the file system. Do it now. | 587 // to the file system. Do it now. |
| 588 fileapi::ExternalFileSystemMountPointProvider* external_provider = | 588 fileapi::ExternalFileSystemMountPointProvider* external_provider = |
| 589 BrowserContext::GetDefaultStoragePartition( | 589 BrowserContext::GetDefaultStoragePartition( |
| 590 profile)->GetFileSystemContext()->external_provider(); | 590 profile)->GetFileSystemContext()->external_provider(); |
| 591 if (!external_provider) | 591 if (!external_provider) |
| 592 return false; | 592 return false; |
| 593 external_provider->GrantFullAccessToExtension(source_url.host()); | 593 external_provider->GrantFullAccessToExtension(source_url.host()); |
| 594 | 594 |
| 595 std::vector<GURL> urls; | 595 std::vector<GURL> urls; |
| 596 urls.push_back(url); | 596 urls.push_back(url); |
| 597 scoped_refptr<FileTaskExecutor> executor = FileTaskExecutor::Create( | 597 scoped_refptr<FileTaskExecutor> executor = FileTaskExecutor::Create(profile, |
| 598 profile, source_url, extension_id, action_id); | 598 source_url, extension_id, file_handler_util::kTaskFile, action_id); |
| 599 executor->Execute(urls); | 599 executor->Execute(urls); |
| 600 return true; | 600 return true; |
| 601 } | 601 } |
| 602 return ExecuteBuiltinHandler(browser, path, std::string()); | 602 return ExecuteBuiltinHandler(browser, path, std::string()); |
| 603 } | 603 } |
| 604 | 604 |
| 605 void ViewFile(const FilePath& path) { | 605 void ViewFile(const FilePath& path) { |
| 606 Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord(); | 606 Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord(); |
| 607 if (!ExecuteDefaultHandler(profile, path)) | 607 if (!ExecuteDefaultHandler(profile, path)) |
| 608 ShowWarningMessageBox(profile, path); | 608 ShowWarningMessageBox(profile, path); |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 800 scoped_ptr<ListValue> result_list(new ListValue()); | 800 scoped_ptr<ListValue> result_list(new ListValue()); |
| 801 for (gdata::OperationProgressStatusList::const_iterator iter = list.begin(); | 801 for (gdata::OperationProgressStatusList::const_iterator iter = list.begin(); |
| 802 iter != list.end(); ++iter) { | 802 iter != list.end(); ++iter) { |
| 803 result_list->Append( | 803 result_list->Append( |
| 804 ProgessStatusToDictionaryValue(profile, origin_url, *iter)); | 804 ProgessStatusToDictionaryValue(profile, origin_url, *iter)); |
| 805 } | 805 } |
| 806 return result_list.release(); | 806 return result_list.release(); |
| 807 } | 807 } |
| 808 | 808 |
| 809 } // namespace file_manager_util | 809 } // namespace file_manager_util |
| OLD | NEW |