FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
void FB::PluginCore::setParams ( const FB::VariantMap inParams)
virtual

Called by the browser to store the values provided in param tags in m_params.

This function is called once the <param> tag values from the HTML are available. After this function is called they can be accessed through m_params.

See initDefaultParams() for more information

Parameters
inParamsOptions for controlling the in.

Definition at line 68 of file PluginCore.cpp.

References m_host, and m_params.

69 {
70  for (FB::VariantMap::const_iterator it = inParams.begin(); it != inParams.end(); ++it)
71  {
72  std::string key(it->first);
73  try {
74  std::string value(it->second.convert_cast<std::string>());
75  if (key.substr(0, 2) == "on") {
76  FB::JSObjectPtr tmp;
77  tmp = m_host->getDOMWindow()
78  ->getProperty<FB::JSObjectPtr>(value);
79 
80  FBLOG_TRACE("PluginCore", "Found <param> event handler: " << key);
81 
82  m_params[key] = tmp;
83  } else {
84  m_params[key] = it->second;
85  }
86  } catch (const std::exception &ex) {
87  FBLOG_WARN("PluginCore", "Exception processing <param> " << key << ": " << ex.what());
88  m_params[it->first] = it->second;
89  }
90  }
91 }
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::VariantMap m_params
Definition: PluginCore.h:361
BrowserHostPtr m_host
The BrowserHost object for the current session; deprecated, use getHost()
Definition: PluginCore.h:354