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

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: Exclude kEnableSavePasswordBubble/kDisableSavePasswordBubble definitions on Aura platforms 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
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 f7060ba64fdb09f646ec0401bed1afa3f686d9d6..6a5b74a6d59166fd783463376a31150fe711168c 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"
@@ -49,6 +48,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"
@@ -216,6 +219,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(
@@ -224,6 +228,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;
}
@@ -506,12 +513,11 @@ bool ChromePasswordManagerClient::IsURLPasswordWebsiteReauth(
}
bool ChromePasswordManagerClient::IsTheHotNewBubbleUIEnabled() {
-#if !defined(USE_AURA) && !defined(OS_MACOSX)
- return false;
-#endif
+#if defined(OS_MACOSX) || defined(OS_ANDROID)
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
- if (command_line->HasSwitch(switches::kDisableSavePasswordBubble))
+ if (command_line->HasSwitch(switches::kDisableSavePasswordBubble)) {
vabr (Chromium) 2015/09/10 07:21:47 nit: Drop the { and }, for on-liner "if" it is not
ki.stfu 2015/09/10 18:21:00 Done.
return false;
+ }
if (command_line->HasSwitch(switches::kEnableSavePasswordBubble))
return true;
@@ -521,6 +527,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 {

Powered by Google App Engine
This is Rietveld 408576698