| 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 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 // If File Browser has not been open yet then it did not request access | 546 // If File Browser has not been open yet then it did not request access |
| 547 // to the file system. Do it now. | 547 // to the file system. Do it now. |
| 548 fileapi::ExternalFileSystemMountPointProvider* external_provider = | 548 fileapi::ExternalFileSystemMountPointProvider* external_provider = |
| 549 BrowserContext::GetFileSystemContext(profile)->external_provider(); | 549 BrowserContext::GetFileSystemContext(profile)->external_provider(); |
| 550 if (!external_provider) | 550 if (!external_provider) |
| 551 return false; | 551 return false; |
| 552 external_provider->GrantFullAccessToExtension(source_url.host()); | 552 external_provider->GrantFullAccessToExtension(source_url.host()); |
| 553 | 553 |
| 554 std::vector<GURL> urls; | 554 std::vector<GURL> urls; |
| 555 urls.push_back(url); | 555 urls.push_back(url); |
| 556 scoped_refptr<FileTaskExecutor> executor = FileTaskExecutor::Create( | 556 scoped_refptr<FileTaskExecutor> executor = FileTaskExecutor::Create(profile, |
| 557 profile, source_url, extension_id, action_id); | 557 source_url, extension_id, file_handler_util::TASK_FILE, action_id); |
| 558 executor->Execute(urls); | 558 executor->Execute(urls); |
| 559 return true; | 559 return true; |
| 560 } | 560 } |
| 561 return ExecuteBuiltinHandler(browser, path, std::string()); | 561 return ExecuteBuiltinHandler(browser, path, std::string()); |
| 562 } | 562 } |
| 563 | 563 |
| 564 void ViewFile(const FilePath& path) { | 564 void ViewFile(const FilePath& path) { |
| 565 Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord(); | 565 Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord(); |
| 566 if (!ExecuteDefaultHandler(profile, path)) | 566 if (!ExecuteDefaultHandler(profile, path)) |
| 567 ShowWarningMessageBox(profile, path); | 567 ShowWarningMessageBox(profile, path); |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 749 OperationRegistry::ProgressStatus>::const_iterator iter = | 749 OperationRegistry::ProgressStatus>::const_iterator iter = |
| 750 list.begin(); | 750 list.begin(); |
| 751 iter != list.end(); ++iter) { | 751 iter != list.end(); ++iter) { |
| 752 result_list->Append( | 752 result_list->Append( |
| 753 ProgessStatusToDictionaryValue(profile, origin_url, *iter)); | 753 ProgessStatusToDictionaryValue(profile, origin_url, *iter)); |
| 754 } | 754 } |
| 755 return result_list.release(); | 755 return result_list.release(); |
| 756 } | 756 } |
| 757 | 757 |
| 758 } // namespace file_manager_util | 758 } // namespace file_manager_util |
| OLD | NEW |