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 d34482d41d498f16274bf8b686dfa486c6480dfe..41f2aaac04d8301b7b0c872a2656b25f2ec994c2 100644 |
--- a/chrome/browser/ui/autofill/chrome_autofill_client.cc |
+++ b/chrome/browser/ui/autofill/chrome_autofill_client.cc |
@@ -18,7 +18,6 @@ |
#include "chrome/browser/ui/browser_window.h" |
#include "chrome/browser/ui/chrome_pages.h" |
#include "chrome/browser/ui/tabs/tab_strip_model_observer.h" |
-#include "chrome/browser/ui/zoom/zoom_controller.h" |
#include "chrome/browser/webdata/web_data_service_factory.h" |
#include "chrome/common/url_constants.h" |
#include "components/autofill/content/browser/content_autofill_driver.h" |
@@ -30,6 +29,8 @@ |
#if defined(OS_ANDROID) |
#include "chrome/browser/android/chromium_application.h" |
#include "chrome/browser/ui/android/autofill/autofill_logger_android.h" |
+#else |
+#include "chrome/browser/ui/zoom/zoom_controller.h" |
#endif |
DEFINE_WEB_CONTENTS_USER_DATA_KEY(autofill::ChromeAutofillClient); |
@@ -39,6 +40,8 @@ namespace autofill { |
ChromeAutofillClient::ChromeAutofillClient(content::WebContents* web_contents) |
: content::WebContentsObserver(web_contents), web_contents_(web_contents) { |
DCHECK(web_contents); |
+ |
+#if !defined(OS_ANDROID) |
// Since ZoomController is also a WebContentsObserver, we need to be careful |
// about disconnecting from it since the relative order of destruction of |
// WebContentsObservers is not guaranteed. ZoomController silently clears |
@@ -46,9 +49,11 @@ ChromeAutofillClient::ChromeAutofillClient(content::WebContents* web_contents) |
// to explicitly remove ourselves on destruction. |
ZoomController* zoom_controller = |
ZoomController::FromWebContents(web_contents); |
- // There may not always be a ZoomController, e.g. on Android. |
+ // There may not always be a ZoomController, e.g. in tests. |
if (zoom_controller) |
zoom_controller->AddObserver(this); |
+#endif |
+ |
#if defined(OS_MACOSX) && !defined(OS_IOS) |
RegisterForKeystoneNotifications(); |
#endif // defined(OS_MACOSX) && !defined(OS_IOS) |