@@ -751,21 +751,30 @@ - (void) _loadInvisibleContentForWindow: (NSNotification*) notification
751
751
752
752
- (NSString *) badgeLabelText
753
753
{
754
- if ( [ self _useHDH264Version ] && [self _hasHDH264Version ])
754
+ if ( [ self _useHDH264Version ] && [self _hasHDH264Version ]) {
755
755
return NSLocalizedString( @" HD H.264" , @" HD H.264 badge text" );
756
- if ( [ self _useH264Version ] && [self _hasH264Version ])
757
- return NSLocalizedString( @" H.264" , @" H.264 badge text" );
758
- else if ( _fromYouTube && _videoId)
756
+ } else if ( [ self _useH264Version ] && [self _hasH264Version ]) {
757
+ if (_receivedAllResponses) {
758
+ return NSLocalizedString( @" H.264" , @" H.264 badge text" );
759
+ } else {
760
+ return NSLocalizedString( @" H.264…" , @" H.264 badge waiting text" );
761
+ }
762
+ } else if ( _fromYouTube && _videoId) {
759
763
// we check the video ID too because if it's a flash ad on YouTube.com,
760
764
// we don't want to identify it as an actual YouTube video -- but if
761
765
// the flash object actually has a video ID parameter, it means its
762
766
// a bona fide YouTube video
763
767
764
- return NSLocalizedString( @" YouTube" , @" YouTube badge text" );
765
- else if ( _badgeText )
768
+ if (_receivedAllResponses) {
769
+ return NSLocalizedString( @" YouTube" , @" YouTube badge text" );
770
+ } else {
771
+ return NSLocalizedString( @" YouTube…" , @" YouTube badge waiting text" );
772
+ }
773
+ } else if ( _badgeText ) {
766
774
return _badgeText;
767
- else
775
+ } else {
768
776
return NSLocalizedString( @" Flash" , @" Flash badge text" );
777
+ }
769
778
}
770
779
771
780
- (void ) _drawBadgeWithPressed: (BOOL ) pressed
@@ -1158,24 +1167,27 @@ - (void)_checkForH264VideoVariants
1158
1167
}
1159
1168
1160
1169
expectedResponses = 2 ;
1170
+ _receivedAllResponses = NO ;
1161
1171
}
1162
1172
}
1163
1173
1164
1174
- (void )finishedWithConnection: (NSURLConnection *)connection
1165
1175
{
1166
- BOOL receivedAllResponses = YES ;
1176
+ BOOL didReceiveAllResponses = YES ;
1167
1177
1168
1178
for (int i = 0 ; i < 2 ; ++i) {
1169
1179
if (connection == connections[i]) {
1170
1180
[connection cancel ];
1171
1181
[connection release ];
1172
1182
connections[i] = nil ;
1173
1183
} else if (connections[i])
1174
- receivedAllResponses = NO ;
1184
+ didReceiveAllResponses = NO ;
1175
1185
}
1176
1186
1177
- if (receivedAllResponses)
1178
- [self setUpExtraMenuItems ];
1187
+ if (didReceiveAllResponses) _receivedAllResponses = YES ;
1188
+
1189
+ [self setUpExtraMenuItems ];
1190
+ [self setNeedsDisplay: YES ];
1179
1191
}
1180
1192
1181
1193
- (void )connection: (NSURLConnection *)connection
0 commit comments