зеркало из https://github.com/mozilla/pjs.git
Camino only - Bug 361092: Remember pages that are in the progress of being restored when quitting. r=smurph sr=pink
This commit is contained in:
Родитель
224a7e6949
Коммит
9d9152a774
|
@ -115,7 +115,14 @@ const NSTimeInterval kPersistDelay = 60.0;
|
||||||
NSEnumerator* tabEnumerator = [[tabView tabViewItems] objectEnumerator];
|
NSEnumerator* tabEnumerator = [[tabView tabViewItems] objectEnumerator];
|
||||||
BrowserTabViewItem* tab;
|
BrowserTabViewItem* tab;
|
||||||
while ((tab = [tabEnumerator nextObject])) {
|
while ((tab = [tabEnumerator nextObject])) {
|
||||||
NSString* foundWindowURL = [(BrowserWrapper*)[tab view] currentURI];
|
BrowserWrapper* browser = (BrowserWrapper*)[tab view];
|
||||||
|
NSString* foundWindowURL;
|
||||||
|
// if the user quits too quickly, the pages in the process of being restored will
|
||||||
|
// still be blank; in those cases, save the URI they are trying to load instead.
|
||||||
|
if ([browser isEmpty] && [browser pendingURI])
|
||||||
|
foundWindowURL = [browser pendingURI];
|
||||||
|
else
|
||||||
|
foundWindowURL = [browser currentURI];
|
||||||
[storedTabs addObject:foundWindowURL];
|
[storedTabs addObject:foundWindowURL];
|
||||||
}
|
}
|
||||||
int selectedTabIndex = [tabView indexOfTabViewItem:[tabView selectedTabViewItem]];
|
int selectedTabIndex = [tabView indexOfTabViewItem:[tabView selectedTabViewItem]];
|
||||||
|
|
|
@ -131,6 +131,8 @@ class nsIArray;
|
||||||
|
|
||||||
NSImage* mSiteIconImage; // current proxy icon image, which may be a site icon (favicon).
|
NSImage* mSiteIconImage; // current proxy icon image, which may be a site icon (favicon).
|
||||||
NSString* mSiteIconURI; // uri from which we loaded the site icon
|
NSString* mSiteIconURI; // uri from which we loaded the site icon
|
||||||
|
|
||||||
|
NSString* mPendingURI; // strong
|
||||||
|
|
||||||
// the secure state of this browser. We need to hold it so that we can set
|
// the secure state of this browser. We need to hold it so that we can set
|
||||||
// the global lock icon whenever we become the primary. Value is one of
|
// the global lock icon whenever we become the primary. Value is one of
|
||||||
|
@ -187,6 +189,7 @@ class nsIArray;
|
||||||
- (BOOL)isInternalURI;
|
- (BOOL)isInternalURI;
|
||||||
- (BOOL)canReload;
|
- (BOOL)canReload;
|
||||||
|
|
||||||
|
- (NSString*)pendingURI;
|
||||||
- (NSString*)currentURI;
|
- (NSString*)currentURI;
|
||||||
- (NSString*)displayTitle;
|
- (NSString*)displayTitle;
|
||||||
- (NSString*)pageTitle;
|
- (NSString*)pageTitle;
|
||||||
|
|
|
@ -109,6 +109,8 @@ enum {
|
||||||
|
|
||||||
- (void)updateSiteIconImage:(NSImage*)inSiteIcon withURI:(NSString *)inSiteIconURI loadError:(BOOL)inLoadError;
|
- (void)updateSiteIconImage:(NSImage*)inSiteIcon withURI:(NSString *)inSiteIconURI loadError:(BOOL)inLoadError;
|
||||||
|
|
||||||
|
- (void)setPendingURI:(NSString*)inURI;
|
||||||
|
|
||||||
- (NSString*)displayTitleForPageURL:(NSString*)inURL title:(NSString*)inTitle;
|
- (NSString*)displayTitleForPageURL:(NSString*)inURL title:(NSString*)inTitle;
|
||||||
|
|
||||||
- (void)updatePluginsEnabledState;
|
- (void)updatePluginsEnabledState;
|
||||||
|
@ -193,6 +195,7 @@ enum {
|
||||||
|
|
||||||
[mToolTip release];
|
[mToolTip release];
|
||||||
[mDisplayTitle release];
|
[mDisplayTitle release];
|
||||||
|
[mPendingURI release];
|
||||||
|
|
||||||
NS_IF_RELEASE(mBlockedPopups);
|
NS_IF_RELEASE(mBlockedPopups);
|
||||||
|
|
||||||
|
@ -255,6 +258,11 @@ enum {
|
||||||
return mTabItem;
|
return mTabItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-(NSString*)pendingURI
|
||||||
|
{
|
||||||
|
return mPendingURI;
|
||||||
|
}
|
||||||
|
|
||||||
-(NSString*)currentURI
|
-(NSString*)currentURI
|
||||||
{
|
{
|
||||||
return [mBrowserView getCurrentURI];
|
return [mBrowserView getCurrentURI];
|
||||||
|
@ -371,6 +379,8 @@ enum {
|
||||||
// trying to load, even if it doesn't work
|
// trying to load, even if it doesn't work
|
||||||
[mDelegate updateLocationFields:urlSpec ignoreTyping:YES];
|
[mDelegate updateLocationFields:urlSpec ignoreTyping:YES];
|
||||||
|
|
||||||
|
[self setPendingURI:urlSpec];
|
||||||
|
|
||||||
// if we're not the primary tab, make sure that the browser view is
|
// if we're not the primary tab, make sure that the browser view is
|
||||||
// the correct size when loading a url so that if the url is a relative
|
// the correct size when loading a url so that if the url is a relative
|
||||||
// anchor, which will cause a scroll to the anchor on load, the scroll
|
// anchor, which will cause a scroll to the anchor on load, the scroll
|
||||||
|
@ -491,6 +501,7 @@ enum {
|
||||||
[mDelegate loadingDone:mActivateOnLoad];
|
[mDelegate loadingDone:mActivateOnLoad];
|
||||||
mActivateOnLoad = NO;
|
mActivateOnLoad = NO;
|
||||||
mIsBusy = NO;
|
mIsBusy = NO;
|
||||||
|
[self setPendingURI:nil];
|
||||||
|
|
||||||
[mDelegate setLoadingActive:NO];
|
[mDelegate setLoadingActive:NO];
|
||||||
|
|
||||||
|
@ -964,6 +975,12 @@ enum {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)setPendingURI:(NSString*)inURI
|
||||||
|
{
|
||||||
|
[mPendingURI autorelease];
|
||||||
|
mPendingURI = [inURI retain];
|
||||||
|
}
|
||||||
|
|
||||||
- (void)registerNotificationListener
|
- (void)registerNotificationListener
|
||||||
{
|
{
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||||
|
|
Загрузка…
Ссылка в новой задаче