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

Side by Side Diff: chrome/browser/ui/cocoa/autofill/autofill_popup_view_bridge.mm

Issue 2727233003: Uses child views in Autofill Popup so we can trigger (Closed)
Patch Set: (int) to NSInteger Created 3 years, 9 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 #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 10 matching lines...) Expand all
21 view_.reset([[AutofillPopupViewCocoa alloc] initWithController:controller 21 view_.reset([[AutofillPopupViewCocoa alloc] initWithController:controller
22 frame:NSZeroRect 22 frame:NSZeroRect
23 delegate:this]); 23 delegate:this]);
24 } 24 }
25 25
26 AutofillPopupViewBridge::~AutofillPopupViewBridge() { 26 AutofillPopupViewBridge::~AutofillPopupViewBridge() {
27 [view_ controllerDestroyed]; 27 [view_ controllerDestroyed];
28 [view_ hidePopup]; 28 [view_ hidePopup];
29 } 29 }
30 30
31 gfx::Rect AutofillPopupViewBridge::GetRowBounds(size_t index) { 31 gfx::Rect AutofillPopupViewBridge::GetRowBounds(int index) {
32 return controller_->layout_model().GetRowBounds(index); 32 return controller_->layout_model().GetRowBounds(index);
33 } 33 }
34 34
35 int AutofillPopupViewBridge::GetIconResourceID( 35 int AutofillPopupViewBridge::GetIconResourceID(
36 const base::string16& resource_name) { 36 const base::string16& resource_name) {
37 return controller_->layout_model().GetIconResourceID(resource_name); 37 return controller_->layout_model().GetIconResourceID(resource_name);
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<int> previous_row_selection,
50 base::Optional<int> current_row_selection) {
51 if (previous_row_selection) {
52 [view_ invalidateRow:*previous_row_selection];
53 }
54
55 if (current_row_selection) {
56 [view_ invalidateRow:*current_row_selection];
57 }
50 } 58 }
51 59
52 void AutofillPopupViewBridge::UpdateBoundsAndRedrawPopup() { 60 void AutofillPopupViewBridge::OnSuggestionsChanged() {
53 [view_ updateBoundsAndRedrawPopup]; 61 [view_ updateBoundsAndRedrawPopup];
54 } 62 }
55 63
56 AutofillPopupView* AutofillPopupView::Create( 64 AutofillPopupView* AutofillPopupView::Create(
57 AutofillPopupController* controller) { 65 AutofillPopupController* controller) {
58 return new AutofillPopupViewBridge(controller); 66 return new AutofillPopupViewBridge(controller);
59 } 67 }
60 68
61 } // namespace autofill 69 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698