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

Unified Diff: chrome/browser/ui/autofill/chrome_autofill_client.cc

Issue 866523002: [Abandoned] Add Autofill to the <webview> chrome://chrome-signin page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 5 years, 10 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/browser/guest_view/web_view/chrome_web_view_guest_delegate.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698