[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
cblu
cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:35:58 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit cd430f3e9f10cefd68a90910446d3aa9460bb350
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Sep 3 19:01:06 2002 +0000
WebKit:
- Moved the default icon method to WebIconDatabase
- Removed "icon URL" from the location change handler API
* History.subproj/WebHistoryItem.m:
(-[WebHistoryItem icon]): don't worry about iconForSiteURL:withSize: returning nil
* Misc.subproj/WebIconDatabase.h:
* Misc.subproj/WebIconDatabase.m:
(-[WebIconDatabase iconForSiteURL:withSize:]): return defaultIconWithSize if none found
(-[WebIconDatabase defaultIconWithSize:]): added, loads, caches default icon
(-[WebIconDatabase _hasIconForSiteURL:]): added, called by webdatasource to determine if icon is necessary
* Misc.subproj/WebIconDatabasePrivate.h: added _hasIconForSiteURL
* Misc.subproj/WebIconLoader.h: removed default icon method
* Misc.subproj/WebIconLoader.m: removed default icon method
* Resources/url_icon.tiff: resized to 32 x 32
* WebKit.exp: export symbol for a dictionary key
* WebKit.pbproj/project.pbxproj:
* WebView.subproj/WebDataSourcePrivate.m:
(-[WebDataSource _loadIcon]): call _hasIconForSiteURL
* WebView.subproj/WebHTMLView.m:
(-[WebHTMLView mouseDragged:]): call defaultIconWithSize
* WebView.subproj/WebLocationChangeHandler.h:
* WebView.subproj/WebLocationChangeHandler.m:
(-[WebLocationChangeHandler receivedPageIcon:forDataSource:]): renamed
WebBrowser:
- Moved the default icon method to WebIconDatabase
- Removed "icon URL" from the location change handler API
* ABHomePagesController.m:
(-[ABHomePagesController tableView:willDisplayCell:forTableColumn:row:]): call defaultIconWithSize
* BrowserWindowController.m:
(-[BrowserWindowController frameLoadCommitted:]): call defaultIconWithSize
(-[BrowserWindowController setUpFavoritesBar]): call defaultIconWithSize
* LocationChangeHandler.m:
(-[LocationChangeHandler receivedPageIcon:forDataSource:]): renamed, don't use icon URL anymore
* LocationTextField.m:
(-[LocationTextField setDisplayAttributes]): call defaultIconWithSize
(-[LocationTextField textDidChange:]): call defaultIconWithSize
* RendezvousController.m:
(-[RendezvousController _iconForServiceDictionary:]): call defaultIconWithSize
* TitleBarButton.m:
(-[TitleBarButton initWithFrame:]): call defaultIconWithSize
* WebBrowser.pbproj/project.pbxproj:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1953 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 9cffaa3..8b02ea5 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,29 @@
+2002-09-03 Chris Blumenberg <cblu at apple.com>
+
+ - Moved the default icon method to WebIconDatabase
+ - Removed "icon URL" from the location change handler API
+
+ * History.subproj/WebHistoryItem.m:
+ (-[WebHistoryItem icon]): don't worry about iconForSiteURL:withSize: returning nil
+ * Misc.subproj/WebIconDatabase.h:
+ * Misc.subproj/WebIconDatabase.m:
+ (-[WebIconDatabase iconForSiteURL:withSize:]): return defaultIconWithSize if none found
+ (-[WebIconDatabase defaultIconWithSize:]): added, loads, caches default icon
+ (-[WebIconDatabase _hasIconForSiteURL:]): added, called by webdatasource to determine if icon is necessary
+ * Misc.subproj/WebIconDatabasePrivate.h: added _hasIconForSiteURL
+ * Misc.subproj/WebIconLoader.h: removed default icon method
+ * Misc.subproj/WebIconLoader.m: removed default icon method
+ * Resources/url_icon.tiff: resized to 32 x 32
+ * WebKit.exp: export symbol for a dictionary key
+ * WebKit.pbproj/project.pbxproj:
+ * WebView.subproj/WebDataSourcePrivate.m:
+ (-[WebDataSource _loadIcon]): call _hasIconForSiteURL
+ * WebView.subproj/WebHTMLView.m:
+ (-[WebHTMLView mouseDragged:]): call defaultIconWithSize
+ * WebView.subproj/WebLocationChangeHandler.h:
+ * WebView.subproj/WebLocationChangeHandler.m:
+ (-[WebLocationChangeHandler receivedPageIcon:forDataSource:]): renamed
+
2002-09-03 Ken Kocienda <kocienda at apple.com>
Modify calls into WebFoundation to use the new WebResourceRequest class,
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 9cffaa3..8b02ea5 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,29 @@
+2002-09-03 Chris Blumenberg <cblu at apple.com>
+
+ - Moved the default icon method to WebIconDatabase
+ - Removed "icon URL" from the location change handler API
+
+ * History.subproj/WebHistoryItem.m:
+ (-[WebHistoryItem icon]): don't worry about iconForSiteURL:withSize: returning nil
+ * Misc.subproj/WebIconDatabase.h:
+ * Misc.subproj/WebIconDatabase.m:
+ (-[WebIconDatabase iconForSiteURL:withSize:]): return defaultIconWithSize if none found
+ (-[WebIconDatabase defaultIconWithSize:]): added, loads, caches default icon
+ (-[WebIconDatabase _hasIconForSiteURL:]): added, called by webdatasource to determine if icon is necessary
+ * Misc.subproj/WebIconDatabasePrivate.h: added _hasIconForSiteURL
+ * Misc.subproj/WebIconLoader.h: removed default icon method
+ * Misc.subproj/WebIconLoader.m: removed default icon method
+ * Resources/url_icon.tiff: resized to 32 x 32
+ * WebKit.exp: export symbol for a dictionary key
+ * WebKit.pbproj/project.pbxproj:
+ * WebView.subproj/WebDataSourcePrivate.m:
+ (-[WebDataSource _loadIcon]): call _hasIconForSiteURL
+ * WebView.subproj/WebHTMLView.m:
+ (-[WebHTMLView mouseDragged:]): call defaultIconWithSize
+ * WebView.subproj/WebLocationChangeHandler.h:
+ * WebView.subproj/WebLocationChangeHandler.m:
+ (-[WebLocationChangeHandler receivedPageIcon:forDataSource:]): renamed
+
2002-09-03 Ken Kocienda <kocienda at apple.com>
Modify calls into WebFoundation to use the new WebResourceRequest class,
diff --git a/WebKit/History.subproj/WebHistoryItem.m b/WebKit/History.subproj/WebHistoryItem.m
index 32c617c..98f96cb 100644
--- a/WebKit/History.subproj/WebHistoryItem.m
+++ b/WebKit/History.subproj/WebHistoryItem.m
@@ -114,18 +114,12 @@
-(NSImage *)icon
{
if (!_loadedIcon) {
- NSImage *newIcon;
-
- if (_URL != nil) {
- newIcon = [[WebIconDatabase sharedIconDatabase] iconForSiteURL:_URL withSize:WebIconSmallSize];
- }else{
- newIcon = nil;
- }
+ NSImage *newIcon = [[WebIconDatabase sharedIconDatabase] iconForSiteURL:_URL withSize:WebIconSmallSize];
[self _setIcon:newIcon];
_loadedIcon = YES;
}
- return _icon ? _icon : [WebIconLoader defaultIcon];
+ return _icon;
}
diff --git a/WebKit/Misc.subproj/WebIconDatabase.h b/WebKit/Misc.subproj/WebIconDatabase.h
index 38e0d0d..c40572f 100644
--- a/WebKit/Misc.subproj/WebIconDatabase.h
+++ b/WebKit/Misc.subproj/WebIconDatabase.h
@@ -24,8 +24,8 @@
*/
// Sent whenever a site icon has changed. The object of the notification is the icon database.
-// Upon receiving this notification the receiver should call doesNotificationUserInfo: matchSiteURL:
-// to determine if the site URL in question has an updated icon.
+// The userInfo contains the site URL who's icon has changed.
+// It can be accessed with the key WebIconNotificationUserInfoSiteURLKey.
extern NSString *WebIconDidChangeNotification;
extern NSString *WebIconNotificationUserInfoSiteURLKey;
@@ -50,6 +50,8 @@ extern NSSize WebIconMediumSize; // 32 x 32
// Also usually called by the observer of WebIconChangedNotification after the notification is sent.
- (NSImage *)iconForSiteURL:(NSURL *)siteURL withSize:(NSSize)size;
+- (NSImage *)defaultIconWithSize:(NSSize)size;
+
// Customize the site icon for all web sites with the given host name.
- (void)setIcon:(NSImage *)icon forHost:(NSString *)host;
diff --git a/WebKit/Misc.subproj/WebIconDatabase.m b/WebKit/Misc.subproj/WebIconDatabase.m
index abc652a..231ab84 100644
--- a/WebKit/Misc.subproj/WebIconDatabase.m
+++ b/WebKit/Misc.subproj/WebIconDatabase.m
@@ -93,6 +93,11 @@ NSSize WebIconMediumSize = {32, 32};
- (NSImage *)iconForSiteURL:(NSURL *)siteURL withSize:(NSSize)size
{
+
+ if(!siteURL){
+ return [self defaultIconWithSize:size];
+ }
+
if([siteURL isFileURL]){
return [self _iconForFileURL:siteURL withSize:size];
}
@@ -105,14 +110,14 @@ NSSize WebIconMediumSize = {32, 32};
if(!iconURL){
// Don't have it
//NSLog(@"iconForSiteURL no iconURL for siteURL: %@", siteURL);
- return nil;
+ return [self defaultIconWithSize:size];
}
icons = [self _iconsForIconURL:iconURL];
if(!icons){
// This should not happen
//NSLog(@"iconForSiteURL no icon for iconURL: %@", iconURL);
- return nil;
+ return [self defaultIconWithSize:size];
}
}
@@ -124,6 +129,19 @@ NSSize WebIconMediumSize = {32, 32};
}
}
+- (NSImage *)defaultIconWithSize:(NSSize)size
+{
+ if (!_private->defaultIcons) {
+ NSString *pathForDefaultImage = [[NSBundle bundleForClass:[self class]] pathForResource:@"url_icon" ofType:@"tiff"];
+ if (pathForDefaultImage != nil) {
+ NSImage *icon = [[NSImage alloc] initByReferencingFile: pathForDefaultImage];
+ _private->defaultIcons = [[NSMutableArray arrayWithObject:icon] retain];
+ }
+ }
+
+ return [self _cachedIconFromArray:_private->defaultIcons withSize:size];
+}
+
- (void)setIcon:(NSImage *)icon forSiteURL:(NSURL *)siteURL
{
if(!icon || !siteURL){
@@ -303,6 +321,19 @@ NSSize WebIconMediumSize = {32, 32};
[fileDB setObject:_private->hostToSiteURLs forKey:WebHostToSiteURLsKey];
}
+- (BOOL)_hasIconForSiteURL:(NSURL *)siteURL
+{
+ if([siteURL isFileURL]){
+ return YES;
+ }else if([_private->hostToBuiltItIcons objectForKey:[siteURL host]]){
+ return YES;
+ }else if([_private->siteURLToIconURL objectForKey:siteURL]){
+ return YES;
+ }else{
+ return NO;
+ }
+}
+
- (NSImage *)_iconForIconURL:(NSURL *)iconURL
{
// The first item in the icon array is the original non-resized icon
diff --git a/WebKit/Misc.subproj/WebIconDatabasePrivate.h b/WebKit/Misc.subproj/WebIconDatabasePrivate.h
index f10cd21..528afba 100644
--- a/WebKit/Misc.subproj/WebIconDatabasePrivate.h
+++ b/WebKit/Misc.subproj/WebIconDatabasePrivate.h
@@ -34,6 +34,7 @@
BOOL waitingToCleanup;
NSMutableArray *htmlIcons;
+ NSMutableArray *defaultIcons;
}
@end
@@ -51,4 +52,6 @@
- (void)_setBuiltInIcon:(NSImage *)icon forHost:(NSString *)host;
+- (BOOL)_hasIconForSiteURL:(NSURL *)siteURL;
+
@end
\ No newline at end of file
diff --git a/WebKit/Misc.subproj/WebIconLoader.h b/WebKit/Misc.subproj/WebIconLoader.h
index 495d932..9ca18bd 100644
--- a/WebKit/Misc.subproj/WebIconLoader.h
+++ b/WebKit/Misc.subproj/WebIconLoader.h
@@ -8,22 +8,14 @@
#import <Cocoa/Cocoa.h>
- at class WebDataSource;
- at class WebResourceHandle;
@class WebIconLoaderPrivate;
@protocol WebResourceClient;
-#define IconWidth 16
-#define IconHeight 16
-
@interface WebIconLoader : NSObject <WebResourceClient>
{
WebIconLoaderPrivate *_private;
}
-+ (NSImage *)defaultIcon;
-+ (NSImage *)iconForFileAtPath:(NSString *)path;
-
+ iconLoaderWithURL:(NSURL *)URL;
- initWithURL:(NSURL *)URL;
- (NSURL *)URL;
diff --git a/WebKit/Misc.subproj/WebIconLoader.m b/WebKit/Misc.subproj/WebIconLoader.m
index e4f1761..eda407b 100644
--- a/WebKit/Misc.subproj/WebIconLoader.m
+++ b/WebKit/Misc.subproj/WebIconLoader.m
@@ -40,51 +40,6 @@
@implementation WebIconLoader
-+ (void)_resizeImage:(NSImage *)image
-{
- [image setScalesWhenResized:YES];
- [image setSize:NSMakeSize(IconWidth,IconHeight)];
-}
-
-+ (NSImage *)defaultIcon
-{
- static NSImage *defaultIcon = nil;
- static BOOL loadedDefaultImage = NO;
-
- // Attempt to load default image only once, to avoid performance penalty of repeatedly
- // trying and failing to find it.
- if (!loadedDefaultImage) {
- NSString *pathForDefaultImage =
- [[NSBundle bundleForClass:[self class]] pathForResource:@"url_icon" ofType:@"tiff"];
- if (pathForDefaultImage != nil) {
- defaultIcon = [[NSImage alloc] initByReferencingFile: pathForDefaultImage];
- [[self class] _resizeImage:defaultIcon];
- }
- loadedDefaultImage = YES;
- }
-
- return defaultIcon;
-}
-
-+ (NSImage *)iconForFileAtPath:(NSString *)path
-{
- static NSImage *htmlIcon = nil;
- NSImage *icon;
-
- if([[path pathExtension] rangeOfString:@"htm"].length != 0){
- if(!htmlIcon){
- htmlIcon = [[[NSWorkspace sharedWorkspace] iconForFileType:@"html"] retain];
- [[self class] _resizeImage:htmlIcon];
- }
- icon = htmlIcon;
- }else{
- icon = [[NSWorkspace sharedWorkspace] iconForFile:path];
- [[self class] _resizeImage:icon];
- }
-
- return icon;
-}
-
+ iconLoaderWithURL:(NSURL *)URL
{
return [[[self alloc] initWithURL:URL] autorelease];
diff --git a/WebKit/Resources/url_icon.tiff b/WebKit/Resources/url_icon.tiff
index c5e9a9d..c850c82 100644
Binary files a/WebKit/Resources/url_icon.tiff and b/WebKit/Resources/url_icon.tiff differ
diff --git a/WebKit/WebKit.exp b/WebKit/WebKit.exp
index 097e7c2..800e52e 100644
--- a/WebKit/WebKit.exp
+++ b/WebKit/WebKit.exp
@@ -33,4 +33,6 @@ _WebHistoryEntriesChangedNotification
_WebIconDidChangeNotification
_WebIconSmallSize
_WebIconMediumSize
+_WebIconNotificationUserInfoSiteURLKey
+
diff --git a/WebKit/WebKit.pbproj/project.pbxproj b/WebKit/WebKit.pbproj/project.pbxproj
index d3427eb..9a42a58 100644
--- a/WebKit/WebKit.pbproj/project.pbxproj
+++ b/WebKit/WebKit.pbproj/project.pbxproj
@@ -72,7 +72,6 @@
F58C8A07025BD3BC018635CA,
F531DDFF02F0C36F018635CA,
);
- hasScannedForEncodings = 1;
isa = PBXProject;
knownRegions = (
English,
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
index dd36faa..fc60231 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.m
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -452,7 +452,7 @@
- (void)iconLoader:(WebIconLoader *)iconLoader receivedPageIcon:(NSImage *)icon;
{
[[WebIconDatabase sharedIconDatabase] _setIconURL:[iconLoader URL] forSiteURL:[self URL]];
- [[_private->controller locationChangeHandler] receivedPageIcon:icon fromURL:[iconLoader URL] forDataSource:self];
+ [[_private->controller locationChangeHandler] receivedPageIcon:icon forDataSource:self];
}
- (void)_loadIcon
@@ -462,12 +462,12 @@
if([self isMainDocument] && !_private->mainDocumentError){
NSURL *dataSourceURL = [self URL];
-
- NSImage *icon = [[WebIconDatabase sharedIconDatabase] iconForSiteURL:dataSourceURL withSize:NSMakeSize(0,0)];
-
- if(icon){
+ WebIconDatabase *iconDB = [WebIconDatabase sharedIconDatabase];
+
+ if([iconDB _hasIconForSiteURL:dataSourceURL]){
// Return the icon immediately if the db already has it
- [[_private->controller locationChangeHandler] receivedPageIcon:icon fromURL:nil forDataSource:self];
+ NSImage *icon = [iconDB iconForSiteURL:dataSourceURL withSize:NSMakeSize(0,0)];
+ [[_private->controller locationChangeHandler] receivedPageIcon:icon forDataSource:self];
}else{
if(!_private->iconURL){
diff --git a/WebKit/WebView.subproj/WebFrameLoadDelegate.h b/WebKit/WebView.subproj/WebFrameLoadDelegate.h
index d6e5880..8589124 100644
--- a/WebKit/WebView.subproj/WebFrameLoadDelegate.h
+++ b/WebKit/WebView.subproj/WebFrameLoadDelegate.h
@@ -42,7 +42,7 @@
- (void)locationChangeDone:(WebError *)error forDataSource:(WebDataSource *)dataSource;
- (void)receivedPageTitle:(NSString *)title forDataSource:(WebDataSource *)dataSource;
-- (void)receivedPageIcon:(NSImage *)image fromURL:(NSURL *)iconURL forDataSource:(WebDataSource *)dataSource;
+- (void)receivedPageIcon:(NSImage *)image forDataSource:(WebDataSource *)dataSource;
- (void)serverRedirectTo:(NSURL *)URL forDataSource:(WebDataSource *)dataSource;
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index 9414e8b..6176bc4 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -13,6 +13,7 @@
#import <WebKit/WebException.h>
#import <WebKit/WebFrame.h>
#import <WebKit/WebHTMLViewPrivate.h>
+#import <WebKit/WebIconDatabase.h>
#import <WebKit/WebIconLoader.h>
#import <WebKit/WebKitDebug.h>
#import <WebKit/WebNSViewExtras.h>
@@ -446,7 +447,7 @@
[pasteboard declareTypes:[NSArray arrayWithObject:NSURLPboardType] owner:nil];
[_private->draggedURL writeToPasteboard: pasteboard];
- [self dragImage:[WebIconLoader defaultIcon]
+ [self dragImage:[[WebIconDatabase sharedIconDatabase] defaultIconWithSize:WebIconSmallSize]
at:[self convertPoint:[event locationInWindow] fromView:nil]
offset:NSMakeSize(0.0,0.0)
event:event
diff --git a/WebKit/WebView.subproj/WebLocationChangeDelegate.h b/WebKit/WebView.subproj/WebLocationChangeDelegate.h
index d6e5880..8589124 100644
--- a/WebKit/WebView.subproj/WebLocationChangeDelegate.h
+++ b/WebKit/WebView.subproj/WebLocationChangeDelegate.h
@@ -42,7 +42,7 @@
- (void)locationChangeDone:(WebError *)error forDataSource:(WebDataSource *)dataSource;
- (void)receivedPageTitle:(NSString *)title forDataSource:(WebDataSource *)dataSource;
-- (void)receivedPageIcon:(NSImage *)image fromURL:(NSURL *)iconURL forDataSource:(WebDataSource *)dataSource;
+- (void)receivedPageIcon:(NSImage *)image forDataSource:(WebDataSource *)dataSource;
- (void)serverRedirectTo:(NSURL *)URL forDataSource:(WebDataSource *)dataSource;
diff --git a/WebKit/WebView.subproj/WebLocationChangeDelegate.m b/WebKit/WebView.subproj/WebLocationChangeDelegate.m
index e7a0b54..763a911 100644
--- a/WebKit/WebView.subproj/WebLocationChangeDelegate.m
+++ b/WebKit/WebView.subproj/WebLocationChangeDelegate.m
@@ -12,7 +12,7 @@
- (void)locationChangeDone:(WebError *)error forDataSource:(WebDataSource *)dataSource { }
- (void)receivedPageTitle:(NSString *)title forDataSource:(WebDataSource *)dataSource { }
-- (void)receivedPageIcon:(NSImage *)image fromURL:(NSURL *)iconURL forDataSource:(WebDataSource *)dataSource { }
+- (void)receivedPageIcon:(NSImage *)image forDataSource:(WebDataSource *)dataSource { }
- (void)serverRedirectTo:(NSURL *)URL forDataSource:(WebDataSource *)dataSource { }
diff --git a/WebKit/WebView.subproj/WebLocationChangeHandler.h b/WebKit/WebView.subproj/WebLocationChangeHandler.h
index d6e5880..8589124 100644
--- a/WebKit/WebView.subproj/WebLocationChangeHandler.h
+++ b/WebKit/WebView.subproj/WebLocationChangeHandler.h
@@ -42,7 +42,7 @@
- (void)locationChangeDone:(WebError *)error forDataSource:(WebDataSource *)dataSource;
- (void)receivedPageTitle:(NSString *)title forDataSource:(WebDataSource *)dataSource;
-- (void)receivedPageIcon:(NSImage *)image fromURL:(NSURL *)iconURL forDataSource:(WebDataSource *)dataSource;
+- (void)receivedPageIcon:(NSImage *)image forDataSource:(WebDataSource *)dataSource;
- (void)serverRedirectTo:(NSURL *)URL forDataSource:(WebDataSource *)dataSource;
diff --git a/WebKit/WebView.subproj/WebLocationChangeHandler.m b/WebKit/WebView.subproj/WebLocationChangeHandler.m
index e7a0b54..763a911 100644
--- a/WebKit/WebView.subproj/WebLocationChangeHandler.m
+++ b/WebKit/WebView.subproj/WebLocationChangeHandler.m
@@ -12,7 +12,7 @@
- (void)locationChangeDone:(WebError *)error forDataSource:(WebDataSource *)dataSource { }
- (void)receivedPageTitle:(NSString *)title forDataSource:(WebDataSource *)dataSource { }
-- (void)receivedPageIcon:(NSImage *)image fromURL:(NSURL *)iconURL forDataSource:(WebDataSource *)dataSource { }
+- (void)receivedPageIcon:(NSImage *)image forDataSource:(WebDataSource *)dataSource { }
- (void)serverRedirectTo:(NSURL *)URL forDataSource:(WebDataSource *)dataSource { }
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list