diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2009-01-23 12:15:00 +0000 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2010-09-30 07:09:39 +0000 |
commit | bf26e5f3b9ed53ac0b29bca2302ca586b6154c15 (patch) | |
tree | 3d18613d116d246cd5e2d69409537ae54042bbf7 /UICaboodle/BrowserView.m | |
parent | 1b1b3f4af0bd30c5c6c7378187766155b1963b9d (diff) |
Fixing more bugs in window opening.
Diffstat (limited to 'UICaboodle/BrowserView.m')
-rw-r--r-- | UICaboodle/BrowserView.m | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/UICaboodle/BrowserView.m b/UICaboodle/BrowserView.m index 0816523..8c48425 100644 --- a/UICaboodle/BrowserView.m +++ b/UICaboodle/BrowserView.m @@ -303,7 +303,19 @@ [book_ pushPage:page]; } +- (void) _pushPage { + if (pushed_) + return; + [self autorelease]; + pushed_ = true; + [book_ pushPage:self]; +} + - (BOOL) getSpecial:(NSURL *)url { +#if ForSaurik + NSLog(@"getSpecial:%@", url); +#endif + NSString *href([url absoluteString]); NSString *scheme([[url scheme] lowercaseString]); @@ -471,6 +483,8 @@ } [listener use]; + /* XXX: maybe only the main frame? */ + [self _pushPage]; return; } #if ForSaurik @@ -526,13 +540,6 @@ //lprintf("Status:%s\n", [text UTF8String]); } -- (void) _pushPage { - if (pushed_) - return; - pushed_ = true; - [book_ pushPage:self]; -} - - (void) alertSheet:(UIActionSheet *)sheet buttonClicked:(int)button { NSString *context([sheet context]); @@ -636,10 +643,6 @@ } - (NSURLRequest *) webView:(WebView *)sender resource:(id)identifier willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)redirectResponse fromDataSource:(WebDataSource *)source { - NSURL *url = [request URL]; - if ([self getSpecial:url]) - return nil; - [self _pushPage]; return [self _addHeadersToRequest:request]; } @@ -649,8 +652,16 @@ #endif BrowserView *browser = [[[BrowserView alloc] initWithBook:book_] autorelease]; - [self pushPage:browser]; - [browser loadRequest:request]; + + if (request == nil) { + [self setBackButtonTitle:title_]; + [browser setDelegate:delegate_]; + [browser retain]; + } else { + [self pushPage:browser]; + [browser loadRequest:request]; + } + return [browser webView]; } |