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

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

Issue 322093003: Password bubble: The bots should run the bubble code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tests. Created 6 years, 6 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 518a64b5275529cc8231958e7b4f54ae7a437301..52587233e8b435c41ed9917385372a5ad98e1f6c 100644
--- a/chrome/browser/password_manager/chrome_password_manager_client.cc
+++ b/chrome/browser/password_manager/chrome_password_manager_client.cc
@@ -38,26 +38,6 @@
using password_manager::PasswordManagerInternalsService;
using password_manager::PasswordManagerInternalsServiceFactory;
-namespace {
-
-bool IsTheHotNewBubbleUIEnabled() {
-#if !defined(USE_AURA)
- return false;
-#endif
- CommandLine* command_line = CommandLine::ForCurrentProcess();
- if (command_line->HasSwitch(switches::kDisableSavePasswordBubble))
- return false;
-
- if (command_line->HasSwitch(switches::kEnableSavePasswordBubble))
- return true;
-
- std::string group_name =
- base::FieldTrialList::FindFullName("PasswordManagerUI");
- return group_name == "Bubble";
-}
-
-} // namespace
-
DEFINE_WEB_CONTENTS_USER_DATA_KEY(ChromePasswordManagerClient);
// static
@@ -106,11 +86,7 @@ void ChromePasswordManagerClient::PromptUserToSavePassword(
if (IsTheHotNewBubbleUIEnabled()) {
ManagePasswordsUIController* manage_passwords_ui_controller =
ManagePasswordsUIController::FromWebContents(web_contents());
- if (manage_passwords_ui_controller) {
- manage_passwords_ui_controller->OnPasswordSubmitted(form_to_save);
- } else {
- delete form_to_save;
- }
+ manage_passwords_ui_controller->OnPasswordSubmitted(form_to_save);
} else {
std::string uma_histogram_suffix(
password_manager::metrics_util::GroupIdToString(
@@ -334,3 +310,21 @@ void ChromePasswordManagerClient::CommitFillPasswordForm(
autofill::PasswordFormFillData* data) {
driver_.FillPasswordForm(*data);
}
+
+bool ChromePasswordManagerClient::IsTheHotNewBubbleUIEnabled() {
+#if !defined(USE_AURA)
+ return false;
+#endif
+ CommandLine* command_line = CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(switches::kDisableSavePasswordBubble))
+ return false;
+
+ if (command_line->HasSwitch(switches::kEnableSavePasswordBubble))
+ return true;
+
+ std::string group_name =
+ base::FieldTrialList::FindFullName("PasswordManagerUI");
+
+ // The bubble should be the default case that runs on the bots.
+ return group_name != "Infobar";
+}

Powered by Google App Engine
This is Rietveld 408576698