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

Side by Side Diff: chrome/browser/ui/autofill/autofill_popup_controller_impl.cc

Issue 13912016: [Autofill] Handle the Tab Key in the new UI (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Switch to ObserverList and AddTest Created 7 years, 8 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/autofill/autofill_popup_controller_impl.h" 5 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 return true; 203 return true;
204 case ui::VKEY_NEXT: // Page down. 204 case ui::VKEY_NEXT: // Page down.
205 SetSelectedLine(names().size() - 1); 205 SetSelectedLine(names().size() - 1);
206 return true; 206 return true;
207 case ui::VKEY_ESCAPE: 207 case ui::VKEY_ESCAPE:
208 Hide(); 208 Hide();
209 return true; 209 return true;
210 case ui::VKEY_DELETE: 210 case ui::VKEY_DELETE:
211 return (event.modifiers & content::NativeWebKeyboardEvent::ShiftKey) && 211 return (event.modifiers & content::NativeWebKeyboardEvent::ShiftKey) &&
212 RemoveSelectedLine(); 212 RemoveSelectedLine();
213 case ui::VKEY_TAB:
214 // A tab press should cause the highlighted line to be selected, but still
215 // return false so the tab key press propagates and changes the cursor
216 // location.
217 AcceptSelectedLine();
218 return false;
213 case ui::VKEY_RETURN: 219 case ui::VKEY_RETURN:
214 return AcceptSelectedLine(); 220 return AcceptSelectedLine();
215 default: 221 default:
216 return false; 222 return false;
217 } 223 }
218 } 224 }
219 225
220 void AutofillPopupControllerImpl::UpdateBoundsAndRedrawPopup() { 226 void AutofillPopupControllerImpl::UpdateBoundsAndRedrawPopup() {
221 #if !defined(OS_ANDROID) 227 #if !defined(OS_ANDROID)
222 // TODO(csharp): Since UpdatePopupBounds can change the position of the popup, 228 // TODO(csharp): Since UpdatePopupBounds can change the position of the popup,
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 // The popup can appear below the field. 626 // The popup can appear below the field.
621 return std::make_pair(bottom_growth_start, popup_required_height); 627 return std::make_pair(bottom_growth_start, popup_required_height);
622 } else { 628 } else {
623 // The popup must appear above the field. 629 // The popup must appear above the field.
624 return std::make_pair(top_growth_end - popup_required_height, 630 return std::make_pair(top_growth_end - popup_required_height,
625 popup_required_height); 631 popup_required_height);
626 } 632 }
627 } 633 }
628 634
629 } // namespace autofill 635 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698