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

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

Issue 2496683003: Http Bad: Add a PopupItemId to identify http warning message (Closed)
Patch Set: minor change Created 4 years, 1 month 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 "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/autofill/autofill_popup_layout_model.h" 10 #include "chrome/browser/ui/autofill/autofill_popup_layout_model.h"
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 textYOffset:textYOffset]; 189 textYOffset:textYOffset];
190 } 190 }
191 191
192 - (CGFloat)drawName:(NSString*)name 192 - (CGFloat)drawName:(NSString*)name
193 atX:(CGFloat)x 193 atX:(CGFloat)x
194 index:(size_t)index 194 index:(size_t)index
195 rightAlign:(BOOL)rightAlign 195 rightAlign:(BOOL)rightAlign
196 bounds:(NSRect)bounds 196 bounds:(NSRect)bounds
197 textYOffset:(CGFloat)textYOffset { 197 textYOffset:(CGFloat)textYOffset {
198 NSColor* nameColor = 198 NSColor* nameColor =
199 // TODO(lshang): Use AutofillPopupLayoutModel::GetValueFontColorForRow()
Mathieu 2016/11/16 22:29:36 nit: the format for TODO is TODO(crbug.com/xxxxxx)
lshang 2016/11/17 07:03:46 Done.
200 // instead and remove IsWarning() method.
199 controller_->IsWarning(index) ? [self warningColor] : [self nameColor]; 201 controller_->IsWarning(index) ? [self warningColor] : [self nameColor];
200 NSDictionary* nameAttributes = [NSDictionary 202 NSDictionary* nameAttributes = [NSDictionary
201 dictionaryWithObjectsAndKeys:controller_->layout_model() 203 dictionaryWithObjectsAndKeys:controller_->layout_model()
202 .GetValueFontListForRow(index) 204 .GetValueFontListForRow(index)
203 .GetPrimaryFont() 205 .GetPrimaryFont()
204 .GetNativeFont(), 206 .GetNativeFont(),
205 NSFontAttributeName, nameColor, 207 NSFontAttributeName, nameColor,
206 NSForegroundColorAttributeName, nil]; 208 NSForegroundColorAttributeName, nil];
207 NSSize nameSize = [name sizeWithAttributes:nameAttributes]; 209 NSSize nameSize = [name sizeWithAttributes:nameAttributes];
208 x -= rightAlign ? nameSize.width : 0; 210 x -= rightAlign ? nameSize.width : 0;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 return nil; 267 return nil;
266 268
267 int iconId = delegate_->GetIconResourceID(icon); 269 int iconId = delegate_->GetIconResourceID(icon);
268 DCHECK_NE(-1, iconId); 270 DCHECK_NE(-1, iconId);
269 271
270 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 272 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
271 return rb.GetNativeImageNamed(iconId).ToNSImage(); 273 return rb.GetNativeImageNamed(iconId).ToNSImage();
272 } 274 }
273 275
274 @end 276 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698