CEF1 plugins installation and management

Do not post support requests, bug reports or feature requests. Discuss CEF here. Non-CEF related discussion goes in General Discussion!

CEF1 plugins installation and management

Postby vkushnir » Sat Jul 27, 2013 3:41 pm

Is there a way to get notified (some type of callback mechanism I guess) in CEF1 that any particular plugin (like Flash Player, Java, etc.) is not installed or no available to CEF1-based application? Basically what is expected way to manage plugins in CEF1 application?
vkushnir
Newbie
 
Posts: 4
Joined: Sat Jul 27, 2013 3:35 pm

Re: CEF1 plugins installation and management

Postby magreenblatt » Sat Jul 27, 2013 5:36 pm

If you're looking for a particular plugin you can use CefGetWebPlugin*() functions to test what is currently available.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: CEF1 plugins installation and management

Postby vkushnir » Sat Jul 27, 2013 6:00 pm

Thank you, but I am looking for the way to be able to prompt user to install plugin if particular Web site requires it.

As far as I can tell CefGetWebPlugin* allows to get plugin information or determine if it's installed:

Code: Select all
  // Find the flash plugin first to test that get by name works.
  std::string flash_name;
  CefRefPtr<CefWebPluginInfo> info = CefGetWebPluginInfo("Shockwave Flash");
  if (info.get()) {
    flash_name = info->GetName();
    html += "\n<b>Flash is installed!</b>"
            "<br/>Name: " + flash_name +
            "\n<br/>Description: " + info->GetDescription().ToString() +
            "\n<br/>Version: " + info->GetVersion().ToString() +
            "\n<br/>Path: " + info->GetPath().ToString();
  }


But I am basically looking for a method to notify CEF1-based application when m_webFrame->client()->createPlugin() returns NULL in .\src\third_party\WebKit\Source\WebKit\chromium\src\FrameLoaderClientImpl.cpp, or any other comparable solution:

Code: Select all
PassRefPtr<Widget> FrameLoaderClientImpl::createPlugin(
    const IntSize& size, // FIXME: how do we use this?
    HTMLPlugInElement* element,
    const KURL& url,
    const Vector<String>& paramNames,
    const Vector<String>& paramValues,
    const String& mimeType,
    bool loadManually)
{
    if (!m_webFrame->client())
        return 0;

    WebPluginParams params;
    params.url = url;
    params.mimeType = mimeType;
    params.attributeNames = paramNames;
    params.attributeValues = paramValues;
    params.loadManually = loadManually;

    WebPlugin* webPlugin = m_webFrame->client()->createPlugin(m_webFrame, params);
    if (!webPlugin)
        return 0;
vkushnir
Newbie
 
Posts: 4
Joined: Sat Jul 27, 2013 3:35 pm


Return to CEF Discussion

Who is online

Users browsing this forum: No registered users and 144 guests