OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |