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

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

Issue 23570006: Refactoring: Add convenience method toPluginContainerImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rework with comments Created 7 years, 3 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
« no previous file with comments | « Source/web/WebHelperPluginImpl.cpp ('k') | Source/web/WebPluginContainerImpl.h » ('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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 WebPluginContainer* WebNode::pluginContainer() const 236 WebPluginContainer* WebNode::pluginContainer() const
237 { 237 {
238 if (isNull()) 238 if (isNull())
239 return 0; 239 return 0;
240 const Node* coreNode = constUnwrap<Node>(); 240 const Node* coreNode = constUnwrap<Node>();
241 if (coreNode->hasTagName(HTMLNames::objectTag) || coreNode->hasTagName(HTMLN ames::embedTag)) { 241 if (coreNode->hasTagName(HTMLNames::objectTag) || coreNode->hasTagName(HTMLN ames::embedTag)) {
242 RenderObject* object = coreNode->renderer(); 242 RenderObject* object = coreNode->renderer();
243 if (object && object->isWidget()) { 243 if (object && object->isWidget()) {
244 Widget* widget = WebCore::toRenderWidget(object)->widget(); 244 Widget* widget = WebCore::toRenderWidget(object)->widget();
245 if (widget && widget->isPluginContainer()) 245 if (widget && widget->isPluginContainer())
246 return static_cast<WebPluginContainerImpl*>(widget); 246 return toPluginContainerImpl(widget);
247 } 247 }
248 } 248 }
249 return 0; 249 return 0;
250 } 250 }
251 251
252 WebElement WebNode::shadowHost() const 252 WebElement WebNode::shadowHost() const
253 { 253 {
254 if (isNull()) 254 if (isNull())
255 return WebElement(); 255 return WebElement();
256 const Node* coreNode = constUnwrap<Node>(); 256 const Node* coreNode = constUnwrap<Node>();
(...skipping 10 matching lines...) Expand all
267 m_private = node; 267 m_private = node;
268 return *this; 268 return *this;
269 } 269 }
270 270
271 WebNode::operator PassRefPtr<Node>() const 271 WebNode::operator PassRefPtr<Node>() const
272 { 272 {
273 return m_private.get(); 273 return m_private.get();
274 } 274 }
275 275
276 } // namespace WebKit 276 } // namespace WebKit
OLDNEW
« no previous file with comments | « Source/web/WebHelperPluginImpl.cpp ('k') | Source/web/WebPluginContainerImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698