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, |