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

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: fix native view bit 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..215f891180d396be34ed0747fc0dac2d25267eb0 100644
--- a/chrome/browser/ui/autofill/chrome_autofill_client.cc
+++ b/chrome/browser/ui/autofill/chrome_autofill_client.cc
@@ -30,6 +30,7 @@
#include "components/autofill/core/common/autofill_pref_names.h"
#include "components/password_manager/content/browser/content_password_manager_driver.h"
#include "content/public/browser/render_frame_host.h"
+#include "extensions/browser/guest_view/web_view/web_view_guest.h"
#include "ui/gfx/geometry/rect.h"
#if defined(OS_ANDROID)
@@ -185,12 +186,20 @@ void ChromeAutofillClient::ShowAutofillPopup(
gfx::RectF element_bounds_in_screen_space =
element_bounds + client_area.OffsetFromOrigin();
+ // If the webcontents is inside a webview, use the embedder's native view,
lazyboy 2015/02/05 00:39:50 s/webcontents/WebContents s/webview/<webview>
noms (inactive) 2015/02/05 02:50:33 Done.
+ // since the webview does not have its own native view.
+ gfx::NativeView container_view;
+ if (extensions::WebViewGuest::FromWebContents(web_contents()))
lazyboy 2015/02/05 00:43:56 #if defined(ENABLE_EXTENSIONS) this call and the h
noms (inactive) 2015/02/05 02:50:33 Yup, just noticed that. Done.
+ container_view = web_contents()->GetContentNativeView();
+ else
+ container_view = web_contents()->GetNativeView();
+
// Will delete or reuse the old |popup_controller_|.
popup_controller_ =
AutofillPopupControllerImpl::GetOrCreate(popup_controller_,
delegate,
web_contents(),
- web_contents()->GetNativeView(),
+ 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