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

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

Issue 336553003: Change Page::m_mainFrame to be a Frame. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/web/WebPagePopupImpl.cpp ('k') | Source/web/WebViewImpl.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 } 169 }
170 170
171 *resourcesParam = result; 171 *resourcesParam = result;
172 } 172 }
173 173
174 static PassRefPtr<SharedBuffer> serializePageToMHTML(Page* page, MHTMLArchive::E ncodingPolicy encodingPolicy) 174 static PassRefPtr<SharedBuffer> serializePageToMHTML(Page* page, MHTMLArchive::E ncodingPolicy encodingPolicy)
175 { 175 {
176 Vector<SerializedResource> resources; 176 Vector<SerializedResource> resources;
177 PageSerializer serializer(&resources); 177 PageSerializer serializer(&resources);
178 serializer.serialize(page); 178 serializer.serialize(page);
179 Document* document = page->mainFrame()->document(); 179 Document* document = page->deprecatedLocalMainFrame()->document();
180 return MHTMLArchive::generateMHTMLData(resources, encodingPolicy, document-> title(), document->suggestedMIMEType()); 180 return MHTMLArchive::generateMHTMLData(resources, encodingPolicy, document-> title(), document->suggestedMIMEType());
181 } 181 }
182 182
183 WebCString WebPageSerializer::serializeToMHTML(WebView* view) 183 WebCString WebPageSerializer::serializeToMHTML(WebView* view)
184 { 184 {
185 RefPtr<SharedBuffer> mhtml = serializePageToMHTML(toWebViewImpl(view)->page( ), MHTMLArchive::UseDefaultEncoding); 185 RefPtr<SharedBuffer> mhtml = serializePageToMHTML(toWebViewImpl(view)->page( ), MHTMLArchive::UseDefaultEncoding);
186 // FIXME: we are copying all the data here. Idealy we would have a WebShared Data(). 186 // FIXME: we are copying all the data here. Idealy we would have a WebShared Data().
187 return WebCString(mhtml->data(), mhtml->size()); 187 return WebCString(mhtml->data(), mhtml->size());
188 } 188 }
189 189
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 263
264 WebString WebPageSerializer::generateBaseTagDeclaration(const WebString& baseTar get) 264 WebString WebPageSerializer::generateBaseTagDeclaration(const WebString& baseTar get)
265 { 265 {
266 if (baseTarget.isEmpty()) 266 if (baseTarget.isEmpty())
267 return String("<base href=\".\">"); 267 return String("<base href=\".\">");
268 String baseString = "<base href=\".\" target=\"" + static_cast<const String& >(baseTarget) + "\">"; 268 String baseString = "<base href=\".\" target=\"" + static_cast<const String& >(baseTarget) + "\">";
269 return baseString; 269 return baseString;
270 } 270 }
271 271
272 } // namespace blink 272 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/WebPagePopupImpl.cpp ('k') | Source/web/WebViewImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698