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

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

Issue 354483004: Implement <appview> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@app_view_skeleton
Patch Set: Fixed formatting Created 6 years, 5 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: extensions/browser/api/app_runtime/app_runtime_api.cc
diff --git a/extensions/browser/api/app_runtime/app_runtime_api.cc b/extensions/browser/api/app_runtime/app_runtime_api.cc
index cb93a85c27227ae0ffdcc699949544f1da344a46..0ba19fb0cd0162c7ccf14aec6f5de0f10e046ae6 100644
--- a/extensions/browser/api/app_runtime/app_runtime_api.cc
+++ b/extensions/browser/api/app_runtime/app_runtime_api.cc
@@ -8,6 +8,7 @@
#include "base/values.h"
#include "extensions/browser/event_router.h"
#include "extensions/browser/extension_prefs.h"
+#include "extensions/browser/extension_system.h"
#include "extensions/browser/extensions_browser_client.h"
#include "extensions/browser/granted_file_entry.h"
#include "extensions/common/api/app_runtime.h"
@@ -21,6 +22,24 @@ namespace app_runtime = core_api::app_runtime;
namespace {
+void DispatchOnEmbedRequestedEventImpl(
+ const std::string& extension_id,
+ scoped_ptr<base::DictionaryValue> app_embedding_request_data,
+ content::BrowserContext* context) {
+ scoped_ptr<base::ListValue> args(new base::ListValue());
+ args->Append(app_embedding_request_data.release());
+ ExtensionSystem* system = ExtensionSystem::Get(context);
+ scoped_ptr<Event> event(
+ new Event(app_runtime::OnEmbedRequested::kEventName, args.Pass()));
+ event->restrict_to_browser_context = context;
+ event->can_load_ephemeral_apps = true;
+ system->event_router()->DispatchEventWithLazyListener(extension_id,
+ event.Pass());
+
+ ExtensionPrefs::Get(context)
+ ->SetLastLaunchTime(extension_id, base::Time::Now());
+}
+
void DispatchOnLaunchedEventImpl(const std::string& extension_id,
scoped_ptr<base::DictionaryValue> launch_data,
BrowserContext* context) {
@@ -43,6 +62,15 @@ void DispatchOnLaunchedEventImpl(const std::string& extension_id,
} // namespace
// static
+void AppRuntimeEventRouter::DispatchOnEmbedRequestedEvent(
+ content::BrowserContext* context,
+ scoped_ptr<base::DictionaryValue> embed_app_data,
+ const Extension* extension) {
+ DispatchOnEmbedRequestedEventImpl(
+ extension->id(), embed_app_data.Pass(), context);
+}
+
+// static
void AppRuntimeEventRouter::DispatchOnLaunchedEvent(
BrowserContext* context,
const Extension* extension) {
« no previous file with comments | « extensions/browser/api/app_runtime/app_runtime_api.h ('k') | extensions/browser/api/app_view/app_view_internal_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698