FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
void FB::PluginCore::setReady ( )

Called by the browser to indicate that the basic initialization is complete and the plugin is now ready to interact with the Browser via Javascript. This may or may not occur before the Window (if any) is set.

Definition at line 111 of file PluginCore.cpp.

References getRootJSAPI(), m_host, m_params, onPluginReady(), and FB::variant_list_of().

112 {
113  bool rval = false;
114  FBLOG_TRACE("PluginCore", "Plugin Ready");
115  try {
116  FB::VariantMap::iterator fnd = m_params.find("onload");
117  if (fnd != m_params.end()) {
118  m_host->initJS(this);
119  FB::JSObjectPtr method = fnd->second.convert_cast<FB::JSObjectPtr>();
120  if (method) {
121  FBLOG_TRACE("PluginCore", "InvokeDelayed(onload)");
122  m_host->delayedInvoke(250, method, FB::variant_list_of(getRootJSAPI()));
123  rval = true;
124  }
125  }
126  } catch(...) {
127  // Usually this would be if it isn't a JSObjectPtr or the object can't be called
128  }
129  onPluginReady();
130  return rval;
131 }
virtual JSAPIPtr getRootJSAPI()
Gets the root JSAPI object. It is not recommended to call this from the constructor or before setHost...
Definition: PluginCore.h:263
boost::shared_ptr< FB::JSObject > JSObjectPtr
Defines an alias representing a JSObject shared_ptr (you should never use a JSObject* directly) ...
Definition: APITypes.h:109
FB::detail::VariantListInserter variant_list_of(FB::variant v)
Allows convenient creation of an FB::VariantList.
Definition: variant_list.h:122
FB::VariantMap m_params
Definition: PluginCore.h:361
BrowserHostPtr m_host
The BrowserHost object for the current session; deprecated, use getHost()
Definition: PluginCore.h:354
virtual void onPluginReady()
This is called when the plugin is ready.
Definition: PluginCore.h:210

Here is the call graph for this function: