Home | History | Annotate | Download | only in WebView
      1 /*
      2  * Copyright (C) 2009 Apple Inc. All rights reserved.
      3  *
      4  * Redistribution and use in source and binary forms, with or without
      5  * modification, are permitted provided that the following conditions
      6  * are met:
      7  * 1. Redistributions of source code must retain the above copyright
      8  *    notice, this list of conditions and the following disclaimer.
      9  * 2. Redistributions in binary form must reproduce the above copyright
     10  *    notice, this list of conditions and the following disclaimer in the
     11  *    documentation and/or other materials provided with the distribution.
     12  *
     13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
     14  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     15  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     16  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
     17  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     18  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     19  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
     20  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
     21  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     22  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     23  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     24  */
     25 
     26 #import "WebNavigationData.h"
     27 
     28 @interface WebNavigationDataPrivate : NSObject
     29 {
     30 @public
     31     NSString *url;
     32     NSString *title;
     33     NSURLRequest *originalRequest;
     34     NSURLResponse *response;
     35     BOOL hasSubstituteData;
     36     NSString *clientRedirectSource;
     37 }
     38 
     39 @end
     40 
     41 @implementation WebNavigationDataPrivate
     42 
     43 - (void)dealloc
     44 {
     45     [url release];
     46     [title release];
     47     [originalRequest release];
     48     [response release];
     49     [clientRedirectSource release];
     50 
     51     [super dealloc];
     52 }
     53 
     54 @end
     55 
     56 @implementation WebNavigationData
     57 
     58 - (id)initWithURLString:(NSString *)url title:(NSString *)title originalRequest:(NSURLRequest *)request response:(NSURLResponse *)response hasSubstituteData:(BOOL)hasSubstituteData clientRedirectSource:(NSString *)redirectSource
     59 {
     60     _private = [[WebNavigationDataPrivate alloc] init];
     61 
     62     _private->url = [url retain];
     63     _private->title = [title retain];
     64     _private->originalRequest = [request retain];
     65     _private->response = [response retain];
     66     _private->hasSubstituteData = hasSubstituteData;
     67     _private->clientRedirectSource = [redirectSource retain];
     68 
     69     return self;
     70 }
     71 
     72 - (NSString *)url
     73 {
     74     return _private->url;
     75 }
     76 
     77 - (NSString *)title
     78 {
     79     return _private->title;
     80 }
     81 
     82 - (NSURLRequest *)originalRequest
     83 {
     84     return _private->originalRequest;
     85 }
     86 
     87 - (NSURLResponse *)response
     88 {
     89     return _private->response;
     90 }
     91 
     92 - (BOOL)hasSubstituteData
     93 {
     94     return _private->hasSubstituteData;
     95 }
     96 
     97 - (NSString *)clientRedirectSource
     98 {
     99     return _private->clientRedirectSource;
    100 }
    101 
    102 - (void)dealloc
    103 {
    104     [_private release];
    105     [super dealloc];
    106 }
    107 
    108 @end
    109