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

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

Issue 143453010: Have getElementsByClassName() / getElementsByTagName*() return an HTMLCollection (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 10 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/core/html/HTMLObjectElement.cpp ('k') | Source/web/WebNode.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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 22 matching lines...) Expand all
33 33
34 #include "PageWidgetDelegate.h" 34 #include "PageWidgetDelegate.h"
35 #include "WebDocument.h" 35 #include "WebDocument.h"
36 #include "WebFrameClient.h" 36 #include "WebFrameClient.h"
37 #include "WebFrameImpl.h" 37 #include "WebFrameImpl.h"
38 #include "WebPlugin.h" 38 #include "WebPlugin.h"
39 #include "WebPluginContainerImpl.h" 39 #include "WebPluginContainerImpl.h"
40 #include "WebViewClient.h" 40 #include "WebViewClient.h"
41 #include "WebViewImpl.h" 41 #include "WebViewImpl.h"
42 #include "WebWidgetClient.h" 42 #include "WebWidgetClient.h"
43 #include "core/dom/NodeList.h" 43 #include "core/html/HTMLCollection.h"
44 #include "core/html/HTMLPlugInElement.h" 44 #include "core/html/HTMLPlugInElement.h"
45 #include "core/loader/EmptyClients.h" 45 #include "core/loader/EmptyClients.h"
46 #include "core/loader/FrameLoadRequest.h" 46 #include "core/loader/FrameLoadRequest.h"
47 #include "core/page/FocusController.h" 47 #include "core/page/FocusController.h"
48 #include "core/frame/FrameView.h" 48 #include "core/frame/FrameView.h"
49 #include "core/page/Page.h" 49 #include "core/page/Page.h"
50 #include "core/frame/Settings.h" 50 #include "core/frame/Settings.h"
51 51
52 using namespace WebCore; 52 using namespace WebCore;
53 53
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 m_frameClient = adoptPtr(new HelperPluginFrameClient(client)); 173 m_frameClient = adoptPtr(new HelperPluginFrameClient(client));
174 m_mainFrame = WebFrameImpl::create(m_frameClient.get()); 174 m_mainFrame = WebFrameImpl::create(m_frameClient.get());
175 m_mainFrame->initializeAsMainFrame(m_page.get()); 175 m_mainFrame->initializeAsMainFrame(m_page.get());
176 } 176 }
177 177
178 // Returns a pointer to the WebPlugin by finding the single <object> tag in the page. 178 // Returns a pointer to the WebPlugin by finding the single <object> tag in the page.
179 WebPlugin* WebHelperPluginImpl::getPlugin() 179 WebPlugin* WebHelperPluginImpl::getPlugin()
180 { 180 {
181 ASSERT(m_page); 181 ASSERT(m_page);
182 182
183 RefPtr<NodeList> objectElements = m_page->mainFrame()->document()->getElemen tsByTagName(WebCore::HTMLNames::objectTag.localName()); 183 RefPtr<HTMLCollection> objectElements = m_page->mainFrame()->document()->get ElementsByTagName(WebCore::HTMLNames::objectTag.localName());
184 ASSERT(objectElements && objectElements->length() == 1); 184 ASSERT(objectElements && objectElements->length() == 1);
185 if (!objectElements || objectElements->length() < 1) 185 if (!objectElements || objectElements->length() < 1)
186 return 0; 186 return 0;
187 Node* node = objectElements->item(0); 187 Node* node = objectElements->item(0);
188 ASSERT(node->hasTagName(WebCore::HTMLNames::objectTag)); 188 ASSERT(node->hasTagName(WebCore::HTMLNames::objectTag));
189 WebCore::Widget* widget = toHTMLPlugInElement(node)->pluginWidget(); 189 WebCore::Widget* widget = toHTMLPlugInElement(node)->pluginWidget();
190 if (!widget) 190 if (!widget)
191 return 0; 191 return 0;
192 WebPlugin* plugin = toWebPluginContainerImpl(widget)->plugin(); 192 WebPlugin* plugin = toWebPluginContainerImpl(widget)->plugin();
193 ASSERT(plugin); 193 ASSERT(plugin);
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 { 260 {
261 RELEASE_ASSERT(client); 261 RELEASE_ASSERT(client);
262 262
263 // The returned object is owned by the caller, which must destroy it by 263 // The returned object is owned by the caller, which must destroy it by
264 // calling closeAndDelete(). The WebWidgetClient must not call close() 264 // calling closeAndDelete(). The WebWidgetClient must not call close()
265 // other than as a result of closeAndDelete(). 265 // other than as a result of closeAndDelete().
266 return new WebHelperPluginImpl(client); 266 return new WebHelperPluginImpl(client);
267 } 267 }
268 268
269 } // namespace blink 269 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/html/HTMLObjectElement.cpp ('k') | Source/web/WebNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698