Index: chrome/browser/ui/autofill/chrome_autofill_client.cc |
diff --git a/chrome/browser/ui/autofill/chrome_autofill_client.cc b/chrome/browser/ui/autofill/chrome_autofill_client.cc |
index 37c8c48ec95f0cb0bda949838cf64c5b8f4254a0..5fb5e50ec30a9dc945787073a65825f2a0230ba8 100644 |
--- a/chrome/browser/ui/autofill/chrome_autofill_client.cc |
+++ b/chrome/browser/ui/autofill/chrome_autofill_client.cc |
@@ -40,6 +40,10 @@ |
#include "components/ui/zoom/zoom_controller.h" |
#endif |
+#if defined(ENABLE_EXTENSIONS) |
+#include "extensions/browser/guest_view/web_view/web_view_guest.h" |
+#endif |
+ |
DEFINE_WEB_CONTENTS_USER_DATA_KEY(autofill::ChromeAutofillClient); |
namespace autofill { |
@@ -185,12 +189,20 @@ void ChromeAutofillClient::ShowAutofillPopup( |
gfx::RectF element_bounds_in_screen_space = |
element_bounds + client_area.OffsetFromOrigin(); |
+ gfx::NativeView container_view = web_contents()->GetNativeView(); |
+ // If the WebContents is inside a <webview>, use the embedder's native view, |
+ // since the <webview> does not have its own native view. |
+#if defined(ENABLE_EXTENSIONS) |
+ if (extensions::WebViewGuest::FromWebContents(web_contents())) |
+ container_view = web_contents()->GetContentNativeView(); |
+#endif |
+ |
// Will delete or reuse the old |popup_controller_|. |
popup_controller_ = |
AutofillPopupControllerImpl::GetOrCreate(popup_controller_, |
delegate, |
web_contents(), |
- web_contents()->GetNativeView(), |
Evan Stade
2015/02/05 03:12:56
when I look at what this view is actually used for
noms (inactive)
2015/02/05 18:56:08
Done. I've tested it on all desktop platforms, and
|
+ container_view, |
element_bounds_in_screen_space, |
text_direction); |