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

Side by Side Diff: chrome/browser/extensions/api/app_runtime/app_runtime_api.cc

Issue 14912009: Support getEntryId for entries passed to apps as launch data. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 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 (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 4
5 #include "chrome/browser/extensions/api/app_runtime/app_runtime_api.h" 5 #include "chrome/browser/extensions/api/app_runtime/app_runtime_api.h"
6 6
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/string16.h" 8 #include "base/string16.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 scoped_ptr<Event> event(new Event(kOnRestarted, arguments.Pass())); 77 scoped_ptr<Event> event(new Event(kOnRestarted, arguments.Pass()));
78 event->restrict_to_profile = profile; 78 event->restrict_to_profile = profile;
79 extensions::ExtensionSystem::Get(profile)->event_router()-> 79 extensions::ExtensionSystem::Get(profile)->event_router()->
80 DispatchEventToExtension(extension->id(), event.Pass()); 80 DispatchEventToExtension(extension->id(), event.Pass());
81 } 81 }
82 82
83 // static. 83 // static.
84 void AppEventRouter::DispatchOnLaunchedEventWithFileEntry( 84 void AppEventRouter::DispatchOnLaunchedEventWithFileEntry(
85 Profile* profile, const Extension* extension, 85 Profile* profile, const Extension* extension,
86 const std::string& handler_id, const std::string& mime_type, 86 const std::string& handler_id, const std::string& mime_type,
87 const std::string& file_system_id, const std::string& base_name) { 87 const extensions::app_file_handler_util::GrantedFileEntry& file_entry) {
88 scoped_ptr<ListValue> args(new ListValue()); 88 scoped_ptr<ListValue> args(new ListValue());
89 DictionaryValue* launch_data = new DictionaryValue(); 89 DictionaryValue* launch_data = new DictionaryValue();
90 launch_data->SetString("id", handler_id); 90 launch_data->SetString("id", handler_id);
91 DictionaryValue* launch_item = new DictionaryValue; 91 DictionaryValue* launch_item = new DictionaryValue;
92 launch_item->SetString("fileSystemId", file_system_id); 92 launch_item->SetString("fileSystemId", file_entry.filesystem_id);
93 launch_item->SetString("baseName", base_name); 93 launch_item->SetString("baseName", file_entry.registered_name);
94 launch_item->SetString("mimeType", mime_type); 94 launch_item->SetString("mimeType", mime_type);
95 launch_item->SetString("entryId", file_entry.id);
95 ListValue* items = new ListValue; 96 ListValue* items = new ListValue;
96 items->Append(launch_item); 97 items->Append(launch_item);
97 launch_data->Set("items", items); 98 launch_data->Set("items", items);
98 args->Append(launch_data); 99 args->Append(launch_data);
99 DispatchOnLaunchedEventImpl(extension->id(), args.Pass(), profile); 100 DispatchOnLaunchedEventImpl(extension->id(), args.Pass(), profile);
100 } 101 }
101 102
102 } // namespace extensions 103 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/app_runtime/app_runtime_api.h ('k') | chrome/browser/extensions/platform_app_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698