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

Unified Diff: chrome/renderer/chrome_render_view_observer.cc

Issue 10928188: Enable web components for shell windows based on their render view type, rather than their origin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit Created 8 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/chrome_render_view_observer.cc
diff --git a/chrome/renderer/chrome_render_view_observer.cc b/chrome/renderer/chrome_render_view_observer.cc
index ec514b4618a26c1d08db60ec447962ff34dd8312..98cb8278b1d42948f35f9aa257dff7932cac2c03 100644
--- a/chrome/renderer/chrome_render_view_observer.cc
+++ b/chrome/renderer/chrome_render_view_observer.cc
@@ -22,6 +22,7 @@
#include "chrome/renderer/chrome_render_process_observer.h"
#include "chrome/renderer/content_settings_observer.h"
#include "chrome/renderer/extensions/dispatcher.h"
+#include "chrome/renderer/extensions/extension_helper.h"
#include "chrome/renderer/external_host_bindings.h"
#include "chrome/renderer/frame_sniffer.h"
#include "chrome/renderer/prerender/prerender_helper.h"
@@ -530,6 +531,15 @@ bool ChromeRenderViewObserver::allowWebComponents(const WebDocument& document,
if (extension->HasAPIPermission(APIPermission::kExperimental))
return true;
+ } else {
+ // When a packaged app opens a window with a sandboxed resource, the origin
+ // will be unique (i.e. the empty string), so the fact that it is a shell
+ // window must be deduced from the view type instead to enable web
+ // components for HTML titlebars.
+ extensions::ExtensionHelper* helper =
+ extensions::ExtensionHelper::Get(render_view());
+ if (helper->view_type() == chrome::VIEW_TYPE_APP_SHELL)
+ return true;
}
return false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698