diff options
author | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-21 14:51:18 +0000 |
---|---|---|
committer | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-21 14:51:18 +0000 |
commit | c124858a8e8865cb7f6a478de8f391ba2cd821e1 (patch) | |
tree | eb54eaef24f525af3d23d5375d87718c3fbce92d /chrome/browser/cocoa | |
parent | 00a5deb323664044ecc235a8867a1a32b237b2bd (diff) | |
download | chromium_src-c124858a8e8865cb7f6a478de8f391ba2cd821e1.zip chromium_src-c124858a8e8865cb7f6a478de8f391ba2cd821e1.tar.gz chromium_src-c124858a8e8865cb7f6a478de8f391ba2cd821e1.tar.bz2 |
Re-enabling throbber with some image caching. This will probably regress the tab_cold timing on the perf bot, but that's expected. Future CLs will tinker.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16600 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa')
-rw-r--r-- | chrome/browser/cocoa/tab_strip_controller.mm | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/chrome/browser/cocoa/tab_strip_controller.mm b/chrome/browser/cocoa/tab_strip_controller.mm index dd063544..210b935 100644 --- a/chrome/browser/cocoa/tab_strip_controller.mm +++ b/chrome/browser/cocoa/tab_strip_controller.mm @@ -379,7 +379,7 @@ if (!loading) [self setTabTitle:[tabArray_ objectAtIndex:index] withContents:contents]; -#if 0 +#if 1 // TODO(pinkerton): Enabling this slowed down the tab_cold startup test by // close to 5 seconds. Turning it off to see if the bot returns to normal. // Update the current loading state, replacing the icon with a throbber, or @@ -387,18 +387,21 @@ // load, so we need to make sure we're not creating the throbber view over and // over. if (contents) { + static NSImage* throbberImage = [[NSImage imageNamed:@"throbber"] retain]; + static NSImage* throbberWaitingImage = + [[NSImage imageNamed:@"throbber_waiting"] retain]; + TabController* tabController = [tabArray_ objectAtIndex:index]; - NSString* imageName = nil; + NSImage* image = nil; if (contents->waiting_for_response() && ![tabController waiting]) { - imageName = @"throbber_waiting"; + image = throbberWaitingImage; [tabController setWaiting:YES]; } else if (contents->is_loading() && ![tabController loading]) { - imageName = @"throbber"; + image = throbberImage; [tabController setLoading:YES]; } - if (imageName) { + if (image) { NSRect frame = NSMakeRect(0, 0, 16, 16); - NSImage* image = [NSImage imageNamed:imageName]; ThrobberView* throbber = [[[ThrobberView alloc] initWithFrame:frame image:image] autorelease]; [tabController setIconView:throbber]; |