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

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

Issue 1022843003: New smart passsword bubble algorithm. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: handle 'Never' correctly Created 5 years, 9 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
« no previous file with comments | « chrome/browser/ui/passwords/save_password_refusal_combobox_model.cc ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e805f12808e9e435f9cfdcbe2c9309d75e9967bc..b1bede3a918aa8bfb5ec5176434f8cd8a9a3ce4b 100644
--- a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
+++ b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
@@ -11,6 +11,7 @@
#include "chrome/browser/ui/exclusive_access/fullscreen_controller.h"
#include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h"
#include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h"
+#include "chrome/browser/ui/passwords/password_bubble_experiment.h"
#include "chrome/browser/ui/passwords/save_password_refusal_combobox_model.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/passwords/credentials_item_view.h"
@@ -397,7 +398,9 @@ ManagePasswordsBubbleView::PendingView::PendingView(
save_button_->SetFontList(ui::ResourceBundle::GetSharedInstance().GetFontList(
ui::ResourceBundle::SmallFont));
- combobox_model_.reset(new SavePasswordRefusalComboboxModel());
+ combobox_model_.reset(new SavePasswordRefusalComboboxModel(
+ password_bubble_experiment::ShouldShowNeverForThisSiteDefault(
+ parent_->model()->GetProfile()->GetPrefs())));
refuse_combobox_.reset(new views::Combobox(combobox_model_.get()));
refuse_combobox_->set_listener(this);
refuse_combobox_->SetStyle(views::Combobox::STYLE_ACTION);
@@ -438,14 +441,13 @@ void ManagePasswordsBubbleView::PendingView::ButtonPressed(
void ManagePasswordsBubbleView::PendingView::OnPerformAction(
views::Combobox* source) {
DCHECK_EQ(source, refuse_combobox_);
- switch (refuse_combobox_->selected_index()) {
- case SavePasswordRefusalComboboxModel::INDEX_NOPE:
- parent_->model()->OnNopeClicked();
- parent_->Close();
- break;
- case SavePasswordRefusalComboboxModel::INDEX_NEVER_FOR_THIS_SITE:
- parent_->NotifyNeverForThisSiteClicked();
- break;
+ if (source->selected_index() == combobox_model_->index_nope()) {
+ parent_->model()->OnNopeClicked();
+ parent_->Close();
+ } else if (source->selected_index() == combobox_model_->index_never()) {
+ parent_->NotifyNeverForThisSiteClicked();
+ } else {
+ NOTREACHED();
}
}
« no previous file with comments | « chrome/browser/ui/passwords/save_password_refusal_combobox_model.cc ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698