Stop compiling password infobar code on Mac.

BUG=580535

Review-Url: https://codereview.chromium.org/1978563002
Cr-Commit-Position: refs/heads/master@{#393470}
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index 2ebda5c1..bd9d98b 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -5271,12 +5271,6 @@
       <message name="IDS_FLAGS_PRINT_PREVIEW_REGISTER_PROMOS_DESCRIPTION">
         Enable registering unregistered cloud printers from print preview.
       </message>
-      <message name="IDS_FLAGS_SAVE_PASSWORD_BUBBLE_NAME">
-        Save Password Bubble UI
-      </message>
-      <message name="IDS_FLAGS_SAVE_PASSWORD_BUBBLE_DESCRIPTION">
-        Enable experimental bubble-based UI for saving passwords; replaces the existing infobar.
-      </message>
       <message name="IDS_FLAGS_SCROLL_PREDICTION_NAME" desc="Title of the flag which enables scroll prediction.">
         Scroll prediction
       </message>
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index a92b546..c30c2b6 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -440,12 +440,6 @@
       "//chrome/browser/apps/app_shim",
     ]
   }
-  if (is_mac || is_android) {
-    sources += rebase_path(
-            gypi_values.chrome_browser_password_manager_mac_android_sources,
-            ".",
-            "//chrome")
-  }
   if (enable_extensions) {
     public_deps += [ "//chrome/browser/extensions" ]
     deps += [
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index 9c1beebe..2476865 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -1292,12 +1292,6 @@
     {"inert-visual-viewport", IDS_FLAGS_INERT_VISUAL_VIEWPORT_NAME,
      IDS_FLAGS_INERT_VISUAL_VIEWPORT_DESCRIPTION, kOsAll,
      SINGLE_VALUE_TYPE(switches::kInertVisualViewport)},
-#if defined(OS_MACOSX)
-    {"enable-save-password-bubble", IDS_FLAGS_SAVE_PASSWORD_BUBBLE_NAME,
-     IDS_FLAGS_SAVE_PASSWORD_BUBBLE_DESCRIPTION, kOsMac,
-     ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSavePasswordBubble,
-                               switches::kDisableSavePasswordBubble)},
-#endif
     {"enable-apps-file-associations", IDS_FLAGS_APPS_FILE_ASSOCIATIONS_NAME,
      IDS_FLAGS_APPS_FILE_ASSOCIATIONS_DESCRIPTION, kOsMac,
      SINGLE_VALUE_TYPE(switches::kEnableAppsFileAssociations)},
diff --git a/chrome/browser/password_manager/chrome_password_manager_client.cc b/chrome/browser/password_manager/chrome_password_manager_client.cc
index ae9e6c9..a99e9a4d 100644
--- a/chrome/browser/password_manager/chrome_password_manager_client.cc
+++ b/chrome/browser/password_manager/chrome_password_manager_client.cc
@@ -56,15 +56,12 @@
 #include "net/base/url_util.h"
 #include "third_party/re2/src/re2/re2.h"
 
-#if defined(OS_MACOSX) || BUILDFLAG(ANDROID_JAVA_UI)
-#include "chrome/browser/password_manager/save_password_infobar_delegate.h"
-#endif
-
 #if BUILDFLAG(ANDROID_JAVA_UI)
 #include "chrome/browser/android/tab_android.h"
 #include "chrome/browser/password_manager/account_chooser_dialog_android.h"
 #include "chrome/browser/password_manager/auto_signin_first_run_dialog_android.h"
 #include "chrome/browser/password_manager/generated_password_saved_infobar_delegate_android.h"
+#include "chrome/browser/password_manager/save_password_infobar_delegate.h"
 #include "chrome/browser/password_manager/update_password_infobar_delegate.h"
 #include "chrome/browser/ui/android/snackbars/auto_signin_prompt_controller.h"
 #endif
@@ -222,35 +219,28 @@
     return false;
   }
 
-  if (IsTheHotNewBubbleUIEnabled()) {
 #if !BUILDFLAG(ANDROID_JAVA_UI)
-    PasswordsClientUIDelegate* manage_passwords_ui_controller =
-        PasswordsClientUIDelegateFromWebContents(web_contents());
-    if (update_password && IsUpdatePasswordUIEnabled()) {
-      manage_passwords_ui_controller->OnUpdatePasswordSubmitted(
-          std::move(form_to_save));
-    } else {
-      manage_passwords_ui_controller->OnPasswordSubmitted(
-          std::move(form_to_save));
-    }
-#endif
+  PasswordsClientUIDelegate* manage_passwords_ui_controller =
+      PasswordsClientUIDelegateFromWebContents(web_contents());
+  if (update_password) {
+    manage_passwords_ui_controller->OnUpdatePasswordSubmitted(
+        std::move(form_to_save));
   } else {
-#if defined(OS_MACOSX) || BUILDFLAG(ANDROID_JAVA_UI)
-    if (form_to_save->IsBlacklisted())
-      return false;
-#if BUILDFLAG(ANDROID_JAVA_UI)
-    if (update_password && IsUpdatePasswordUIEnabled()) {
-      UpdatePasswordInfoBarDelegate::Create(web_contents(),
-                                            std::move(form_to_save));
-      return true;
-    }
-#endif
-    SavePasswordInfoBarDelegate::Create(web_contents(),
-                                        std::move(form_to_save));
-#else
-    NOTREACHED() << "Aura platforms should always use the bubble";
-#endif
+    manage_passwords_ui_controller->OnPasswordSubmitted(
+        std::move(form_to_save));
   }
+#else
+  if (form_to_save->IsBlacklisted())
+    return false;
+
+  if (update_password && IsUpdatePasswordUIEnabled()) {
+    UpdatePasswordInfoBarDelegate::Create(web_contents(),
+                                          std::move(form_to_save));
+    return true;
+  }
+  SavePasswordInfoBarDelegate::Create(web_contents(),
+                                      std::move(form_to_save));
+#endif  // !BUILDFLAG(ANDROID_JAVA_UI)
   return true;
 }
 
@@ -349,12 +339,10 @@
 #if BUILDFLAG(ANDROID_JAVA_UI)
   GeneratedPasswordSavedInfoBarDelegateAndroid::Create(web_contents());
 #else
-  if (IsTheHotNewBubbleUIEnabled()) {
-    PasswordsClientUIDelegate* manage_passwords_ui_controller =
-        PasswordsClientUIDelegateFromWebContents(web_contents());
-    manage_passwords_ui_controller->OnAutomaticPasswordSave(
-        std::move(saved_form));
-  }
+  PasswordsClientUIDelegate* manage_passwords_ui_controller =
+      PasswordsClientUIDelegateFromWebContents(web_contents());
+  manage_passwords_ui_controller->OnAutomaticPasswordSave(
+      std::move(saved_form));
 #endif
 }
 
@@ -366,9 +354,8 @@
 #if !BUILDFLAG(ANDROID_JAVA_UI)
   PasswordsClientUIDelegate* manage_passwords_ui_controller =
       PasswordsClientUIDelegateFromWebContents(web_contents());
-  if (manage_passwords_ui_controller && IsTheHotNewBubbleUIEnabled())
-    manage_passwords_ui_controller->OnPasswordAutofilled(best_matches, origin,
-                                                         federated_matches);
+  manage_passwords_ui_controller->OnPasswordAutofilled(best_matches, origin,
+                                                       federated_matches);
 #endif
 }
 
@@ -562,34 +549,12 @@
   password_manager_.GenerationAvailableForForm(form);
 }
 
-bool ChromePasswordManagerClient::IsTheHotNewBubbleUIEnabled() {
-#if BUILDFLAG(ANDROID_JAVA_UI)
-  return false;
-#elif defined(OS_MACOSX)
-  // Query the group first for correct UMA reporting.
-  std::string group_name =
-      base::FieldTrialList::FindFullName("PasswordManagerUI");
-  base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
-  if (command_line->HasSwitch(switches::kDisableSavePasswordBubble))
-    return false;
-
-  if (command_line->HasSwitch(switches::kEnableSavePasswordBubble))
-    return true;
-
-  // The bubble should be the default case that runs on the bots.
-  return group_name != "Infobar";
-#else
-  // All other platforms use Aura, and therefore always show the bubble.
-  return true;
-#endif
-}
-
 bool ChromePasswordManagerClient::IsUpdatePasswordUIEnabled() const {
 #if BUILDFLAG(ANDROID_JAVA_UI)
   return base::FeatureList::IsEnabled(
       password_manager::features::kEnablePasswordChangeSupport);
 #else
-  return IsTheHotNewBubbleUIEnabled();
+  return true;
 #endif
 }
 
diff --git a/chrome/browser/password_manager/chrome_password_manager_client.h b/chrome/browser/password_manager/chrome_password_manager_client.h
index e3095c01..f8c679d 100644
--- a/chrome/browser/password_manager/chrome_password_manager_client.h
+++ b/chrome/browser/password_manager/chrome_password_manager_client.h
@@ -102,10 +102,6 @@
   // Observer for PasswordGenerationPopup events. Used for testing.
   void SetTestObserver(autofill::PasswordGenerationPopupObserver* observer);
 
-  // Returns true if the bubble UI is enabled, and false if we're still using
-  // the sad old Infobar UI.
-  static bool IsTheHotNewBubbleUIEnabled();
-
   static void BindCredentialManager(
       content::RenderFrameHost* render_frame_host,
       password_manager::mojom::CredentialManagerRequest request);
diff --git a/chrome/browser/password_manager/password_manager_browsertest.cc b/chrome/browser/password_manager/password_manager_browsertest.cc
index 8ed485b..9cb1e1f5 100644
--- a/chrome/browser/password_manager/password_manager_browsertest.cc
+++ b/chrome/browser/password_manager/password_manager_browsertest.cc
@@ -2049,7 +2049,6 @@
 
 IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
                        ChangePwdNoAccountStored) {
-  ASSERT_TRUE(ChromePasswordManagerClient::IsTheHotNewBubbleUIEnabled());
   NavigateToFile("/password/password_form.html");
 
   // Fill a form and submit through a <input type="submit"> button.
@@ -2087,7 +2086,6 @@
 
 IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
                        ChangePwd1AccountStored) {
-  ASSERT_TRUE(ChromePasswordManagerClient::IsTheHotNewBubbleUIEnabled());
   // At first let us save credentials to the PasswordManager.
   scoped_refptr<password_manager::TestPasswordStore> password_store =
       static_cast<password_manager::TestPasswordStore*>(
@@ -2134,7 +2132,6 @@
 
 IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
                        PasswordOverridenUpdateBubbleShown) {
-  ASSERT_TRUE(ChromePasswordManagerClient::IsTheHotNewBubbleUIEnabled());
   // At first let us save credentials to the PasswordManager.
   scoped_refptr<password_manager::TestPasswordStore> password_store =
       static_cast<password_manager::TestPasswordStore*>(
@@ -2175,7 +2172,6 @@
 
 IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
                        PasswordNotOverridenUpdateBubbleNotShown) {
-  ASSERT_TRUE(ChromePasswordManagerClient::IsTheHotNewBubbleUIEnabled());
   // At first let us save credentials to the PasswordManager.
   scoped_refptr<password_manager::TestPasswordStore> password_store =
       static_cast<password_manager::TestPasswordStore*>(
@@ -2208,7 +2204,6 @@
 
 IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
                        ChangePwdWhenTheFormContainNotUsernameTextfield) {
-  ASSERT_TRUE(ChromePasswordManagerClient::IsTheHotNewBubbleUIEnabled());
   // At first let us save credentials to the PasswordManager.
   scoped_refptr<password_manager::TestPasswordStore> password_store =
       static_cast<password_manager::TestPasswordStore*>(
@@ -2789,7 +2784,6 @@
 // and there is stored credentials with the same password.
 IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
                        PasswordRetryFormNoBubbleWhenPasswordTheSame) {
-  ASSERT_TRUE(ChromePasswordManagerClient::IsTheHotNewBubbleUIEnabled());
   // At first let us save credentials to the PasswordManager.
   scoped_refptr<password_manager::TestPasswordStore> password_store =
       static_cast<password_manager::TestPasswordStore*>(
@@ -2824,7 +2818,6 @@
 // submitted and there are stored credentials but with different password.
 IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
                        PasswordRetryFormUpdateBubbleShown) {
-  ASSERT_TRUE(ChromePasswordManagerClient::IsTheHotNewBubbleUIEnabled());
   // At first let us save credentials to the PasswordManager.
   scoped_refptr<password_manager::TestPasswordStore> password_store =
       static_cast<password_manager::TestPasswordStore*>(
@@ -2863,7 +2856,6 @@
 
 IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
                        NoCrashWhenNavigatingWithOpenAccountPicker) {
-  ASSERT_TRUE(ChromePasswordManagerClient::IsTheHotNewBubbleUIEnabled());
   // Save credentials with 'skip_zero_click'.
   scoped_refptr<password_manager::TestPasswordStore> password_store =
       static_cast<password_manager::TestPasswordStore*>(
@@ -2926,7 +2918,6 @@
 IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
                        SkipZeroClickNotToggledAfterSuccessfulSubmissionWithAPI)
 {
-  ASSERT_TRUE(ChromePasswordManagerClient::IsTheHotNewBubbleUIEnabled());
   // Save credentials with 'skip_zero_click'
   scoped_refptr<password_manager::TestPasswordStore> password_store =
       static_cast<password_manager::TestPasswordStore*>(
@@ -2973,7 +2964,6 @@
 
 IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
                        SkipZeroClickNotToggledAfterSuccessfulAutofill) {
-  ASSERT_TRUE(ChromePasswordManagerClient::IsTheHotNewBubbleUIEnabled());
   // Save credentials with 'skip_zero_click'
   scoped_refptr<password_manager::TestPasswordStore> password_store =
       static_cast<password_manager::TestPasswordStore*>(
diff --git a/chrome/browser/password_manager/password_manager_test_base.cc b/chrome/browser/password_manager/password_manager_test_base.cc
index 909c9f9..44b7aea 100644
--- a/chrome/browser/password_manager/password_manager_test_base.cc
+++ b/chrome/browser/password_manager/password_manager_test_base.cc
@@ -9,7 +9,6 @@
 #include "base/macros.h"
 #include "base/run_loop.h"
 #include "base/strings/stringprintf.h"
-#include "chrome/browser/infobars/infobar_service.h"
 #include "chrome/browser/password_manager/chrome_password_manager_client.h"
 #include "chrome/browser/password_manager/password_store_factory.h"
 #include "chrome/browser/profiles/profile.h"
@@ -18,9 +17,6 @@
 #include "chrome/browser/ui/tabs/tab_strip_model.h"
 #include "chrome/test/base/ui_test_utils.h"
 #include "components/autofill/core/browser/autofill_test_utils.h"
-#include "components/infobars/core/confirm_infobar_delegate.h"
-#include "components/infobars/core/infobar.h"
-#include "components/infobars/core/infobar_manager.h"
 #include "components/password_manager/core/browser/password_manager_test_utils.h"
 #include "components/password_manager/core/browser/test_password_store.h"
 #include "components/password_manager/core/common/password_manager_features.h"
@@ -82,64 +78,6 @@
   AcceptUpdatePromptImpl(form);
 }
 
-class InfoBarObserver : public PromptObserver,
-                        public infobars::InfoBarManager::Observer {
- public:
-  explicit InfoBarObserver(content::WebContents* web_contents)
-      : infobar_is_being_shown_(false),
-        infobar_service_(InfoBarService::FromWebContents(web_contents)) {
-    infobar_service_->AddObserver(this);
-  }
-
-  ~InfoBarObserver() override {
-    if (infobar_service_)
-      infobar_service_->RemoveObserver(this);
-  }
-
-  void Dismiss() const override {
-    NOTIMPLEMENTED();
-  }
-
- private:
-  // PromptObserver:
-  bool IsShowingPrompt() const override { return infobar_is_being_shown_; }
-
-  void AcceptImpl() const override {
-    EXPECT_EQ(1u, infobar_service_->infobar_count());
-    if (!infobar_service_->infobar_count())
-      return;  // Let the test finish to gather possibly more diagnostics.
-
-    // ConfirmInfoBarDelegate::Accept returning true means the infobar is
-    // immediately closed. Checking the return value is preferred to testing
-    // IsShowingPrompt() here, for it avoids the delay until the closing
-    // notification is received.
-    EXPECT_TRUE(infobar_service_->infobar_at(0)
-                    ->delegate()
-                    ->AsConfirmInfoBarDelegate()
-                    ->Accept());
-  }
-
-  // infobars::InfoBarManager::Observer:
-  void OnInfoBarAdded(infobars::InfoBar* infobar) override {
-    infobar_is_being_shown_ = true;
-  }
-
-  void OnInfoBarRemoved(infobars::InfoBar* infobar, bool animate) override {
-    infobar_is_being_shown_ = false;
-  }
-
-  void OnManagerShuttingDown(infobars::InfoBarManager* manager) override {
-    ASSERT_EQ(infobar_service_, manager);
-    infobar_service_->RemoveObserver(this);
-    infobar_service_ = nullptr;
-  }
-
-  bool infobar_is_being_shown_;
-  InfoBarService* infobar_service_;
-
-  DISALLOW_COPY_AND_ASSIGN(InfoBarObserver);
-};
-
 class BubbleObserver : public PromptObserver {
  public:
   explicit BubbleObserver(content::WebContents* web_contents)
@@ -188,11 +126,7 @@
 
 std::unique_ptr<PromptObserver> PromptObserver::Create(
     content::WebContents* web_contents) {
-  if (ChromePasswordManagerClient::IsTheHotNewBubbleUIEnabled()) {
-    return std::unique_ptr<PromptObserver>(new BubbleObserver(web_contents));
-  } else {
-    return std::unique_ptr<PromptObserver>(new InfoBarObserver(web_contents));
-  }
+  return base::WrapUnique(new BubbleObserver(web_contents));
 }
 
 PasswordManagerBrowserTestBase::PasswordManagerBrowserTestBase() {
diff --git a/chrome/browser/password_manager/password_manager_test_base.h b/chrome/browser/password_manager/password_manager_test_base.h
index a0f411f..ef6f25d 100644
--- a/chrome/browser/password_manager/password_manager_test_base.h
+++ b/chrome/browser/password_manager/password_manager_test_base.h
@@ -8,7 +8,6 @@
 #include <memory>
 
 #include "base/macros.h"
-#include "base/memory/ref_counted.h"
 #include "chrome/test/base/in_process_browser_test.h"
 #include "content/public/browser/web_contents_observer.h"
 #include "content/public/test/test_utils.h"
diff --git a/chrome/browser/ui/cocoa/infobars/save_password_infobar_controller.mm b/chrome/browser/ui/cocoa/infobars/save_password_infobar_controller.mm
deleted file mode 100644
index c3ca11f..0000000
--- a/chrome/browser/ui/cocoa/infobars/save_password_infobar_controller.mm
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <utility>
-
-#include "chrome/browser/password_manager/save_password_infobar_delegate.h"
-#include "chrome/browser/ui/chrome_style.h"
-#include "chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.h"
-#include "chrome/browser/ui/cocoa/infobars/infobar_cocoa.h"
-#include "components/infobars/core/infobar.h"
-#include "skia/ext/skia_utils_mac.h"
-#include "ui/base/cocoa/controls/hyperlink_text_view.h"
-
-@interface SavePasswordInfobarController : ConfirmInfoBarController
-@end
-
-@implementation SavePasswordInfobarController
-
-- (void)addAdditionalControls {
-  [super addAdditionalControls];
-  // Set the link inside the message.
-  SavePasswordInfoBarDelegate* delegate =
-      static_cast<SavePasswordInfoBarDelegate*>([self delegate]);
-  gfx::Range linkRange = delegate->message_link_range();
-  if (!linkRange.is_empty()) {
-    NSColor* linkColor =
-        skia::SkColorToCalibratedNSColor(chrome_style::GetLinkColor());
-    HyperlinkTextView* view = (HyperlinkTextView*)label_.get();
-    [view addLinkRange:linkRange.ToNSRange() withURL:nil linkColor:linkColor];
-  }
-}
-
-std::unique_ptr<infobars::InfoBar> CreateSavePasswordInfoBar(
-    std::unique_ptr<SavePasswordInfoBarDelegate> delegate) {
-  std::unique_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(std::move(delegate)));
-  base::scoped_nsobject<SavePasswordInfobarController> controller(
-      [[SavePasswordInfobarController alloc] initWithInfoBar:infobar.get()]);
-  infobar->set_controller(controller);
-  return std::move(infobar);
-}
-
-@end
diff --git a/chrome/browser/ui/views/infobars/legacy_infobars_mac.cc b/chrome/browser/ui/views/infobars/legacy_infobars_mac.cc
index e748a9f5..5b4cc4c 100644
--- a/chrome/browser/ui/views/infobars/legacy_infobars_mac.cc
+++ b/chrome/browser/ui/views/infobars/legacy_infobars_mac.cc
@@ -3,9 +3,7 @@
 // found in the LICENSE file.
 
 #include "base/memory/ptr_util.h"
-#include "chrome/browser/password_manager/save_password_infobar_delegate.h"
 #include "chrome/browser/translate/chrome_translate_client.h"
-#include "chrome/browser/ui/views/infobars/confirm_infobar.h"
 
 // On Mac, some infobars are still used that have been migrated to a bubble UI
 // on other views platforms. When building the toolkit-views browser window on
@@ -14,11 +12,6 @@
 // elsewhere for OS_MACOSX, but aren't otherwise needed for a views browser.
 // TODO(tapted): Delete this file when Mac uses the bubbles by default.
 
-std::unique_ptr<infobars::InfoBar> CreateSavePasswordInfoBar(
-    std::unique_ptr<SavePasswordInfoBarDelegate> delegate) {
-  return base::WrapUnique(new ConfirmInfoBar(std::move(delegate)));
-}
-
 std::unique_ptr<infobars::InfoBar> ChromeTranslateClient::CreateInfoBar(
     std::unique_ptr<translate::TranslateInfoBarDelegate> delegate) const {
   NOTREACHED();
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index b4a3386..26a5d58 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -1016,6 +1016,10 @@
       'browser/password_manager/credential_android.h',
       'browser/password_manager/generated_password_saved_infobar_delegate_android.cc',
       'browser/password_manager/generated_password_saved_infobar_delegate_android.h',
+      'browser/password_manager/password_manager_infobar_delegate.cc',
+      'browser/password_manager/password_manager_infobar_delegate.h',
+      'browser/password_manager/save_password_infobar_delegate.cc',
+      'browser/password_manager/save_password_infobar_delegate.h',
       'browser/password_manager/update_password_infobar_delegate.cc',
       'browser/password_manager/update_password_infobar_delegate.h',
       'browser/permissions/permission_queue_controller.cc',
@@ -2268,13 +2272,6 @@
       'browser/password_manager/simple_password_store_mac.cc',
       'browser/password_manager/simple_password_store_mac.h',
     ],
-    # Used on Mac and Android platforms.
-    'chrome_browser_password_manager_mac_android_sources': [
-      'browser/password_manager/password_manager_infobar_delegate.cc',
-      'browser/password_manager/password_manager_infobar_delegate.h',
-      'browser/password_manager/save_password_infobar_delegate.cc',
-      'browser/password_manager/save_password_infobar_delegate.h',
-    ],
     'chrome_browser_permissions_sources': [
       'browser/permissions/chooser_context_base.cc',
       'browser/permissions/chooser_context_base.h',
@@ -3493,11 +3490,6 @@
           ],
           'sources': [ '<@(chrome_browser_mac_sources)' ]
         }],
-        ['OS=="mac" or OS=="android"', {
-          'sources': [
-            '<@(chrome_browser_password_manager_mac_android_sources)',
-          ],
-        }],
         ['chromeos==1', {
           'sources!': [
             'browser/signin/chrome_signin_status_metrics_provider_delegate.cc',
diff --git a/chrome/chrome_browser_ui.gypi b/chrome/chrome_browser_ui.gypi
index 9078f1e..ea5cc23 100644
--- a/chrome/chrome_browser_ui.gypi
+++ b/chrome/chrome_browser_ui.gypi
@@ -1051,7 +1051,6 @@
       'browser/ui/cocoa/infobars/infobar_gradient_view.mm',
       'browser/ui/cocoa/infobars/infobar_utilities.h',
       'browser/ui/cocoa/infobars/infobar_utilities.mm',
-      'browser/ui/cocoa/infobars/save_password_infobar_controller.mm',
       'browser/ui/cocoa/infobars/translate_infobar_base.h',
       'browser/ui/cocoa/infobars/translate_infobar_base.mm',
       'browser/ui/cocoa/infobars/translate_message_infobar_controller.h',
diff --git a/chrome/chrome_tests_unit.gypi b/chrome/chrome_tests_unit.gypi
index 9de15222d..66eec05 100644
--- a/chrome/chrome_tests_unit.gypi
+++ b/chrome/chrome_tests_unit.gypi
@@ -343,12 +343,10 @@
       '../tools/json_schema_compiler/test/objects_unittest.cc',
       '../tools/json_schema_compiler/test/simple_api_unittest.cc',
     ],
-    'chrome_unit_tests_mac_android_sources': [
-      'browser/password_manager/save_password_infobar_delegate_unittest.cc',
-    ],
     'chrome_unit_tests_android_sources': [
       'browser/autofill/autofill_save_card_infobar_delegate_mobile_unittest.cc',
       'browser/password_manager/auto_signin_first_run_dialog_android_unittest.cc',
+      'browser/password_manager/save_password_infobar_delegate_unittest.cc',
       'browser/permissions/permission_queue_controller_unittest.cc',
     ],
     'chrome_unit_tests_non_mobile_sources': [
@@ -2595,9 +2593,6 @@
           # other things like the ui and startup tests. *shrug*
           'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
         }],
-        ['OS=="mac" or OS=="android"', {
-          'sources': [ '<@(chrome_unit_tests_mac_android_sources)' ],
-        }],
         ['OS=="android"', {
           'sources': [ '<@(chrome_unit_tests_android_sources)' ],
         }],
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 09ba0d3..718532f 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -1159,9 +1159,6 @@
 const char kDisableMacViewsNativeAppWindows[] =
     "disable-mac-views-native-app-windows";
 
-// Prevents the save password bubble from being enabled.
-const char kDisableSavePasswordBubble[] = "disable-save-password-bubble";
-
 // Disables Translate experimental new UX which replaces the infobar.
 const char kDisableTranslateNewUX[] = "disable-translate-new-ux";
 
@@ -1186,9 +1183,6 @@
 // when available, rather than a Cocoa one.
 const char kEnableMacViewsDialogs[] = "enable-mac-views-dialogs";
 
-// Enables save password prompt bubble.
-const char kEnableSavePasswordBubble[] = "enable-save-password-bubble";
-
 // Enables Translate experimental new UX which replaces the infobar.
 const char kEnableTranslateNewUX[] = "enable-translate-new-ux";
 
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index bb128a2..35beb73 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -341,7 +341,6 @@
 extern const char kDisableHostedAppShimCreation[];
 extern const char kDisableHostedAppsInWindows[];
 extern const char kDisableMacViewsNativeAppWindows[];
-extern const char kDisableSavePasswordBubble[];
 extern const char kDisableTranslateNewUX[];
 extern const char kEnableAppInfoDialogMac[];
 extern const char kEnableAppWindowCycling[];
@@ -349,7 +348,6 @@
 extern const char kEnableHostedAppsInWindows[];
 extern const char kEnableMacViewsNativeAppWindows[];
 extern const char kEnableMacViewsDialogs[];
-extern const char kEnableSavePasswordBubble[];
 extern const char kEnableTranslateNewUX[];
 extern const char kMetricsClientID[];
 extern const char kRelauncherProcess[];
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
index 7266e26..d6bba60 100644
--- a/chrome/test/BUILD.gn
+++ b/chrome/test/BUILD.gn
@@ -2063,18 +2063,6 @@
     # other things like the ui and startup tests. *shrug*
     ldflags = [ "-Wl,-ObjC" ]
   }
-  if (is_mac || is_android) {
-    sources += rebase_path(
-            chrome_tests_unit_gypi_values.chrome_unit_tests_mac_android_sources,
-            ".",
-            "//chrome")
-  }
-  if (is_android) {
-    sources += rebase_path(
-            chrome_tests_unit_gypi_values.chrome_unit_tests_android_sources,
-            ".",
-            "//chrome")
-  }
   if (!is_mac && !is_ios) {
     deps += [
       "//chrome:packed_extra_resources",