| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/chromeos/extensions/file_manager/private_api_tasks.h" | 5 #include "chrome/browser/chromeos/extensions/file_manager/private_api_tasks.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 converted->icon_url = task.icon_url().spec(); | 227 converted->icon_url = task.icon_url().spec(); |
| 228 converted->title = task.task_title(); | 228 converted->title = task.task_title(); |
| 229 converted->is_default = task.is_default(); | 229 converted->is_default = task.is_default(); |
| 230 results.push_back(converted); | 230 results.push_back(converted); |
| 231 } | 231 } |
| 232 results_ = extensions::api::file_browser_private::GetFileTasks::Results:: | 232 results_ = extensions::api::file_browser_private::GetFileTasks::Results:: |
| 233 Create(results); | 233 Create(results); |
| 234 SendResponse(true); | 234 SendResponse(true); |
| 235 } | 235 } |
| 236 | 236 |
| 237 bool FileBrowserPrivateSetDefaultTaskFunction::RunImpl() { | 237 bool FileBrowserPrivateSetDefaultTaskFunction::RunSync() { |
| 238 using extensions::api::file_browser_private::SetDefaultTask::Params; | 238 using extensions::api::file_browser_private::SetDefaultTask::Params; |
| 239 const scoped_ptr<Params> params(Params::Create(*args_)); | 239 const scoped_ptr<Params> params(Params::Create(*args_)); |
| 240 EXTENSION_FUNCTION_VALIDATE(params); | 240 EXTENSION_FUNCTION_VALIDATE(params); |
| 241 | 241 |
| 242 const scoped_refptr<fileapi::FileSystemContext> file_system_context = | 242 const scoped_refptr<fileapi::FileSystemContext> file_system_context = |
| 243 file_manager::util::GetFileSystemContextForRenderViewHost( | 243 file_manager::util::GetFileSystemContextForRenderViewHost( |
| 244 GetProfile(), render_view_host()); | 244 GetProfile(), render_view_host()); |
| 245 | 245 |
| 246 const std::set<std::string> suffixes = | 246 const std::set<std::string> suffixes = |
| 247 GetUniqueSuffixes(params->file_urls, file_system_context.get()); | 247 GetUniqueSuffixes(params->file_urls, file_system_context.get()); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 264 SetResult(new base::FundamentalValue(true)); | 264 SetResult(new base::FundamentalValue(true)); |
| 265 return true; | 265 return true; |
| 266 } | 266 } |
| 267 | 267 |
| 268 file_manager::file_tasks::UpdateDefaultTask( | 268 file_manager::file_tasks::UpdateDefaultTask( |
| 269 GetProfile()->GetPrefs(), params->task_id, suffixes, mime_types); | 269 GetProfile()->GetPrefs(), params->task_id, suffixes, mime_types); |
| 270 return true; | 270 return true; |
| 271 } | 271 } |
| 272 | 272 |
| 273 } // namespace extensions | 273 } // namespace extensions |
| OLD | NEW |