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

Unified Diff: chrome/browser/content_settings/tab_specific_content_settings.cc

Issue 23980003: Save password functionality added to the save password bubble (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 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/content_settings/tab_specific_content_settings.cc
diff --git a/chrome/browser/content_settings/tab_specific_content_settings.cc b/chrome/browser/content_settings/tab_specific_content_settings.cc
index 1a19e37bb5f67d4fde067013f28154661b8a6372..2b7550701d88ce0957004de8f3a042110b3da80d 100644
--- a/chrome/browser/content_settings/tab_specific_content_settings.cc
+++ b/chrome/browser/content_settings/tab_specific_content_settings.cc
@@ -99,6 +99,18 @@ TabSpecificContentSettings::~TabSpecificContentSettings() {
SiteDataObserver, observer_list_, ContentSettingsDestroyed());
}
+bool TabSpecificContentSettings::PasswordAccepted() {
+ DCHECK(form_to_save_.get());
+ form_to_save_->SavePassword();
+ return true;
+}
+
+bool TabSpecificContentSettings::PasswordFormBlacklisted() {
+ DCHECK(form_to_save_.get());
+ form_to_save_->BlacklistPassword();
+ return true;
+}
+
TabSpecificContentSettings* TabSpecificContentSettings::Get(
int render_process_id, int render_view_id) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -463,9 +475,9 @@ void TabSpecificContentSettings::OnGeolocationPermissionSet(
content::NotificationService::NoDetails());
}
-// TODO(npentrel): Save the password when user accepts the prompt
void TabSpecificContentSettings::OnPasswordSubmitted(
PasswordFormManager* form_to_save) {
+ form_to_save_.reset(form_to_save);
OnContentAllowed(CONTENT_SETTINGS_TYPE_SAVE_PASSWORD);
NotifySiteDataObservers();
}
@@ -647,6 +659,8 @@ bool TabSpecificContentSettings::OnMessageReceived(
void TabSpecificContentSettings::DidNavigateMainFrame(
const content::LoadCommittedDetails& details,
const content::FrameNavigateParams& params) {
+ if (form_to_save_)
+ form_to_save_->ApplyChange();
if (!details.is_in_page) {
// Clear "blocked" flags.
ClearBlockedContentSettingsExceptForCookies();

Powered by Google App Engine
This is Rietveld 408576698