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

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

Issue 22944002: Implementation of the "Redirect URLs to Packaged Apps" feature. (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 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);
+}
+
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698