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

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: 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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 return true; 206 return true;
207 case ui::VKEY_NEXT: // Page down. 207 case ui::VKEY_NEXT: // Page down.
208 SetSelectedLine(names().size() - 1); 208 SetSelectedLine(names().size() - 1);
209 return true; 209 return true;
210 case ui::VKEY_ESCAPE: 210 case ui::VKEY_ESCAPE:
211 Hide(); 211 Hide();
212 return true; 212 return true;
213 case ui::VKEY_DELETE: 213 case ui::VKEY_DELETE:
214 return (event.modifiers & content::NativeWebKeyboardEvent::ShiftKey) && 214 return (event.modifiers & content::NativeWebKeyboardEvent::ShiftKey) &&
215 RemoveSelectedLine(); 215 RemoveSelectedLine();
216 case ui::VKEY_TAB:
217 // A tab press should cause the highlighted line to be selected, but still
218 // return false so the tab key press propagates and changes the cursor
219 // location.
220 AcceptSelectedLine();
221 return false;
216 case ui::VKEY_RETURN: 222 case ui::VKEY_RETURN:
217 return AcceptSelectedLine(); 223 return AcceptSelectedLine();
218 default: 224 default:
219 return false; 225 return false;
220 } 226 }
221 } 227 }
222 228
223 void AutofillPopupControllerImpl::UpdateBoundsAndRedrawPopup() { 229 void AutofillPopupControllerImpl::UpdateBoundsAndRedrawPopup() {
224 #if !defined(OS_ANDROID) 230 #if !defined(OS_ANDROID)
225 // TODO(csharp): Since UpdatePopupBounds can change the position of the popup, 231 // TODO(csharp): Since UpdatePopupBounds can change the position of the popup,
(...skipping 394 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