| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 return WebCString(mhtml->data(), mhtml->size()); | 205 return WebCString(mhtml->data(), mhtml->size()); |
| 206 } | 206 } |
| 207 | 207 |
| 208 WebCString WebPageSerializer::serializeToMHTMLUsingBinaryEncoding(WebView* view) | 208 WebCString WebPageSerializer::serializeToMHTMLUsingBinaryEncoding(WebView* view) |
| 209 { | 209 { |
| 210 RefPtr<SharedBuffer> mhtml = serializePageToMHTML(toWebViewImpl(view)->page(
), MHTMLArchive::UseBinaryEncoding); | 210 RefPtr<SharedBuffer> mhtml = serializePageToMHTML(toWebViewImpl(view)->page(
), MHTMLArchive::UseBinaryEncoding); |
| 211 // FIXME: we are copying all the data here. Idealy we would have a WebShared
Data(). | 211 // FIXME: we are copying all the data here. Idealy we would have a WebShared
Data(). |
| 212 return WebCString(mhtml->data(), mhtml->size()); | 212 return WebCString(mhtml->data(), mhtml->size()); |
| 213 } | 213 } |
| 214 | 214 |
| 215 bool WebPageSerializer::serialize(WebLocalFrame* frame, | 215 bool WebPageSerializer::serialize( |
| 216 WebPageSerializerClient* client, | 216 WebLocalFrame* frame, |
| 217 const WebVector<WebURL>& links, | 217 WebPageSerializerClient* client) |
| 218 const WebVector<WebString>& localPaths, | |
| 219 const WebString& localDirectoryName) | |
| 220 { | 218 { |
| 221 WebPageSerializerImpl serializerImpl( | 219 WebPageSerializerImpl serializerImpl(frame, client); |
| 222 frame, client, links, localPaths, localDirectoryName); | |
| 223 return serializerImpl.serialize(); | 220 return serializerImpl.serialize(); |
| 224 } | 221 } |
| 225 | 222 |
| 226 bool WebPageSerializer::retrieveAllResources(WebView* view, | 223 bool WebPageSerializer::retrieveAllResources(WebView* view, |
| 227 const WebVector<WebCString>& suppor
tedSchemes, | 224 const WebVector<WebCString>& suppor
tedSchemes, |
| 228 WebVector<WebURL>* resourceURLs, | 225 WebVector<WebURL>* resourceURLs, |
| 229 WebVector<WebURL>* frameURLs) { | 226 WebVector<WebURL>* frameURLs) { |
| 230 WebLocalFrameImpl* mainFrame = toWebLocalFrameImpl(view->mainFrame()); | 227 WebLocalFrameImpl* mainFrame = toWebLocalFrameImpl(view->mainFrame()); |
| 231 if (!mainFrame) | 228 if (!mainFrame) |
| 232 return false; | 229 return false; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 WebString WebPageSerializer::generateBaseTagDeclaration(const WebString& baseTar
get) | 281 WebString WebPageSerializer::generateBaseTagDeclaration(const WebString& baseTar
get) |
| 285 { | 282 { |
| 286 // TODO(yosin) We should call |PageSerializer::baseTagDeclarationOf()|. | 283 // TODO(yosin) We should call |PageSerializer::baseTagDeclarationOf()|. |
| 287 if (baseTarget.isEmpty()) | 284 if (baseTarget.isEmpty()) |
| 288 return String("<base href=\".\">"); | 285 return String("<base href=\".\">"); |
| 289 String baseString = "<base href=\".\" target=\"" + static_cast<const String&
>(baseTarget) + "\">"; | 286 String baseString = "<base href=\".\" target=\"" + static_cast<const String&
>(baseTarget) + "\">"; |
| 290 return baseString; | 287 return baseString; |
| 291 } | 288 } |
| 292 | 289 |
| 293 } // namespace blink | 290 } // namespace blink |
| OLD | NEW |