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

Unified Diff: chrome/renderer/extensions/dispatcher.cc

Issue 22709003: Enable webview and browser-plugin as custom elements in Chrome Apps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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
« no previous file with comments | « chrome/renderer/extensions/dispatcher.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/extensions/dispatcher.cc
diff --git a/chrome/renderer/extensions/dispatcher.cc b/chrome/renderer/extensions/dispatcher.cc
index 3b2c3efdd37651f99f33890651c8850ee755da35..7433ee2aa0a956212ae50bc91001fdc9604b56f1 100644
--- a/chrome/renderer/extensions/dispatcher.cc
+++ b/chrome/renderer/extensions/dispatcher.cc
@@ -83,9 +83,11 @@
#include "grit/renderer_resources.h"
#include "third_party/WebKit/public/platform/WebString.h"
#include "third_party/WebKit/public/platform/WebURLRequest.h"
+#include "third_party/WebKit/public/web/WebCustomElement.h"
#include "third_party/WebKit/public/web/WebDataSource.h"
#include "third_party/WebKit/public/web/WebDocument.h"
#include "third_party/WebKit/public/web/WebFrame.h"
+#include "third_party/WebKit/public/web/WebRuntimeFeatures.h"
#include "third_party/WebKit/public/web/WebScopedUserGesture.h"
#include "third_party/WebKit/public/web/WebSecurityPolicy.h"
#include "third_party/WebKit/public/web/WebView.h"
@@ -463,6 +465,7 @@ void Dispatcher::WebKitInitialized() {
RenderThread::Get(), &RenderThread::IdleHandler);
}
+ bool is_app = false;
// Initialize host permissions for any extensions that were activated before
// WebKit was initialized.
for (std::set<std::string>::iterator iter = active_extension_ids_.begin();
@@ -470,8 +473,12 @@ void Dispatcher::WebKitInitialized() {
const Extension* extension = extensions_.GetByID(*iter);
CHECK(extension);
InitOriginPermissions(extension);
+ is_app |= extension->is_app();
not at google - send to devlin 2013/08/08 21:20:25 you probably want is_platform_app()
}
+ if (is_app)
+ EnableCustomElementWhiteList();
+
is_webkit_initialized_ = true;
}
@@ -1222,6 +1229,10 @@ void Dispatcher::OnActivateExtension(const std::string& extension_id) {
extension_id,
extension->url(),
string16());
+
+ const Extension* extension = extensions_.GetByID(extension_id);
+ if (extension->is_app())
+ EnableCustomElementWhiteList();
}
}
@@ -1269,6 +1280,14 @@ void Dispatcher::AddOrRemoveOriginPermissions(
}
}
+void Dispatcher::EnableCustomElementWhiteList() {
+ WebKit::WebRuntimeFeatures::enableCustomElements(true);
+ WebKit::WebCustomElement::allowTagName("webview");
+ // TODO(fsamuel): Add <adview> to the whitelist once it has been converted
+ // into a custom element.
+ WebKit::WebCustomElement::allowTagName("browser-plugin");
+}
+
void Dispatcher::AddOrRemoveBindings(const std::string& extension_id) {
v8_context_set().ForEach(
extension_id,
« no previous file with comments | « chrome/renderer/extensions/dispatcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698