[Webkit-unassigned] [Bug 36434] [chromium]WebKit side of adding search support to Pepper.
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Mar 23 15:05:58 PDT 2010
https://bugs.webkit.org/show_bug.cgi?id=36434
Darin Fisher (:fishd, Google) <fishd at chromium.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #51384|review? |review-
Flag| |
--- Comment #5 from Darin Fisher (:fishd, Google) <fishd at chromium.org> 2010-03-23 15:05:58 PST ---
(From update of attachment 51384)
> Index: WebKit/chromium/public/WebDocument.h
...
> // Returns the frame the document belongs to or 0 if the document is frameless.
> WEBKIT_API WebFrame* frame() const;
> WEBKIT_API bool isHTMLDocument() const;
> + WEBKIT_API bool isPluginDocument(WebPluginContainer**);
I think it is a little awkward for this function to have the side effect of
returning the contained plugin.
We could instead follow the inheritance approach. Define WebPluginDocument:
class WebPluginDocument : public WebDocument {
public:
/* boiler plate */
WEBKIT_API WebPlugin* plugin();
};
Then, WebDocument would just have the simple method:
WEBKIT_API bool isPluginDocument() const;
Folks would then use WebPluginDocument like so.
WebDocument doc = ...;
if (doc.isPluginDocument()) {
WebPlugin* plugin = doc.to<WebPluginDocument>.plugin();
...
}
Unfortunately, WebNode (which WebDocument extends) doesn't have a to<T>
method. It just has a toElement<T> method, which should really just be
renamed to<T> so that it can be used with derived types that are not
elements. For now, we could just add a copy of toElement<T> named to<T>,
and mark toElement<T> as deprecated. You can leave it to me to clean up
the deprecated usage.
-Darin
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list