Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Side by Side Diff: third_party/WebKit/Source/web/WebPageSerializer.cpp

Issue 1502563004: Save-Page-As-Complete-Html: Each frame links to a distinct local file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@no-url-deduping-for-frame-and-adding-save-item-id
Patch Set: Rebasing... Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 WebData WebPageSerializer::generateMHTMLFooter(const WebString& boundary) 202 WebData WebPageSerializer::generateMHTMLFooter(const WebString& boundary)
203 { 203 {
204 RefPtr<SharedBuffer> buffer = SharedBuffer::create(); 204 RefPtr<SharedBuffer> buffer = SharedBuffer::create();
205 MHTMLArchive::generateMHTMLFooter(boundary, *buffer); 205 MHTMLArchive::generateMHTMLFooter(boundary, *buffer);
206 return buffer.release(); 206 return buffer.release();
207 } 207 }
208 208
209 bool WebPageSerializer::serialize( 209 bool WebPageSerializer::serialize(
210 WebLocalFrame* frame, 210 WebLocalFrame* frame,
211 WebPageSerializerClient* client, 211 WebPageSerializerClient* client,
212 const WebVector<std::pair<WebURL, WebString>>& urlsToLocalPaths) 212 const WebVector<std::pair<WebURL, WebString>>& urlsToLocalPaths,
213 const WebVector<std::pair<WebFrame*, WebString>>& framesToLocalPaths)
213 { 214 {
214 WebPageSerializerImpl serializerImpl(frame, client, urlsToLocalPaths); 215 WebPageSerializerImpl serializerImpl(frame, client, urlsToLocalPaths, frames ToLocalPaths);
215 return serializerImpl.serialize(); 216 return serializerImpl.serialize();
216 } 217 }
217 218
218 WebString WebPageSerializer::generateMetaCharsetDeclaration(const WebString& cha rset) 219 WebString WebPageSerializer::generateMetaCharsetDeclaration(const WebString& cha rset)
219 { 220 {
220 // TODO(yosin) We should call |PageSerializer::metaCharsetDeclarationOf()|. 221 // TODO(yosin) We should call |PageSerializer::metaCharsetDeclarationOf()|.
221 String charsetString = "<meta http-equiv=\"Content-Type\" content=\"text/htm l; charset=" + static_cast<const String&>(charset) + "\">"; 222 String charsetString = "<meta http-equiv=\"Content-Type\" content=\"text/htm l; charset=" + static_cast<const String&>(charset) + "\">";
222 return charsetString; 223 return charsetString;
223 } 224 }
224 225
225 WebString WebPageSerializer::generateMarkOfTheWebDeclaration(const WebURL& url) 226 WebString WebPageSerializer::generateMarkOfTheWebDeclaration(const WebURL& url)
226 { 227 {
227 StringBuilder builder; 228 StringBuilder builder;
228 builder.append("\n<!-- "); 229 builder.append("\n<!-- ");
229 builder.append(PageSerializer::markOfTheWebDeclaration(url)); 230 builder.append(PageSerializer::markOfTheWebDeclaration(url));
230 builder.append(" -->\n"); 231 builder.append(" -->\n");
231 return builder.toString(); 232 return builder.toString();
232 } 233 }
233 234
234 WebString WebPageSerializer::generateBaseTagDeclaration(const WebString& baseTar get) 235 WebString WebPageSerializer::generateBaseTagDeclaration(const WebString& baseTar get)
235 { 236 {
236 // TODO(yosin) We should call |PageSerializer::baseTagDeclarationOf()|. 237 // TODO(yosin) We should call |PageSerializer::baseTagDeclarationOf()|.
237 if (baseTarget.isEmpty()) 238 if (baseTarget.isEmpty())
238 return String("<base href=\".\">"); 239 return String("<base href=\".\">");
239 String baseString = "<base href=\".\" target=\"" + static_cast<const String& >(baseTarget) + "\">"; 240 String baseString = "<base href=\".\" target=\"" + static_cast<const String& >(baseTarget) + "\">";
240 return baseString; 241 return baseString;
241 } 242 }
242 243
243 } // namespace blink 244 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698