| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "webkit/glue/webdatasource_impl.h" | 6 #include "webkit/glue/webdatasource_impl.h" |
| 7 | 7 |
| 8 #include "FrameLoaderTypes.h" | 8 #include "FrameLoaderTypes.h" |
| 9 #include "FrameLoadRequest.h" | 9 #include "FrameLoadRequest.h" |
| 10 #include "KURL.h" | 10 #include "KURL.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 request_.set_frame_load_request( | 53 request_.set_frame_load_request( |
| 54 WebCore::FrameLoadRequest(request())); | 54 WebCore::FrameLoadRequest(request())); |
| 55 return request_; | 55 return request_; |
| 56 } | 56 } |
| 57 | 57 |
| 58 const WebResponse& WebDataSourceImpl::GetResponse() const { | 58 const WebResponse& WebDataSourceImpl::GetResponse() const { |
| 59 response_.set_resource_response(response()); | 59 response_.set_resource_response(response()); |
| 60 return response_; | 60 return response_; |
| 61 } | 61 } |
| 62 | 62 |
| 63 void WebDataSourceImpl::SetExtraData(WebRequest::ExtraData* extra) { | |
| 64 initial_request_.SetExtraData(extra); | |
| 65 request_.SetExtraData(extra); | |
| 66 } | |
| 67 | |
| 68 GURL WebDataSourceImpl::GetUnreachableURL() const { | 63 GURL WebDataSourceImpl::GetUnreachableURL() const { |
| 69 const WebCore::KURL& url = unreachableURL(); | 64 const WebCore::KURL& url = unreachableURL(); |
| 70 return url.isEmpty() ? GURL() : webkit_glue::KURLToGURL(url); | 65 return url.isEmpty() ? GURL() : webkit_glue::KURLToGURL(url); |
| 71 } | 66 } |
| 72 | 67 |
| 73 bool WebDataSourceImpl::HasUnreachableURL() const { | 68 bool WebDataSourceImpl::HasUnreachableURL() const { |
| 74 return !unreachableURL().isEmpty(); | 69 return !unreachableURL().isEmpty(); |
| 75 } | 70 } |
| 76 | 71 |
| 77 const std::vector<GURL>& WebDataSourceImpl::GetRedirectChain() const { | 72 const std::vector<GURL>& WebDataSourceImpl::GetRedirectChain() const { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 } | 118 } |
| 124 | 119 |
| 125 base::Time WebDataSourceImpl::GetFirstLayoutTime() const { | 120 base::Time WebDataSourceImpl::GetFirstLayoutTime() const { |
| 126 return first_layout_time_; | 121 return first_layout_time_; |
| 127 } | 122 } |
| 128 | 123 |
| 129 WebNavigationType WebDataSourceImpl::GetNavigationType() const { | 124 WebNavigationType WebDataSourceImpl::GetNavigationType() const { |
| 130 return NavigationTypeToWebNavigationType(triggeringAction().type()); | 125 return NavigationTypeToWebNavigationType(triggeringAction().type()); |
| 131 } | 126 } |
| 132 | 127 |
| 128 WebDataSource::ExtraData* WebDataSourceImpl::GetExtraData() const { |
| 129 return extra_data_.get(); |
| 130 } |
| 131 |
| 132 void WebDataSourceImpl::SetExtraData(ExtraData* extra_data) { |
| 133 extra_data_.set(extra_data); |
| 134 } |
| 135 |
| 133 WebNavigationType WebDataSourceImpl::NavigationTypeToWebNavigationType( | 136 WebNavigationType WebDataSourceImpl::NavigationTypeToWebNavigationType( |
| 134 WebCore::NavigationType type) { | 137 WebCore::NavigationType type) { |
| 135 switch (type) { | 138 switch (type) { |
| 136 case WebCore::NavigationTypeLinkClicked: | 139 case WebCore::NavigationTypeLinkClicked: |
| 137 return WebNavigationTypeLinkClicked; | 140 return WebNavigationTypeLinkClicked; |
| 138 case WebCore::NavigationTypeFormSubmitted: | 141 case WebCore::NavigationTypeFormSubmitted: |
| 139 return WebNavigationTypeFormSubmitted; | 142 return WebNavigationTypeFormSubmitted; |
| 140 case WebCore::NavigationTypeBackForward: | 143 case WebCore::NavigationTypeBackForward: |
| 141 return WebNavigationTypeBackForward; | 144 return WebNavigationTypeBackForward; |
| 142 case WebCore::NavigationTypeReload: | 145 case WebCore::NavigationTypeReload: |
| 143 return WebNavigationTypeReload; | 146 return WebNavigationTypeReload; |
| 144 case WebCore::NavigationTypeFormResubmitted: | 147 case WebCore::NavigationTypeFormResubmitted: |
| 145 return WebNavigationTypeFormResubmitted; | 148 return WebNavigationTypeFormResubmitted; |
| 146 case WebCore::NavigationTypeOther: | 149 case WebCore::NavigationTypeOther: |
| 147 default: | 150 default: |
| 148 return WebNavigationTypeOther; | 151 return WebNavigationTypeOther; |
| 149 } | 152 } |
| 150 } | 153 } |
| OLD | NEW |