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

Unified Diff: chrome/browser/ui/cocoa/autofill/autofill_popup_view_cocoa.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 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 e95bea9dbb9910071305acea2af39d3c9a7c0df9..a703235eebea6fc39b3e22916fb105a3da3f43db 100644
--- a/chrome/browser/ui/cocoa/autofill/autofill_popup_view_cocoa.mm
+++ b/chrome/browser/ui/cocoa/autofill/autofill_popup_view_cocoa.mm
@@ -42,7 +42,7 @@ using autofill::AutofillPopupLayoutModel;
// if the row requires it -- such as for credit cards.
- (void)drawSuggestionWithName:(NSString*)name
subtext:(NSString*)subtext
- index:(size_t)index
+ index:(NSInteger)index
bounds:(NSRect)bounds
selected:(BOOL)isSelected
textYOffset:(CGFloat)textYOffset;
@@ -56,24 +56,24 @@ using autofill::AutofillPopupLayoutModel;
// Returns the x value of right border of the widget.
- (CGFloat)drawName:(NSString*)name
atX:(CGFloat)x
- index:(size_t)index
+ index:(NSInteger)index
rightAlign:(BOOL)rightAlign
bounds:(NSRect)bounds
textYOffset:(CGFloat)textYOffset;
-- (CGFloat)drawIconAtIndex:(size_t)index
+- (CGFloat)drawIconAtIndex:(NSInteger)index
atX:(CGFloat)x
rightAlign:(BOOL)rightAlign
bounds:(NSRect)bounds;
- (CGFloat)drawSubtext:(NSString*)subtext
atX:(CGFloat)x
- index:(size_t)index
+ index:(NSInteger)index
rightAlign:(BOOL)rightAlign
bounds:(NSRect)bounds
textYOffset:(CGFloat)textYOffset;
// Returns the icon for the row with the given |index|, or |nil| if there is
// none.
-- (NSImage*)iconAtIndex:(size_t)index;
+- (NSImage*)iconAtIndex:(NSInteger)index;
@end
@@ -109,7 +109,7 @@ using autofill::AutofillPopupLayoutModel;
[self drawBackgroundAndBorder];
- for (size_t i = 0; i < controller_->GetLineCount(); ++i) {
+ for (int i = 0; i < controller_->GetLineCount(); ++i) {
// Skip rows outside of the dirty rect.
NSRect rowBounds = NSRectFromCGRect(delegate_->GetRowBounds(i).ToCGRect());
if (!NSIntersectsRect(rowBounds, dirtyRect))
@@ -126,7 +126,8 @@ using autofill::AutofillPopupLayoutModel;
NSString* value = SysUTF16ToNSString(controller_->GetElidedValueAt(i));
NSString* label = SysUTF16ToNSString(controller_->GetElidedLabelAt(i));
- BOOL isSelected = static_cast<int>(i) == controller_->selected_line();
+ BOOL isSelected =
+ controller_->selected_line() && i == *controller_->selected_line();
[self drawSuggestionWithName:value
subtext:label
index:i
@@ -146,7 +147,7 @@ using autofill::AutofillPopupLayoutModel;
[super delegateDestroyed];
}
-- (void)invalidateRow:(size_t)row {
+- (void)invalidateRow:(NSInteger)row {
NSRect dirty_rect = NSRectFromCGRect(delegate_->GetRowBounds(row).ToCGRect());
[self setNeedsDisplayInRect:dirty_rect];
}
@@ -156,7 +157,7 @@ using autofill::AutofillPopupLayoutModel;
- (void)drawSuggestionWithName:(NSString*)name
subtext:(NSString*)subtext
- index:(size_t)index
+ index:(NSInteger)index
bounds:(NSRect)bounds
selected:(BOOL)isSelected
textYOffset:(CGFloat)textYOffset {
@@ -211,7 +212,7 @@ using autofill::AutofillPopupLayoutModel;
- (CGFloat)drawName:(NSString*)name
atX:(CGFloat)x
- index:(size_t)index
+ index:(NSInteger)index
rightAlign:(BOOL)rightAlign
bounds:(NSRect)bounds
textYOffset:(CGFloat)textYOffset {
@@ -236,7 +237,7 @@ using autofill::AutofillPopupLayoutModel;
return x;
}
-- (CGFloat)drawIconAtIndex:(size_t)index
+- (CGFloat)drawIconAtIndex:(NSInteger)index
atX:(CGFloat)x
rightAlign:(BOOL)rightAlign
bounds:(NSRect)bounds {
@@ -260,7 +261,7 @@ using autofill::AutofillPopupLayoutModel;
- (CGFloat)drawSubtext:(NSString*)subtext
atX:(CGFloat)x
- index:(size_t)index
+ index:(NSInteger)index
rightAlign:(BOOL)rightAlign
bounds:(NSRect)bounds
textYOffset:(CGFloat)textYOffset {
@@ -281,7 +282,7 @@ using autofill::AutofillPopupLayoutModel;
return x;
}
-- (NSImage*)iconAtIndex:(size_t)index {
+- (NSImage*)iconAtIndex:(NSInteger)index {
const int kHttpWarningIconWidth = 16;
const base::string16& icon = controller_->GetSuggestionAt(index).icon;
if (icon.empty())

Powered by Google App Engine
This is Rietveld 408576698