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

Side by Side Diff: chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc

Issue 1304573004: Added UMA statistics for change passwords in the Password Manager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h" 5 #include "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h"
6 6
7 #include "base/timer/timer.h" 7 #include "base/timer/timer.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/browser_finder.h" 10 #include "chrome/browser/ui/browser_finder.h"
(...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after
1020 SetLayoutManager(layout); 1020 SetLayoutManager(layout);
1021 1021
1022 // Create the pending credential item, update button. 1022 // Create the pending credential item, update button.
1023 View* item = nullptr; 1023 View* item = nullptr;
1024 if (parent->model()->ShouldShowMultipleAccountUpdateUI()) { 1024 if (parent->model()->ShouldShowMultipleAccountUpdateUI()) {
1025 selection_view_ = new CredentialsSelectionView( 1025 selection_view_ = new CredentialsSelectionView(
1026 parent->model(), parent->model()->local_credentials().get(), 1026 parent->model(), parent->model()->local_credentials().get(),
1027 parent->model()->pending_password().username_value); 1027 parent->model()->pending_password().username_value);
1028 item = selection_view_; 1028 item = selection_view_;
1029 } else { 1029 } else {
1030 DCHECK_EQ(1u, parent->model()->local_credentials().size());
dvadym 2015/08/19 11:47:56 Since https://codereview.chromium.org/1297963002/
vasilii 2015/08/20 15:11:48 You are talking about password_overriden case? It
dvadym 2015/08/21 14:09:53 In case of password_overridden, password store can
1031 DCHECK_EQ(parent->model()->local_credentials()[0]->username_value,
1032 parent->model()->pending_password().username_value);
vasilii 2015/08/19 13:01:18 If this is untrue then there is a bug in the line
dvadym 2015/08/20 11:10:11 Thanks, there was a bug in the line 1091. Fixed.
vasilii 2015/08/20 15:11:48 I'm concerned about this change. It violates the c
dvadym 2015/08/21 14:09:53 Strictly speaking using |pending_password| for arg
1033 std::vector<const autofill::PasswordForm*> forms; 1030 std::vector<const autofill::PasswordForm*> forms;
1034 forms.push_back(&parent->model()->pending_password()); 1031 forms.push_back(&parent->model()->pending_password());
1035 item = new ManagePasswordItemsView(parent_->model(), forms); 1032 item = new ManagePasswordItemsView(parent_->model(), forms);
1036 } 1033 }
1037 nope_button_ = new views::LabelButton( 1034 nope_button_ = new views::LabelButton(
1038 this, l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_CANCEL_BUTTON)); 1035 this, l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_CANCEL_BUTTON));
1039 nope_button_->SetStyle(views::Button::STYLE_BUTTON); 1036 nope_button_->SetStyle(views::Button::STYLE_BUTTON);
1040 nope_button_->SetFontList(ui::ResourceBundle::GetSharedInstance().GetFontList( 1037 nope_button_->SetFontList(ui::ResourceBundle::GetSharedInstance().GetFontList(
1041 ui::ResourceBundle::SmallFont)); 1038 ui::ResourceBundle::SmallFont));
1042 1039
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
1087 DCHECK(sender == update_button_ || sender == nope_button_); 1084 DCHECK(sender == update_button_ || sender == nope_button_);
1088 if (sender == update_button_) { 1085 if (sender == update_button_) {
1089 if (selection_view_) { 1086 if (selection_view_) {
1090 // Multi account case. 1087 // Multi account case.
1091 parent_->model()->OnUpdateClicked( 1088 parent_->model()->OnUpdateClicked(
1092 *selection_view_->GetSelectedCredentials()); 1089 *selection_view_->GetSelectedCredentials());
1093 } else { 1090 } else {
1094 parent_->model()->OnUpdateClicked( 1091 parent_->model()->OnUpdateClicked(
1095 *parent_->model()->local_credentials()[0]); 1092 *parent_->model()->local_credentials()[0]);
1096 } 1093 }
1094 } else {
1095 parent_->model()->OnNopeUpdateClicked();
1097 } 1096 }
1098 parent_->Close(); 1097 parent_->Close();
1099 } 1098 }
1100 1099
1101 void ManagePasswordsBubbleView::UpdatePendingView::StyledLabelLinkClicked( 1100 void ManagePasswordsBubbleView::UpdatePendingView::StyledLabelLinkClicked(
1102 const gfx::Range& range, 1101 const gfx::Range& range,
1103 int event_flags) { 1102 int event_flags) {
1104 DCHECK_EQ(range, parent_->model()->title_brand_link_range()); 1103 DCHECK_EQ(range, parent_->model()->title_brand_link_range());
1105 parent_->model()->OnBrandLinkClicked(); 1104 parent_->model()->OnBrandLinkClicked();
1106 } 1105 }
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1246 void ManagePasswordsBubbleView::NotifyNeverForThisSiteClicked() { 1245 void ManagePasswordsBubbleView::NotifyNeverForThisSiteClicked() {
1247 if (model()->local_credentials().empty()) { 1246 if (model()->local_credentials().empty()) {
1248 // Skip confirmation if there are no existing passwords for this site. 1247 // Skip confirmation if there are no existing passwords for this site.
1249 NotifyConfirmedNeverForThisSite(); 1248 NotifyConfirmedNeverForThisSite();
1250 } else { 1249 } else {
1251 model()->OnConfirmationForNeverForThisSite(); 1250 model()->OnConfirmationForNeverForThisSite();
1252 Refresh(); 1251 Refresh();
1253 SizeToContents(); 1252 SizeToContents();
1254 } 1253 }
1255 } 1254 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698