| 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 "chrome/browser/ui/cocoa/autofill/autofill_popup_view_cocoa.h" | 5 #import "chrome/browser/ui/cocoa/autofill/autofill_popup_view_cocoa.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/sys_string_conversions.h" | 8 #include "base/strings/sys_string_conversions.h" |
| 9 #include "chrome/browser/ui/autofill/autofill_popup_controller.h" | 9 #include "chrome/browser/ui/autofill/autofill_popup_controller.h" |
| 10 #include "chrome/browser/ui/cocoa/autofill/autofill_popup_view_bridge.h" | 10 #include "chrome/browser/ui/cocoa/autofill/autofill_popup_view_bridge.h" |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 [path stroke]; | 127 [path stroke]; |
| 128 | 128 |
| 129 for (size_t i = 0; i < controller_->names().size(); ++i) { | 129 for (size_t i = 0; i < controller_->names().size(); ++i) { |
| 130 // Skip rows outside of the dirty rect. | 130 // Skip rows outside of the dirty rect. |
| 131 NSRect rowBounds = | 131 NSRect rowBounds = |
| 132 NSRectFromCGRect(controller_->GetRowBounds(i).ToCGRect()); | 132 NSRectFromCGRect(controller_->GetRowBounds(i).ToCGRect()); |
| 133 if (!NSIntersectsRect(rowBounds, dirtyRect)) | 133 if (!NSIntersectsRect(rowBounds, dirtyRect)) |
| 134 continue; | 134 continue; |
| 135 | 135 |
| 136 if (controller_->identifiers()[i] == | 136 if (controller_->identifiers()[i] == |
| 137 WebKit::WebAutofillClient::MenuItemIDSeparator) { | 137 blink::WebAutofillClient::MenuItemIDSeparator) { |
| 138 [self drawSeparatorWithBounds:rowBounds]; | 138 [self drawSeparatorWithBounds:rowBounds]; |
| 139 } else { | 139 } else { |
| 140 NSString* name = SysUTF16ToNSString(controller_->names()[i]); | 140 NSString* name = SysUTF16ToNSString(controller_->names()[i]); |
| 141 NSString* subtext = SysUTF16ToNSString(controller_->subtexts()[i]); | 141 NSString* subtext = SysUTF16ToNSString(controller_->subtexts()[i]); |
| 142 BOOL isSelected = static_cast<int>(i) == controller_->selected_line(); | 142 BOOL isSelected = static_cast<int>(i) == controller_->selected_line(); |
| 143 [self drawSuggestionWithName:name | 143 [self drawSuggestionWithName:name |
| 144 subtext:subtext | 144 subtext:subtext |
| 145 index:i | 145 index:i |
| 146 bounds:rowBounds | 146 bounds:rowBounds |
| 147 selected:isSelected]; | 147 selected:isSelected]; |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 return nil; | 275 return nil; |
| 276 | 276 |
| 277 int iconId = controller_->GetIconResourceID(controller_->icons()[index]); | 277 int iconId = controller_->GetIconResourceID(controller_->icons()[index]); |
| 278 DCHECK_NE(-1, iconId); | 278 DCHECK_NE(-1, iconId); |
| 279 | 279 |
| 280 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 280 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| 281 return rb.GetNativeImageNamed(iconId).ToNSImage(); | 281 return rb.GetNativeImageNamed(iconId).ToNSImage(); |
| 282 } | 282 } |
| 283 | 283 |
| 284 @end | 284 @end |
| OLD | NEW |