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

Unified Diff: chrome/browser/password_manager/chrome_password_manager_client.cc

Issue 1313383006: Don't compile save_password_infobar_delegate.cc everywhere but Mac and Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase against ToT Created 5 years, 3 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/about_flags.cc ('k') | chrome/browser/ui/views/infobars/save_password_infobar.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/password_manager/chrome_password_manager_client.cc
diff --git a/chrome/browser/password_manager/chrome_password_manager_client.cc b/chrome/browser/password_manager/chrome_password_manager_client.cc
index 18d43812f73d6501bb130a73dd9530e5b59e1f1e..49da307f654d33c083b664ce73dbb383b97fc86f 100644
--- a/chrome/browser/password_manager/chrome_password_manager_client.cc
+++ b/chrome/browser/password_manager/chrome_password_manager_client.cc
@@ -12,7 +12,6 @@
#include "base/prefs/pref_service.h"
#include "chrome/browser/browsing_data/browsing_data_helper.h"
#include "chrome/browser/password_manager/password_store_factory.h"
-#include "chrome/browser/password_manager/save_password_infobar_delegate.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/sync/profile_sync_service.h"
@@ -50,6 +49,10 @@
#include "net/base/url_util.h"
#include "third_party/re2/re2/re2.h"
+#if defined(OS_MACOSX) || defined(OS_ANDROID)
+#include "chrome/browser/password_manager/save_password_infobar_delegate.h"
+#endif
+
#if defined(OS_ANDROID)
#include "chrome/browser/android/tab_android.h"
#include "chrome/browser/password_manager/generated_password_saved_infobar_delegate_android.h"
@@ -226,6 +229,7 @@ bool ChromePasswordManagerClient::PromptUserToSaveOrUpdatePassword(
manage_passwords_ui_controller->OnPasswordSubmitted(form_to_save.Pass());
}
} else {
+#if defined(OS_MACOSX) || defined(OS_ANDROID)
if (form_to_save->IsBlacklisted())
return false;
std::string uma_histogram_suffix(
@@ -234,6 +238,9 @@ bool ChromePasswordManagerClient::PromptUserToSaveOrUpdatePassword(
form_to_save->pending_credentials().signon_realm, GetPrefs())));
SavePasswordInfoBarDelegate::Create(
web_contents(), form_to_save.Pass(), uma_histogram_suffix, type);
+#else
+ NOTREACHED() << "Aura platforms should always use the bubble";
+#endif
}
return true;
}
@@ -516,9 +523,9 @@ bool ChromePasswordManagerClient::IsURLPasswordWebsiteReauth(
}
bool ChromePasswordManagerClient::IsTheHotNewBubbleUIEnabled() {
-#if !defined(USE_AURA) && !defined(OS_MACOSX)
+#if defined(OS_ANDROID)
return false;
-#endif
+#elif defined(OS_MACOSX)
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(switches::kDisableSavePasswordBubble))
return false;
@@ -531,6 +538,10 @@ bool ChromePasswordManagerClient::IsTheHotNewBubbleUIEnabled() {
// 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 {
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/ui/views/infobars/save_password_infobar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698