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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 | 6 |
7 #include "chrome/browser/ui/cocoa/autofill/autofill_popup_view_bridge.h" | 7 #include "chrome/browser/ui/cocoa/autofill/autofill_popup_view_bridge.h" |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "chrome/browser/ui/autofill/autofill_popup_controller.h" | 10 #include "chrome/browser/ui/autofill/autofill_popup_controller.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 } | 38 } |
39 | 39 |
40 void AutofillPopupViewBridge::Hide() { | 40 void AutofillPopupViewBridge::Hide() { |
41 delete this; | 41 delete this; |
42 } | 42 } |
43 | 43 |
44 void AutofillPopupViewBridge::Show() { | 44 void AutofillPopupViewBridge::Show() { |
45 [view_ showPopup]; | 45 [view_ showPopup]; |
46 } | 46 } |
47 | 47 |
48 void AutofillPopupViewBridge::InvalidateRow(size_t row) { | 48 void AutofillPopupViewBridge::OnSelectedRowChanged( |
49 [view_ invalidateRow:row]; | 49 base::Optional<size_t> previous_row_selection, |
| 50 base::Optional<size_t> current_row_selection) { |
| 51 if (previous_row_selection && |
| 52 previous_row_selection < controller_->GetLineCount()) { |
| 53 [view_ invalidateRow:*previous_row_selection]; |
| 54 } |
| 55 |
| 56 if (current_row_selection) { |
| 57 [view_ invalidateRow:*current_row_selection]; |
| 58 } |
50 } | 59 } |
51 | 60 |
52 void AutofillPopupViewBridge::UpdateBoundsAndRedrawPopup() { | 61 void AutofillPopupViewBridge::OnSuggestionsChanged() { |
53 [view_ updateBoundsAndRedrawPopup]; | 62 [view_ updateBoundsAndRedrawPopup]; |
54 } | 63 } |
55 | 64 |
56 AutofillPopupView* AutofillPopupView::Create( | 65 AutofillPopupView* AutofillPopupView::Create( |
57 AutofillPopupController* controller) { | 66 AutofillPopupController* controller) { |
58 return new AutofillPopupViewBridge(controller); | 67 return new AutofillPopupViewBridge(controller); |
59 } | 68 } |
60 | 69 |
61 } // namespace autofill | 70 } // namespace autofill |
OLD | NEW |