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

Unified Diff: chrome/browser/extensions/api/app_runtime/app_runtime_api.cc

Issue 23847004: "Redirecting URLs to Packaged Apps" implementation: revised (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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
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 b976dc7f9a8892ed3667d109c87921a7825ce489..f48164d9d3bae381daa23aba3729225e227f52b5 100644
--- a/chrome/browser/extensions/api/app_runtime/app_runtime_api.cc
+++ b/chrome/browser/extensions/api/app_runtime/app_runtime_api.cc
@@ -61,6 +61,8 @@ void AppEventRouter::DispatchOnLaunchedEventWithFileEntry(
Profile* profile, const Extension* extension,
const std::string& handler_id, const std::string& mime_type,
const extensions::app_file_handler_util::GrantedFileEntry& file_entry) {
+ // TODO(sergeygs): Use the same way of creating an event (using the generated
+ // boilerplate) as below in DispatchOnLaunchedEventWithUrl.
scoped_ptr<base::ListValue> args(new base::ListValue());
base::DictionaryValue* launch_data = new base::DictionaryValue();
launch_data->SetString("id", handler_id);
@@ -76,4 +78,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) {
+ api::app_runtime::LaunchData launch_data;
+ launch_data.id.reset(new std::string(handler_id));
+ launch_data.url.reset(new std::string(url.spec()));
+ launch_data.referrer_url.reset(new std::string(referrer_url.spec()));
+ scoped_ptr<ListValue> args(new ListValue());
+ args->Append(launch_data.ToValue().release());
+ DispatchOnLaunchedEventImpl(extension->id(), args.Pass(), profile);
+}
+
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698