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

Unified Diff: apps/browser/api/app_runtime/app_runtime_api.cc

Issue 300063006: Files.app: Let Files.app pass mutliple files to file handlers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « apps/browser/api/app_runtime/app_runtime_api.h ('k') | apps/launcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: apps/browser/api/app_runtime/app_runtime_api.cc
diff --git a/apps/browser/api/app_runtime/app_runtime_api.cc b/apps/browser/api/app_runtime/app_runtime_api.cc
index 65ebf61dda74308f3db71f02f23a1e20ca88d582..68be58857542eef543e01fc834704b0175d8501f 100644
--- a/apps/browser/api/app_runtime/app_runtime_api.cc
+++ b/apps/browser/api/app_runtime/app_runtime_api.cc
@@ -65,23 +65,26 @@ void AppEventRouter::DispatchOnRestartedEvent(BrowserContext* context,
}
// static.
-void AppEventRouter::DispatchOnLaunchedEventWithFileEntry(
+void AppEventRouter::DispatchOnLaunchedEventWithFileEntries(
BrowserContext* context,
const Extension* extension,
const std::string& handler_id,
- const std::string& mime_type,
- const file_handler_util::GrantedFileEntry& file_entry) {
+ const std::vector<std::string>& mime_types,
+ const std::vector<file_handler_util::GrantedFileEntry>& file_entries) {
// TODO(sergeygs): Use the same way of creating an event (using the generated
// boilerplate) as below in DispatchOnLaunchedEventWithUrl.
scoped_ptr<base::DictionaryValue> launch_data(new base::DictionaryValue);
launch_data->SetString("id", handler_id);
- scoped_ptr<base::DictionaryValue> launch_item(new base::DictionaryValue);
- launch_item->SetString("fileSystemId", file_entry.filesystem_id);
- launch_item->SetString("baseName", file_entry.registered_name);
- launch_item->SetString("mimeType", mime_type);
- launch_item->SetString("entryId", file_entry.id);
scoped_ptr<base::ListValue> items(new base::ListValue);
- items->Append(launch_item.release());
+ DCHECK(file_entries.size() == mime_types.size());
+ for (size_t i = 0; i < file_entries.size(); ++i) {
+ scoped_ptr<base::DictionaryValue> launch_item(new base::DictionaryValue);
+ launch_item->SetString("fileSystemId", file_entries[i].filesystem_id);
+ launch_item->SetString("baseName", file_entries[i].registered_name);
+ launch_item->SetString("mimeType", mime_types[i]);
+ launch_item->SetString("entryId", file_entries[i].id);
+ items->Append(launch_item.release());
+ }
launch_data->Set("items", items.release());
DispatchOnLaunchedEventImpl(extension->id(), launch_data.Pass(), context);
}
« no previous file with comments | « apps/browser/api/app_runtime/app_runtime_api.h ('k') | apps/launcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698