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

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

Issue 189573002: Convert HTMLFrameOwnerElement and FocusController to use Frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Improved downcast checking. Created 6 years, 9 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 void retrieveResourcesForElement(Element* element, 106 void retrieveResourcesForElement(Element* element,
107 Vector<LocalFrame*>* visitedFrames, 107 Vector<LocalFrame*>* visitedFrames,
108 Vector<LocalFrame*>* framesToVisit, 108 Vector<LocalFrame*>* framesToVisit,
109 Vector<KURL>* frameURLs, 109 Vector<KURL>* frameURLs,
110 Vector<KURL>* resourceURLs) 110 Vector<KURL>* resourceURLs)
111 { 111 {
112 // If the node is a frame, we'll process it later in retrieveResourcesForFra me. 112 // If the node is a frame, we'll process it later in retrieveResourcesForFra me.
113 if ((element->hasTagName(HTMLNames::iframeTag) || element->hasTagName(HTMLNa mes::frameTag) 113 if ((element->hasTagName(HTMLNames::iframeTag) || element->hasTagName(HTMLNa mes::frameTag)
114 || element->hasTagName(HTMLNames::objectTag) || element->hasTagName(HTML Names::embedTag)) 114 || element->hasTagName(HTMLNames::objectTag) || element->hasTagName(HTML Names::embedTag))
115 && element->isFrameOwnerElement()) { 115 && element->isFrameOwnerElement()) {
116 if (LocalFrame* frame = toHTMLFrameOwnerElement(element)->contentFrame() ) { 116 Frame* frame = toHTMLFrameOwnerElement(element)->contentFrame();
117 if (!visitedFrames->contains(frame)) 117 if (frame && frame->isLocalFrame()) {
118 framesToVisit->append(frame); 118 if (!visitedFrames->contains(toLocalFrame(frame)))
119 framesToVisit->append(toLocalFrame(frame));
119 return; 120 return;
120 } 121 }
121 } 122 }
122 123
123 KURL url = getSubResourceURLFromElement(element); 124 KURL url = getSubResourceURLFromElement(element);
124 if (url.isEmpty() || !url.isValid()) 125 if (url.isEmpty() || !url.isValid())
125 return; // No subresource for this node. 126 return; // No subresource for this node.
126 127
127 // Ignore URLs that have a non-standard protocols. Since the FTP protocol 128 // Ignore URLs that have a non-standard protocols. Since the FTP protocol
128 // does no have a cache mechanism, we skip it as well. 129 // does no have a cache mechanism, we skip it as well.
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 290
290 WebString WebPageSerializer::generateBaseTagDeclaration(const WebString& baseTar get) 291 WebString WebPageSerializer::generateBaseTagDeclaration(const WebString& baseTar get)
291 { 292 {
292 if (baseTarget.isEmpty()) 293 if (baseTarget.isEmpty())
293 return String("<base href=\".\">"); 294 return String("<base href=\".\">");
294 String baseString = "<base href=\".\" target=\"" + static_cast<const String& >(baseTarget) + "\">"; 295 String baseString = "<base href=\".\" target=\"" + static_cast<const String& >(baseTarget) + "\">";
295 return baseString; 296 return baseString;
296 } 297 }
297 298
298 } // namespace blink 299 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698