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

Unified Diff: chrome/browser/ui/content_settings/content_setting_bubble_model.cc

Issue 22975006: Save password functionality added to the save password bubble (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix for regression bug 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/ui/content_settings/content_setting_bubble_model.cc
diff --git a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
index 04a3ef0742d91f1f956df0aa10036c44516b6152..e97cbfd333bd921b47d5c5f512d76d67ad1c4249 100644
--- a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
+++ b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
@@ -10,7 +10,6 @@
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/content_settings/content_settings_utils.h"
#include "chrome/browser/content_settings/cookie_settings.h"
-#include "chrome/browser/content_settings/tab_specific_content_settings.h"
#include "chrome/browser/custom_handlers/protocol_handler_registry.h"
#include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h"
#include "chrome/browser/favicon/favicon_tab_helper.h"
@@ -164,6 +163,8 @@ void ContentSettingTitleAndLinkModel::SetManageLink() {
{CONTENT_SETTINGS_TYPE_PPAPI_BROKER, IDS_PPAPI_BROKER_BUBBLE_MANAGE_LINK},
{CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, IDS_BLOCKED_DOWNLOADS_LINK},
{CONTENT_SETTINGS_TYPE_MIDI_SYSEX, IDS_MIDI_SYSEX_BUBBLE_MANAGE_LINK},
+ {CONTENT_SETTINGS_TYPE_SAVE_PASSWORD,
+ IDS_OPTIONS_PASSWORDS_MANAGE_PASSWORDS},
};
set_manage_link(l10n_util::GetStringUTF8(
GetIdForContentType(kLinkIDs, arraysize(kLinkIDs), content_type())));
@@ -573,24 +574,11 @@ void ContentSettingPopupBubbleModel::OnPopupClicked(int index) {
}
// The model for the save password bubble.
-class SavePasswordBubbleModel : public ContentSettingBubbleModel {
- public:
- SavePasswordBubbleModel(WebContents* web_contents, Profile* profile);
- virtual ~SavePasswordBubbleModel() {}
-
- private:
- // Sets the title of the bubble.
- void SetTitle();
-
- TabSpecificContentSettings::PasswordSavingState state_;
-
- DISALLOW_COPY_AND_ASSIGN(SavePasswordBubbleModel);
-};
-
-SavePasswordBubbleModel::SavePasswordBubbleModel(WebContents* web_contents,
+SavePasswordBubbleModel::SavePasswordBubbleModel(Delegate* delegate,
+ WebContents* web_contents,
Profile* profile)
- : ContentSettingBubbleModel(web_contents, profile,
- CONTENT_SETTINGS_TYPE_SAVE_PASSWORD),
+ : ContentSettingTitleAndLinkModel(delegate, web_contents, profile,
+ CONTENT_SETTINGS_TYPE_SAVE_PASSWORD),
state_(TabSpecificContentSettings::NO_PASSWORD_TO_BE_SAVED) {
DCHECK(profile);
TabSpecificContentSettings* content_settings =
@@ -610,6 +598,18 @@ void SavePasswordBubbleModel::SetTitle() {
set_title(l10n_util::GetStringUTF8(title_id));
}
+void SavePasswordBubbleModel::OnCancelClicked() {
+ TabSpecificContentSettings* content_settings =
+ TabSpecificContentSettings::FromWebContents(web_contents());
+ content_settings->PasswordFormBlacklisted();
+}
+
+void SavePasswordBubbleModel::OnSaveClicked() {
+ TabSpecificContentSettings* content_settings =
+ TabSpecificContentSettings::FromWebContents(web_contents());
+ content_settings->PasswordAccepted();
+}
+
// The model of the content settings bubble for media settings.
class ContentSettingMediaStreamBubbleModel
: public ContentSettingTitleAndLinkModel {
@@ -1277,7 +1277,7 @@ ContentSettingBubbleModel*
Profile* profile,
ContentSettingsType content_type) {
if (content_type == CONTENT_SETTINGS_TYPE_SAVE_PASSWORD) {
- return new SavePasswordBubbleModel(web_contents, profile);
+ return new SavePasswordBubbleModel(delegate, web_contents, profile);
}
if (content_type == CONTENT_SETTINGS_TYPE_COOKIES) {
return new ContentSettingCookiesBubbleModel(delegate, web_contents, profile,

Powered by Google App Engine
This is Rietveld 408576698