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

Unified Diff: chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc

Issue 259153004: Password bubble: Give users the option of unblacklisting a site. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 7 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/views/passwords/manage_passwords_bubble_view.cc
diff --git a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
index e9c64e1f3f51381a1f3842b68cd33e64a266aabe..ec554d0f9a3efcd57c65d1b690fbfa83dd5c7940 100644
--- a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
+++ b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
@@ -275,6 +275,56 @@ void ManagePasswordsBubbleView::ManageView::LinkClicked(views::Link* source,
parent_->Close();
}
+// ManagePasswordsBubbleView::BlacklistedView ---------------------------------
+
+ManagePasswordsBubbleView::BlacklistedView::BlacklistedView(
+ ManagePasswordsBubbleView* parent)
+ : parent_(parent) {
+ views::GridLayout* layout = new views::GridLayout(this);
+ SetLayoutManager(layout);
+
+ // Add the title.
+ BuildColumnSet(layout, SINGLE_VIEW_COLUMN_SET);
+ AddTitleRow(layout, parent_->model());
+
+ // Add the "Hey! You blacklisted this site!" text.
+ layout->StartRow(0, SINGLE_VIEW_COLUMN_SET);
+ views::Label* blacklisted = new views::Label(
+ l10n_util::GetStringUTF16(IDS_MANAGE_PASSWORDS_BLACKLISTED));
+ blacklisted->SetMultiLine(true);
+ layout->AddView(blacklisted);
+
+ // Then add the "enable password manager" and "Done" buttons.
+ unblacklist_button_ = new views::BlueButton(
+ this, l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_UNBLACKLIST_BUTTON));
+ done_button_ =
+ new views::LabelButton(this, l10n_util::GetStringUTF16(IDS_DONE));
+ done_button_->SetStyle(views::Button::STYLE_BUTTON);
+
+ BuildColumnSet(layout, DOUBLE_BUTTON_COLUMN_SET);
+ layout->StartRowWithPadding(
+ 0, DOUBLE_BUTTON_COLUMN_SET, 0, views::kRelatedControlVerticalSpacing);
+ layout->AddView(unblacklist_button_);
+ layout->AddView(done_button_);
+
+ // Extra padding for visual awesomeness.
+ layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing);
+}
+
+ManagePasswordsBubbleView::BlacklistedView::~BlacklistedView() {
+}
+
+void ManagePasswordsBubbleView::BlacklistedView::ButtonPressed(
+ views::Button* sender,
+ const ui::Event& event) {
+ if (sender == done_button_)
+ parent_->model()->OnDoneClicked();
+ else if (sender == unblacklist_button_)
+ parent_->model()->OnUnblacklistClicked();
+ else
+ NOTREACHED();
+ parent_->Close();
+}
// ManagePasswordsBubbleView --------------------------------------------------
@@ -374,6 +424,8 @@ void ManagePasswordsBubbleView::Init() {
if (model()->WaitingToSavePassword())
AddChildView(new PendingView(this));
+ else if (model()->NeverSavingPasswords())
+ AddChildView(new BlacklistedView(this));
else
AddChildView(new ManageView(this));
}

Powered by Google App Engine
This is Rietveld 408576698