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

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

Issue 127973004: Persist "Save password" infobars across redirects (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments addressed + trybot compilation fixed Created 6 years, 11 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/password_manager_delegate_impl.cc
diff --git a/chrome/browser/password_manager/password_manager_delegate_impl.cc b/chrome/browser/password_manager/password_manager_delegate_impl.cc
index 9d63a906a8a6c46a81318048474feffb535471b3..1bb9e34ba931e267bcefa00295e329eeb5e14ddf 100644
--- a/chrome/browser/password_manager/password_manager_delegate_impl.cc
+++ b/chrome/browser/password_manager/password_manager_delegate_impl.cc
@@ -20,9 +20,11 @@
#include "components/autofill/content/common/autofill_messages.h"
#include "components/autofill/core/browser/autofill_manager.h"
#include "components/autofill/core/common/password_form.h"
+#include "content/public/browser/navigation_details.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/common/page_transition_types.h"
#include "content/public/common/ssl_status.h"
#include "google_apis/gaia/gaia_urls.h"
#include "grit/chromium_strings.h"
@@ -65,6 +67,10 @@ class SavePasswordInfoBarDelegate : public ConfirmInfoBarDelegate {
const std::string& uma_histogram_suffix);
virtual ~SavePasswordInfoBarDelegate();
+ // InfoBarDelegate
+ virtual bool ShouldExpire(const content::LoadCommittedDetails& details)
+ const OVERRIDE;
+
// ConfirmInfoBarDelegate
virtual int GetIconID() const OVERRIDE;
virtual Type GetInfoBarType() const OVERRIDE;
@@ -154,6 +160,13 @@ SavePasswordInfoBarDelegate::~SavePasswordInfoBarDelegate() {
}
}
+bool SavePasswordInfoBarDelegate::ShouldExpire(
+ const content::LoadCommittedDetails& details) const {
+ bool is_not_redirect = !(details.entry->GetTransitionType() &
vabr (Chromium) 2014/01/09 11:39:38 This change is to get rid of the C4800 warning of
+ content::PAGE_TRANSITION_IS_REDIRECT_MASK);
+ return is_not_redirect && InfoBarDelegate::ShouldExpire(details);
+}
+
int SavePasswordInfoBarDelegate::GetIconID() const {
return IDR_INFOBAR_SAVE_PASSWORD;
}
« no previous file with comments | « chrome/browser/password_manager/password_manager_browsertest.cc ('k') | chrome/test/data/password/password_form.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698