Chromium Code Reviews| Index: chrome/browser/extensions/api/app_runtime/app_runtime_api.cc |
| diff --git a/chrome/browser/extensions/api/app_runtime/app_runtime_api.cc b/chrome/browser/extensions/api/app_runtime/app_runtime_api.cc |
| index 10e29f57551c4e5354aee6314c9481470ff96175..761a6ee47f9e802800930d28b1afd03274892225 100644 |
| --- a/chrome/browser/extensions/api/app_runtime/app_runtime_api.cc |
| +++ b/chrome/browser/extensions/api/app_runtime/app_runtime_api.cc |
| @@ -48,8 +48,8 @@ void DispatchOnLaunchedEventImpl(const std::string& extension_id, |
| // static. |
| void AppEventRouter::DispatchOnLaunchedEvent( |
| Profile* profile, const Extension* extension) { |
| - scoped_ptr<ListValue> arguments(new ListValue()); |
| - DispatchOnLaunchedEventImpl(extension->id(), arguments.Pass(), profile); |
| + scoped_ptr<ListValue> args(new ListValue()); |
| + DispatchOnLaunchedEventImpl(extension->id(), args.Pass(), profile); |
| } |
| DictionaryValue* DictionaryFromSavedFileEntry( |
| @@ -82,9 +82,12 @@ void AppEventRouter::DispatchOnRestartedEvent( |
| // static. |
| void AppEventRouter::DispatchOnLaunchedEventWithFileEntry( |
| - Profile* profile, const Extension* extension, |
| - const std::string& handler_id, const std::string& mime_type, |
| - const std::string& file_system_id, const std::string& base_name) { |
| + Profile* profile, |
| + const Extension* extension, |
| + const std::string& handler_id, |
| + const std::string& mime_type, |
| + const std::string& file_system_id, |
| + const std::string& base_name) { |
| scoped_ptr<ListValue> args(new ListValue()); |
| DictionaryValue* launch_data = new DictionaryValue(); |
| launch_data->SetString("id", handler_id); |
| @@ -99,4 +102,20 @@ void AppEventRouter::DispatchOnLaunchedEventWithFileEntry( |
| DispatchOnLaunchedEventImpl(extension->id(), args.Pass(), profile); |
| } |
| +// static. |
| +void AppEventRouter::DispatchOnLaunchedEventWithURL( |
| + Profile* profile, |
| + const Extension* extension, |
| + const std::string& handler_id, |
| + const GURL& url, |
| + const GURL& referrer_url) { |
| + scoped_ptr<ListValue> args(new ListValue()); |
| + DictionaryValue* launch_data = new DictionaryValue(); |
| + launch_data->SetString("id", handler_id); |
| + launch_data->SetString("url", url.spec()); |
| + launch_data->SetString("referrerUrl", referrer_url.spec()); |
| + args->Append(launch_data); |
| + DispatchOnLaunchedEventImpl(extension->id(), args.Pass(), profile); |
|
not at google - send to devlin
2013/08/19 23:32:24
Cleanup: we generate the event value boilerplate,
sergeygs
2013/08/29 08:24:42
Done. Added TODOs for the rest, will fix after thi
|
| +} |
| + |
| } // namespace extensions |