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

Unified Diff: chrome/browser/extensions/api/guest_view/guest_view_internal_api.cc

Issue 453613002: Implement support for <extensionoptions> embedding in WebUI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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/guest_view/guest_view_internal_api.cc
diff --git a/chrome/browser/extensions/api/guest_view/guest_view_internal_api.cc b/chrome/browser/extensions/api/guest_view/guest_view_internal_api.cc
index 7765d9b428effee7c37bdf42fb4f0ed98ce87f49..39f31d45788a94855b546e39564f2ab0d411f31e 100644
--- a/chrome/browser/extensions/api/guest_view/guest_view_internal_api.cc
+++ b/chrome/browser/extensions/api/guest_view/guest_view_internal_api.cc
@@ -33,8 +33,17 @@ bool GuestViewInternalCreateGuestFunction::RunAsync() {
GuestViewManager::WebContentsCreatedCallback callback =
base::Bind(&GuestViewInternalCreateGuestFunction::CreateGuestCallback,
this);
+
+ // If this the guest is an <extensionoptions> to be embedded in a WebUI, then
+ // there is no extension, and extension() will be null. Use an empty string
not at google - send to devlin 2014/08/07 23:06:02 this shouldn't be necessary after https://coderevi
ericzeng 2014/08/08 00:23:46 I'm not sure if that's the case. ExtensionFunction
not at google - send to devlin 2014/08/08 14:08:15 ah you're right, my bad sorry. 1 last nit: the la
+ // instead.
+ std::string embedder_extension_id = "";
Fady Samuel 2014/08/07 23:09:29 no need for initializer.
ericzeng 2014/08/08 00:23:46 Done.
+ if (extension()) {
Fady Samuel 2014/08/07 23:09:29 No need for braces.
ericzeng 2014/08/08 00:23:46 Done.
+ embedder_extension_id = extension_id();
+ }
+
guest_view_manager->CreateGuest(view_type,
- extension_id(),
+ embedder_extension_id,
render_view_host()->GetProcess()->GetID(),
*create_params,
callback);

Powered by Google App Engine
This is Rietveld 408576698