| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 auto* frameOwnerElement = toHTMLFrameOwnerElement(&element); | 104 auto* frameOwnerElement = toHTMLFrameOwnerElement(&element); |
| 105 Frame* frame = frameOwnerElement->contentFrame(); | 105 Frame* frame = frameOwnerElement->contentFrame(); |
| 106 if (!frame) | 106 if (!frame) |
| 107 return false; | 107 return false; |
| 108 | 108 |
| 109 WebString contentID = m_webDelegate.getContentID(WebFrame::fromFrame(frame))
; | 109 WebString contentID = m_webDelegate.getContentID(WebFrame::fromFrame(frame))
; |
| 110 if (contentID.isNull()) | 110 if (contentID.isNull()) |
| 111 return false; | 111 return false; |
| 112 | 112 |
| 113 KURL cidURI = MHTMLParser::convertContentIDToURI(contentID); | 113 KURL cidURI = MHTMLParser::convertContentIDToURI(contentID); |
| 114 ASSERT(cidURI.isValid()); | 114 DCHECK(cidURI.isValid()); |
| 115 | 115 |
| 116 if (isHTMLFrameElementBase(&element)) { | 116 if (isHTMLFrameElementBase(&element)) { |
| 117 rewrittenLink = cidURI.getString(); | 117 rewrittenLink = cidURI.getString(); |
| 118 return true; | 118 return true; |
| 119 } | 119 } |
| 120 | 120 |
| 121 if (isHTMLObjectElement(&element)) { | 121 if (isHTMLObjectElement(&element)) { |
| 122 Document* doc = frameOwnerElement->contentDocument(); | 122 Document* doc = frameOwnerElement->contentDocument(); |
| 123 bool isHandledBySerializer = doc->isHTMLDocument() | 123 bool isHandledBySerializer = doc->isHTMLDocument() |
| 124 || doc->isXHTMLDocument() || doc->isImageDocument(); | 124 || doc->isXHTMLDocument() || doc->isImageDocument(); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 147 MHTMLArchive::generateMHTMLHeader( | 147 MHTMLArchive::generateMHTMLHeader( |
| 148 boundary, document->title(), document->suggestedMIMEType(), | 148 boundary, document->title(), document->suggestedMIMEType(), |
| 149 *buffer); | 149 *buffer); |
| 150 return buffer.release(); | 150 return buffer.release(); |
| 151 } | 151 } |
| 152 | 152 |
| 153 WebData WebFrameSerializer::generateMHTMLParts( | 153 WebData WebFrameSerializer::generateMHTMLParts( |
| 154 const WebString& boundary, WebLocalFrame* webFrame, bool useBinaryEncoding, | 154 const WebString& boundary, WebLocalFrame* webFrame, bool useBinaryEncoding, |
| 155 MHTMLPartsGenerationDelegate* webDelegate) | 155 MHTMLPartsGenerationDelegate* webDelegate) |
| 156 { | 156 { |
| 157 ASSERT(webFrame); | 157 DCHECK(webFrame); |
| 158 ASSERT(webDelegate); | 158 DCHECK(webDelegate); |
| 159 | 159 |
| 160 // Translate arguments from public to internal blink APIs. | 160 // Translate arguments from public to internal blink APIs. |
| 161 LocalFrame* frame = toWebLocalFrameImpl(webFrame)->frame(); | 161 LocalFrame* frame = toWebLocalFrameImpl(webFrame)->frame(); |
| 162 MHTMLArchive::EncodingPolicy encodingPolicy = useBinaryEncoding | 162 MHTMLArchive::EncodingPolicy encodingPolicy = useBinaryEncoding |
| 163 ? MHTMLArchive::EncodingPolicy::UseBinaryEncoding | 163 ? MHTMLArchive::EncodingPolicy::UseBinaryEncoding |
| 164 : MHTMLArchive::EncodingPolicy::UseDefaultEncoding; | 164 : MHTMLArchive::EncodingPolicy::UseDefaultEncoding; |
| 165 | 165 |
| 166 // Serialize. | 166 // Serialize. |
| 167 Vector<SerializedResource> resources; | 167 Vector<SerializedResource> resources; |
| 168 MHTMLFrameSerializerDelegate coreDelegate(*webDelegate); | 168 MHTMLFrameSerializerDelegate coreDelegate(*webDelegate); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 WebString WebFrameSerializer::generateBaseTagDeclaration(const WebString& baseTa
rget) | 223 WebString WebFrameSerializer::generateBaseTagDeclaration(const WebString& baseTa
rget) |
| 224 { | 224 { |
| 225 // TODO(yosin) We should call |FrameSerializer::baseTagDeclarationOf()|. | 225 // TODO(yosin) We should call |FrameSerializer::baseTagDeclarationOf()|. |
| 226 if (baseTarget.isEmpty()) | 226 if (baseTarget.isEmpty()) |
| 227 return String("<base href=\".\">"); | 227 return String("<base href=\".\">"); |
| 228 String baseString = "<base href=\".\" target=\"" + static_cast<const String&
>(baseTarget) + "\">"; | 228 String baseString = "<base href=\".\" target=\"" + static_cast<const String&
>(baseTarget) + "\">"; |
| 229 return baseString; | 229 return baseString; |
| 230 } | 230 } |
| 231 | 231 |
| 232 } // namespace blink | 232 } // namespace blink |
| OLD | NEW |