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

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

Issue 2397743002: Ditch first run experience from Save Password Infobar (Closed)
Patch Set: get rid of unused web_contents_ Created 4 years, 2 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/save_password_infobar_delegate_android.cc
diff --git a/chrome/browser/password_manager/save_password_infobar_delegate_android.cc b/chrome/browser/password_manager/save_password_infobar_delegate_android.cc
index 90fe35454b4694cf6a746589ef4fb080d74e1dfa..51ec784194ebd40087eb8711bc6e71816053e20f 100644
--- a/chrome/browser/password_manager/save_password_infobar_delegate_android.cc
+++ b/chrome/browser/password_manager/save_password_infobar_delegate_android.cc
@@ -17,6 +17,7 @@
#include "chrome/grit/theme_resources.h"
#include "components/browser_sync/profile_sync_service.h"
#include "components/infobars/core/infobar.h"
+#include "components/infobars/core/infobar_manager.h"
#include "components/password_manager/core/browser/password_bubble_experiment.h"
#include "content/public/browser/web_contents.h"
#include "ui/base/l10n/l10n_util.h"
@@ -33,37 +34,25 @@ void SavePasswordInfoBarDelegate::Create(
bool is_smartlock_branding_enabled =
password_bubble_experiment::IsSmartLockBrandingSavePromptEnabled(
sync_service);
- bool should_show_first_run_experience =
- password_bubble_experiment::ShouldShowSavePromptFirstRunExperience(
- sync_service, profile->GetPrefs());
- InfoBarService::FromWebContents(web_contents)
- ->AddInfoBar(CreateSavePasswordInfoBar(base::WrapUnique(
+ InfoBarService* infobar_service =
+ InfoBarService::FromWebContents(web_contents);
+ infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar(
+ std::unique_ptr<ConfirmInfoBarDelegate>(
new SavePasswordInfoBarDelegate(web_contents, std::move(form_to_save),
- is_smartlock_branding_enabled,
- should_show_first_run_experience))));
+ is_smartlock_branding_enabled))));
}
SavePasswordInfoBarDelegate::~SavePasswordInfoBarDelegate() {
password_manager::metrics_util::LogUIDismissalReason(infobar_response_);
-
- if (should_show_first_run_experience_) {
- Profile* profile =
- Profile::FromBrowserContext(web_contents_->GetBrowserContext());
- password_bubble_experiment::RecordSavePromptFirstRunExperienceWasShown(
- profile->GetPrefs());
- }
}
SavePasswordInfoBarDelegate::SavePasswordInfoBarDelegate(
content::WebContents* web_contents,
std::unique_ptr<password_manager::PasswordFormManager> form_to_save,
- bool is_smartlock_branding_enabled,
- bool should_show_first_run_experience)
+ bool is_smartlock_branding_enabled)
: PasswordManagerInfoBarDelegate(),
form_to_save_(std::move(form_to_save)),
- infobar_response_(password_manager::metrics_util::NO_DIRECT_INTERACTION),
- should_show_first_run_experience_(should_show_first_run_experience),
- web_contents_(web_contents) {
+ infobar_response_(password_manager::metrics_util::NO_DIRECT_INTERACTION) {
base::string16 message;
gfx::Range message_link_range = gfx::Range();
PasswordTittleType type =
@@ -78,13 +67,6 @@ SavePasswordInfoBarDelegate::SavePasswordInfoBarDelegate(
SetMessageLinkRange(message_link_range);
}
-base::string16 SavePasswordInfoBarDelegate::GetFirstRunExperienceMessage() {
- return should_show_first_run_experience_
- ? l10n_util::GetStringUTF16(
- IDS_PASSWORD_MANAGER_SAVE_PROMPT_FIRST_RUN_EXPERIENCE)
- : base::string16();
-}
-
infobars::InfoBarDelegate::InfoBarIdentifier
SavePasswordInfoBarDelegate::GetIdentifier() const {
return SAVE_PASSWORD_INFOBAR_DELEGATE;

Powered by Google App Engine
This is Rietveld 408576698