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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 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 |