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

Side by Side Diff: third_party/WebKit/Source/web/WebFrameSerializer.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: Fixing building of dom_serializer_browsertest.cc :-/ Created 4 years, 11 months 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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 WebData WebFrameSerializer::generateMHTMLFooter(const WebString& boundary) 190 WebData WebFrameSerializer::generateMHTMLFooter(const WebString& boundary)
191 { 191 {
192 RefPtr<SharedBuffer> buffer = SharedBuffer::create(); 192 RefPtr<SharedBuffer> buffer = SharedBuffer::create();
193 MHTMLArchive::generateMHTMLFooter(boundary, *buffer); 193 MHTMLArchive::generateMHTMLFooter(boundary, *buffer);
194 return buffer.release(); 194 return buffer.release();
195 } 195 }
196 196
197 bool WebFrameSerializer::serialize( 197 bool WebFrameSerializer::serialize(
198 WebLocalFrame* frame, 198 WebLocalFrame* frame,
199 WebFrameSerializerClient* client, 199 WebFrameSerializerClient* client,
200 const WebVector<std::pair<WebURL, WebString>>& urlsToLocalPaths) 200 WebFrameSerializer::LinkRewritingDelegate* delegate)
201 { 201 {
202 WebFrameSerializerImpl serializerImpl(frame, client, urlsToLocalPaths); 202 WebFrameSerializerImpl serializerImpl(frame, client, delegate);
203 return serializerImpl.serialize(); 203 return serializerImpl.serialize();
204 } 204 }
205 205
206 WebString WebFrameSerializer::generateMetaCharsetDeclaration(const WebString& ch arset) 206 WebString WebFrameSerializer::generateMetaCharsetDeclaration(const WebString& ch arset)
207 { 207 {
208 // TODO(yosin) We should call |FrameSerializer::metaCharsetDeclarationOf()|. 208 // TODO(yosin) We should call |FrameSerializer::metaCharsetDeclarationOf()|.
209 String charsetString = "<meta http-equiv=\"Content-Type\" content=\"text/htm l; charset=" + static_cast<const String&>(charset) + "\">"; 209 String charsetString = "<meta http-equiv=\"Content-Type\" content=\"text/htm l; charset=" + static_cast<const String&>(charset) + "\">";
210 return charsetString; 210 return charsetString;
211 } 211 }
212 212
213 WebString WebFrameSerializer::generateMarkOfTheWebDeclaration(const WebURL& url) 213 WebString WebFrameSerializer::generateMarkOfTheWebDeclaration(const WebURL& url)
214 { 214 {
215 StringBuilder builder; 215 StringBuilder builder;
216 builder.append("\n<!-- "); 216 builder.append("\n<!-- ");
217 builder.append(FrameSerializer::markOfTheWebDeclaration(url)); 217 builder.append(FrameSerializer::markOfTheWebDeclaration(url));
218 builder.append(" -->\n"); 218 builder.append(" -->\n");
219 return builder.toString(); 219 return builder.toString();
220 } 220 }
221 221
222 WebString WebFrameSerializer::generateBaseTagDeclaration(const WebString& baseTa rget) 222 WebString WebFrameSerializer::generateBaseTagDeclaration(const WebString& baseTa rget)
223 { 223 {
224 // TODO(yosin) We should call |FrameSerializer::baseTagDeclarationOf()|. 224 // TODO(yosin) We should call |FrameSerializer::baseTagDeclarationOf()|.
225 if (baseTarget.isEmpty()) 225 if (baseTarget.isEmpty())
226 return String("<base href=\".\">"); 226 return String("<base href=\".\">");
227 String baseString = "<base href=\".\" target=\"" + static_cast<const String& >(baseTarget) + "\">"; 227 String baseString = "<base href=\".\" target=\"" + static_cast<const String& >(baseTarget) + "\">";
228 return baseString; 228 return baseString;
229 } 229 }
230 230
231 } // namespace blink 231 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698