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

Issue 7466016: Fix up reload button to not flicker, and simplify implementation. (Closed)

Created:
9 years, 5 months ago by dmac
Modified:
9 years, 4 months ago
CC:
chromium-reviews, Paweł Hajdan Jr.
Visibility:
Public.

Description

Fix up reload button to not flicker, and simplify implementation. BUG=NONE TEST=Build, and test through UI. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=96314

Patch Set 1 #

Patch Set 2 : remove unnecessary header #

Total comments: 19

Patch Set 3 : Fixed up based on comments #

Patch Set 4 : fix up comments #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+173 lines, -146 lines) Patch
M chrome/browser/ui/cocoa/image_button_cell.h View 1 2 3 1 chunk +7 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/image_button_cell.mm View 1 2 3 1 chunk +16 lines, -1 line 0 comments Download
M chrome/browser/ui/cocoa/toolbar/reload_button.h View 2 chunks +3 lines, -16 lines 0 comments Download
M chrome/browser/ui/cocoa/toolbar/reload_button.mm View 1 2 3 chunks +98 lines, -95 lines 2 comments Download
M chrome/browser/ui/cocoa/toolbar/reload_button_unittest.mm View 10 chunks +49 lines, -34 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
dmac
PTAL
9 years, 5 months ago (2011-07-20 22:44:17 UTC) #1
Scott Hess - ex-Googler
http://codereview.chromium.org/7466016/diff/1006/chrome/browser/ui/cocoa/image_button_cell.h File chrome/browser/ui/cocoa/image_button_cell.h (right): http://codereview.chromium.org/7466016/diff/1006/chrome/browser/ui/cocoa/image_button_cell.h#newcode27 chrome/browser/ui/cocoa/image_button_cell.h:27: // and the mouse enters or exits the cell. ...
9 years, 5 months ago (2011-07-21 00:48:40 UTC) #2
dmac
Thanks Scott... PTAL with the new code. http://codereview.chromium.org/7466016/diff/1006/chrome/browser/ui/cocoa/image_button_cell.h File chrome/browser/ui/cocoa/image_button_cell.h (right): http://codereview.chromium.org/7466016/diff/1006/chrome/browser/ui/cocoa/image_button_cell.h#newcode27 chrome/browser/ui/cocoa/image_button_cell.h:27: // and ...
9 years, 4 months ago (2011-07-29 20:01:00 UTC) #3
dmac
On 2011/07/29 20:01:00, dmac wrote: > Thanks Scott... PTAL with the new code. > > ...
9 years, 4 months ago (2011-08-01 21:37:52 UTC) #4
Scott Hess - ex-Googler
9 years, 4 months ago (2011-08-04 23:49:44 UTC) #5
LGTM.

Sorry about the delay, got distracted by something shiny.  I'll go try to see
whether I can find the edge case I worried about earlier, but I'm not sure
that's worth blocking over.

http://codereview.chromium.org/7466016/diff/1006/chrome/browser/ui/cocoa/tool...
File chrome/browser/ui/cocoa/toolbar/reload_button.mm (right):

http://codereview.chromium.org/7466016/diff/1006/chrome/browser/ui/cocoa/tool...
chrome/browser/ui/cocoa/toolbar/reload_button.mm:23: - (void)commonInit;
On 2011/07/29 20:01:00, dmac wrote:
> On 2011/07/21 00:48:40, shess wrote:
> > -sharedInit is used in two cases, -commonInit is used in one.  Which
honestly
> > makes me wonder if it wouldn't be better to use an init function in the
> > anonymous namespace.
> 
> Not sure what you meant by the anonymous namespace, but it turns out the
> sharedInit is unnecessary and initWithFrame: can call awakeFromNib.

Mostly I meant that hidden objc methods like this aren't namespaced, which is
annoying.  It could have been a function in an anonymous namespace and then it
wouldn't have that problem (but would be 23% more annoying).  But no method at
all is better!

http://codereview.chromium.org/7466016/diff/6001/chrome/browser/ui/cocoa/tool...
chrome/browser/ui/cocoa/toolbar/reload_button.mm:164: 
This seems contrived (pendingReloadTimer_ is nil, which matches in
-forceReloadState:, but still).  WDYT about just calling -setIsLoading:NO
force:YES directly?  Though I suppose that makes it a bit more brittle.

http://codereview.chromium.org/7466016/diff/6001/chrome/browser/ui/cocoa/tool...
chrome/browser/ui/cocoa/toolbar/reload_button.mm:178: 
No need for the if(), and this can't possibly happen enough to be noticeable.

Powered by Google App Engine
This is Rietveld 408576698