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

Unified Diff: chrome/browser/ui/views/autofill/autofill_dialog_views.cc

Issue 22339012: rAc: Scroll to any input that receives keyboard focus (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/autofill/autofill_dialog_views.cc
diff --git a/chrome/browser/ui/views/autofill/autofill_dialog_views.cc b/chrome/browser/ui/views/autofill/autofill_dialog_views.cc
index 40db3e6d7cd780463088efd9170f38894a3856e3..e6d0e075104466da652090360ac0e663f02cae84 100644
--- a/chrome/browser/ui/views/autofill/autofill_dialog_views.cc
+++ b/chrome/browser/ui/views/autofill/autofill_dialog_views.cc
@@ -1679,8 +1679,10 @@ void AutofillDialogViews::OnDidChangeFocus(
}
// Show an error bubble when the user focuses the input.
- if (focused_now)
+ if (focused_now) {
+ focused_now->ScrollRectToVisible(focused_now->GetLocalBounds());
ShowErrorBubbleForViewIfNecessary(focused_now);
+ }
}
void AutofillDialogViews::OnSelectedIndexChanged(views::Combobox* combobox) {
@@ -2015,14 +2017,13 @@ void AutofillDialogViews::ShowErrorBubbleForViewIfNecessary(views::View* view) {
if (!view->GetWidget())
return;
- if (error_bubble_ && error_bubble_->anchor() == view)
- return;
-
std::map<views::View*, base::string16>::iterator error_message =
validity_map_.find(view);
if (error_message != validity_map_.end()) {
view->ScrollRectToVisible(view->GetLocalBounds());
- error_bubble_.reset(new ErrorBubble(view, error_message->second));
+
+ if (!error_bubble_ || error_bubble_->anchor() != view)
+ error_bubble_.reset(new ErrorBubble(view, error_message->second));
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698