Chromium Code Reviews

Issue 264037: Refactor security-icon code to a more general form (Closed)

Created:
11 years, 2 months ago by Pam (message me for reviews)
Modified:
9 years, 5 months ago
Reviewers:
hawk, Scott Hess - ex-Googler
CC:
chromium-reviews_googlegroups.com, John Grabowski, pam+watch_chromium.org, ben+cc_chromium.org
Visibility:
Public.

Description

Refactor security-icon code to a more general form, also more consistent with the Windows implementation, in preparation for implementing page actions. BUG=14899, 22922, 12281 TEST=unit tests included Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=29827

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Total comments: 4

Patch Set 7 : '' #

Patch Set 8 : '' #

Total comments: 25

Patch Set 9 : '' #

Patch Set 10 : '' #

Patch Set 11 : '' #

Patch Set 12 : '' #

Unified diffs Side-by-side diffs Stats (+319 lines, -132 lines)
M chrome/browser/autocomplete/autocomplete_edit_view_mac.h View 1 chunk +0 lines, -1 line 0 comments
M chrome/browser/autocomplete/autocomplete_edit_view_mac.mm View 2 chunks +0 lines, -12 lines 0 comments
M chrome/browser/cocoa/autocomplete_text_field.h View 1 chunk +0 lines, -4 lines 0 comments
M chrome/browser/cocoa/autocomplete_text_field.mm View 1 chunk +4 lines, -4 lines 0 comments
M chrome/browser/cocoa/autocomplete_text_field_cell.h View 5 chunks +13 lines, -13 lines 0 comments
M chrome/browser/cocoa/autocomplete_text_field_cell.mm View 7 chunks +63 lines, -60 lines 0 comments
M chrome/browser/cocoa/autocomplete_text_field_cell_unittest.mm View 6 chunks +38 lines, -11 lines 0 comments
M chrome/browser/cocoa/autocomplete_text_field_unittest.mm View 3 chunks +19 lines, -5 lines 0 comments
M chrome/browser/cocoa/autocomplete_text_field_unittest_helper.h View 1 chunk +0 lines, -1 line 0 comments
M chrome/browser/cocoa/location_bar_view_mac.h View 2 chunks +76 lines, -1 line 0 comments
M chrome/browser/cocoa/location_bar_view_mac.mm View 4 chunks +106 lines, -20 lines 0 comments

Messages

Total messages: 7 (0 generated)
Pam (message me for reviews)
I pulled out some of the icon-handling code into the location bar. This matches the ...
11 years, 2 months ago (2009-10-16 21:31:29 UTC) #1
Pam (message me for reviews)
Thanks for the review. New patch uploaded. (Patch 8 fixes a comment. See patch 7 ...
11 years, 2 months ago (2009-10-19 23:26:16 UTC) #2
Scott Hess - ex-Googler
I'm getting the hang of this change, now. I initially felt like it was scary ...
11 years, 2 months ago (2009-10-21 00:17:15 UTC) #3
Pam (message me for reviews)
Thanks, new patch coming momentarily. http://codereview.chromium.org/264037/diff/20004/20010 File chrome/browser/cocoa/autocomplete_text_field_cell.h (right): http://codereview.chromium.org/264037/diff/20004/20010#newcode41 Line 41: LocationBarViewMac::SecurityImageView* security_image_view_; On ...
11 years, 2 months ago (2009-10-21 22:23:39 UTC) #4
Scott Hess - ex-Googler
My change which makes -resetFieldEditorIfNeeded work without having to set the cell's flag is in, ...
11 years, 2 months ago (2009-10-21 23:27:19 UTC) #5
Pam (message me for reviews)
On 2009/10/21 23:27:19, shess wrote: > Would it be reasonable to have SecurityImageView export a ...
11 years, 2 months ago (2009-10-22 19:30:40 UTC) #6
Scott Hess - ex-Googler
11 years, 2 months ago (2009-10-22 20:26:56 UTC) #7
On 2009/10/22 19:30:40, Pam wrote:
> On 2009/10/21 23:27:19, shess wrote:
> 
> > Would it be reasonable to have SecurityImageView export a LockImage() static
> > instead?  Why I ask is because the current code requires us to retain both
> > images in all cases, even if they are not needed.  Using a static function
> would
> > give the same benefits as currently, with lazy creation.
> > 
> > [So I mean like SetImageShown(SecurityImageView::LockImage());]
> 
> It seems odd to me to call a class method with an argument that's part of that
> same class.

security_image_view_.SetImage(SecurityImageView::LockImage());
   vs
security_image_view_.SetImageShown(SecurityImageView::LOCK);

> How about this (see patch)? Still indirect through the enum, but now
> loaded lazily.

LGTM, my main goal was the lazy part.

Thanks for putting up with me,
scott

Powered by Google App Engine