Index: chrome/browser/ui/cocoa/autofill/autofill_popup_view_cocoa.mm |
diff --git a/chrome/browser/ui/cocoa/autofill/autofill_popup_view_cocoa.mm b/chrome/browser/ui/cocoa/autofill/autofill_popup_view_cocoa.mm |
index 53abdfa34c4576a4ddbb7113116d84d3ec58884a..0e1e8ca775cc8d79deacfb24a3906e3ba3a65d8d 100644 |
--- a/chrome/browser/ui/cocoa/autofill/autofill_popup_view_cocoa.mm |
+++ b/chrome/browser/ui/cocoa/autofill/autofill_popup_view_cocoa.mm |
@@ -72,14 +72,17 @@ using autofill::AutofillPopupView; |
- (id)initWithFrame:(NSRect)frame { |
NOTREACHED(); |
- return [self initWithController:NULL frame:frame]; |
+ return [self initWithController:NULL frame:frame delegate:NULL]; |
} |
- (id)initWithController:(autofill::AutofillPopupController*)controller |
- frame:(NSRect)frame { |
+ frame:(NSRect)frame |
+ delegate:(autofill::AutofillPopupViewCocoaDelegate*)delegate { |
self = [super initWithDelegate:controller frame:frame]; |
- if (self) |
+ if (self) { |
controller_ = controller; |
+ delegate_ = delegate; |
+ } |
return self; |
} |
@@ -96,8 +99,7 @@ using autofill::AutofillPopupView; |
for (size_t i = 0; i < controller_->GetLineCount(); ++i) { |
// Skip rows outside of the dirty rect. |
- NSRect rowBounds = |
- NSRectFromCGRect(controller_->GetRowBounds(i).ToCGRect()); |
+ NSRect rowBounds = NSRectFromCGRect(delegate_->GetRowBounds(i).ToCGRect()); |
if (!NSIntersectsRect(rowBounds, dirtyRect)) |
continue; |
const autofill::Suggestion& suggestion = controller_->GetSuggestionAt(i); |
@@ -133,8 +135,7 @@ using autofill::AutofillPopupView; |
} |
- (void)invalidateRow:(size_t)row { |
- NSRect dirty_rect = |
- NSRectFromCGRect(controller_->GetRowBounds(row).ToCGRect()); |
+ NSRect dirty_rect = NSRectFromCGRect(delegate_->GetRowBounds(row).ToCGRect()); |
[self setNeedsDisplayInRect:dirty_rect]; |
} |
@@ -252,7 +253,7 @@ using autofill::AutofillPopupView; |
if (icon.empty()) |
return nil; |
- int iconId = controller_->GetIconResourceID(icon); |
+ int iconId = delegate_->GetIconResourceID(icon); |
DCHECK_NE(-1, iconId); |
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |