- // Get the name and version of the plugin, create atoms and set them in a
- // window property. Use atoms so that other processes can access the name and
- // version of the plugin that this window is hosting.
- if (instance_ != NULL) {
- PluginLib* plugin_lib = instance()->plugin_lib();
- if (plugin_lib != NULL) {
- std::wstring plugin_name = plugin_lib->plugin_info().name;
- if (!plugin_name.empty()) {
- ATOM plugin_name_atom = GlobalAddAtomW(plugin_name.c_str());
- DCHECK_NE(0, plugin_name_atom);
- result = SetProp(windowed_handle_,
- kPluginNameAtomProperty,
- reinterpret_cast<HANDLE>(plugin_name_atom));
- DCHECK(result == TRUE) << "SetProp failed, last error = " <<
- GetLastError();
- }
- base::string16 plugin_version = plugin_lib->plugin_info().version;
- if (!plugin_version.empty()) {
- ATOM plugin_version_atom = GlobalAddAtomW(plugin_version.c_str());
- DCHECK_NE(0, plugin_version_atom);
- result = SetProp(windowed_handle_,
- kPluginVersionAtomProperty,
- reinterpret_cast<HANDLE>(plugin_version_atom));
- DCHECK(result == TRUE) << "SetProp failed, last error = " <<
- GetLastError();
- }
- }
- }