Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(302)

Side by Side Diff: chrome/browser/chromeos/extensions/file_manager/private_api_tasks.cc

Issue 1872223002: Add verbs API to file handlers. Modify the Chrome OS UI so that it displayes the internationalized … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move back to "open-with" for the id of the more actions dialog, as it breaks some browsers tests, a… Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 // Convert the tasks into JSON compatible objects. 198 // Convert the tasks into JSON compatible objects.
199 using api::file_manager_private::FileTask; 199 using api::file_manager_private::FileTask;
200 std::vector<FileTask> results; 200 std::vector<FileTask> results;
201 for (const file_manager::file_tasks::FullTaskDescriptor& task : *tasks) { 201 for (const file_manager::file_tasks::FullTaskDescriptor& task : *tasks) {
202 FileTask converted; 202 FileTask converted;
203 converted.task_id = 203 converted.task_id =
204 file_manager::file_tasks::TaskDescriptorToId(task.task_descriptor()); 204 file_manager::file_tasks::TaskDescriptorToId(task.task_descriptor());
205 if (!task.icon_url().is_empty()) 205 if (!task.icon_url().is_empty())
206 converted.icon_url = task.icon_url().spec(); 206 converted.icon_url = task.icon_url().spec();
207 converted.title = task.task_title(); 207 converted.title = task.task_title();
208 converted.verb = task.task_verb();
208 converted.is_default = task.is_default(); 209 converted.is_default = task.is_default();
209 converted.is_generic_file_handler = task.is_generic_file_handler(); 210 converted.is_generic_file_handler = task.is_generic_file_handler();
210 results.push_back(std::move(converted)); 211 results.push_back(std::move(converted));
211 } 212 }
212 213
213 results_ = extensions::api::file_manager_private_internal::GetFileTasks:: 214 results_ = extensions::api::file_manager_private_internal::GetFileTasks::
214 Results::Create(results); 215 Results::Create(results);
215 SendResponse(true); 216 SendResponse(true);
216 } 217 }
217 218
(...skipping 21 matching lines...) Expand all
239 SetResult(base::MakeUnique<base::FundamentalValue>(true)); 240 SetResult(base::MakeUnique<base::FundamentalValue>(true));
240 return true; 241 return true;
241 } 242 }
242 243
243 file_manager::file_tasks::UpdateDefaultTask( 244 file_manager::file_tasks::UpdateDefaultTask(
244 GetProfile()->GetPrefs(), params->task_id, suffixes, mime_types); 245 GetProfile()->GetPrefs(), params->task_id, suffixes, mime_types);
245 return true; 246 return true;
246 } 247 }
247 248
248 } // namespace extensions 249 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698