| 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" |
| 9 #include "FrameLoadRequest.h" |
| 8 #include "KURL.h" | 10 #include "KURL.h" |
| 9 #include "FrameLoadRequest.h" | |
| 10 #include "ResourceRequest.h" | 11 #include "ResourceRequest.h" |
| 11 | 12 |
| 12 #undef LOG | 13 #undef LOG |
| 14 #include "base/histogram.h" |
| 13 #include "base/string_util.h" | 15 #include "base/string_util.h" |
| 14 #include "webkit/glue/glue_util.h" | 16 #include "webkit/glue/glue_util.h" |
| 15 #include "webkit/glue/password_form.h" | 17 #include "webkit/glue/password_form.h" |
| 16 #include "webkit/glue/webdatasource_impl.h" | 18 #include "webkit/glue/webdatasource_impl.h" |
| 17 #include "webkit/glue/webframe_impl.h" | 19 #include "webkit/glue/webframe_impl.h" |
| 18 #include "webkit/glue/weburlrequest_impl.h" | 20 #include "webkit/glue/weburlrequest_impl.h" |
| 21 #include "webkit/glue/webview_delegate.h" |
| 22 |
| 23 using base::TimeDelta; |
| 24 using base::Time; |
| 19 | 25 |
| 20 // static | 26 // static |
| 21 PassRefPtr<WebDataSourceImpl> WebDataSourceImpl::Create( | 27 PassRefPtr<WebDataSourceImpl> WebDataSourceImpl::Create( |
| 22 const WebCore::ResourceRequest& request, | 28 const WebCore::ResourceRequest& request, |
| 23 const WebCore::SubstituteData& data) { | 29 const WebCore::SubstituteData& data) { |
| 24 return adoptRef(new WebDataSourceImpl(request, data)); | 30 return adoptRef(new WebDataSourceImpl(request, data)); |
| 25 } | 31 } |
| 26 | 32 |
| 27 WebDataSourceImpl::WebDataSourceImpl(const WebCore::ResourceRequest& request, | 33 WebDataSourceImpl::WebDataSourceImpl(const WebCore::ResourceRequest& request, |
| 28 const WebCore::SubstituteData& data) | 34 const WebCore::SubstituteData& data) |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 return password_form_data(); | 98 return password_form_data(); |
| 93 } | 99 } |
| 94 | 100 |
| 95 bool WebDataSourceImpl::IsFormSubmit() const { | 101 bool WebDataSourceImpl::IsFormSubmit() const { |
| 96 return is_form_submit(); | 102 return is_form_submit(); |
| 97 } | 103 } |
| 98 | 104 |
| 99 string16 WebDataSourceImpl::GetPageTitle() const { | 105 string16 WebDataSourceImpl::GetPageTitle() const { |
| 100 return webkit_glue::StringToString16(title()); | 106 return webkit_glue::StringToString16(title()); |
| 101 } | 107 } |
| 108 |
| 109 base::Time WebDataSourceImpl::GetRequestTime() const { |
| 110 return request_time_; |
| 111 } |
| 112 |
| 113 void WebDataSourceImpl::SetRequestTime(base::Time time) { |
| 114 request_time_ = time; |
| 115 } |
| 116 |
| 117 base::Time WebDataSourceImpl::GetStartLoadTime() const { |
| 118 return start_load_time_; |
| 119 } |
| 120 |
| 121 base::Time WebDataSourceImpl::GetFinishDocumentLoadTime() const { |
| 122 return finish_document_load_time_; |
| 123 } |
| 124 |
| 125 base::Time WebDataSourceImpl::GetFinishLoadTime() const { |
| 126 return finish_load_time_; |
| 127 } |
| 128 |
| 129 WebNavigationType WebDataSourceImpl::GetNavigationType() const { |
| 130 return NavigationTypeToWebNavigationType(triggeringAction().type()); |
| 131 } |
| 132 |
| 133 WebNavigationType WebDataSourceImpl::NavigationTypeToWebNavigationType( |
| 134 WebCore::NavigationType type) { |
| 135 switch (type) { |
| 136 case WebCore::NavigationTypeLinkClicked: |
| 137 return WebNavigationTypeLinkClicked; |
| 138 case WebCore::NavigationTypeFormSubmitted: |
| 139 return WebNavigationTypeFormSubmitted; |
| 140 case WebCore::NavigationTypeBackForward: |
| 141 return WebNavigationTypeBackForward; |
| 142 case WebCore::NavigationTypeReload: |
| 143 return WebNavigationTypeReload; |
| 144 case WebCore::NavigationTypeFormResubmitted: |
| 145 return WebNavigationTypeFormResubmitted; |
| 146 case WebCore::NavigationTypeOther: |
| 147 default: |
| 148 return WebNavigationTypeOther; |
| 149 } |
| 150 } |
| OLD | NEW |