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

Unified Diff: chrome/browser/ui/cocoa/autofill/autofill_popup_view_cocoa.mm

Issue 1570783003: [Autofill] Move functions from the AutofillPopupController to AutofillPopupLayoutModel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove scoped_ptr and rename mac delegate Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
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();

Powered by Google App Engine
This is Rietveld 408576698