Commit adc9f0eb authored by vangelis@google.com's avatar vangelis@google.com

Adding support for windows safari. This requires registering the o3d plugin...

Adding support for windows safari. This requires registering the o3d plugin with firefox (via registry entries)
and adding Safari to the list of supported User Agents.
Review URL: http://codereview.chromium.org/326001

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30274 0039d316-1c4b-4281-b951-d872f2087c98
parent 0dd8afb8
...@@ -76,6 +76,19 @@ Wix script for building o3d installer. ...@@ -76,6 +76,19 @@ Wix script for building o3d installer.
<File Id='pu.GoogleNpapiDll.dll' Name='npo3d.dll' <File Id='pu.GoogleNpapiDll.dll' Name='npo3d.dll'
LongName='npo3dautoplugin.dll' DiskId='1' LongName='npo3dautoplugin.dll' DiskId='1'
Source='$(var.NPPluginPath)' Vital='yes' /> Source='$(var.NPPluginPath)' Vital='yes' />
<Registry Id='pu.NpapiPlugin' Root='HKCU'
Key='Software\MozillaPlugins\@google.com/O3DPlugin'>
<Registry Id='pu.NpapiPluginPath' Type='string'
Action='write' Name='Path' Value='[pu.FirefoxPluginsDir]npo3dautoplugin.dll' />
<Registry Id='pu.NpapiPluginName' Type='string'
Action='write' Name='ProductName' Value='O3D Plugin' />
<Registry Id='pu.NpapiPluginDescription' Type='string'
Action='write' Name='Description' Value='O3D Plugin' />
<Registry Id='pu.NpapiPluginVendor' Type='string'
Action='write' Name='Vendor' Value='Google' />
<Registry Id='pu.NpapiPluginVersion' Type='string'
Action='write' Name='Version' Value='$(var.NppVersion)' />
</Registry>
<Condition>NOT (ALLUSERS)</Condition> <Condition>NOT (ALLUSERS)</Condition>
</Component> </Component>
<?if $(var.IncludeSoftwareRenderer) = True ?> <?if $(var.IncludeSoftwareRenderer) = True ?>
......
...@@ -210,7 +210,7 @@ bool CheckConfig(NPP npp) { ...@@ -210,7 +210,7 @@ bool CheckConfig(NPP npp) {
} }
} }
// Check User agent. Only Firefox, Chrome and IE are supported. // Check User agent. Only Firefox, Chrome, Safari and IE are supported.
std::string user_agent = GetUserAgent(npp); std::string user_agent = GetUserAgent(npp);
if (!CheckUserAgent(npp, user_agent)) return false; if (!CheckUserAgent(npp, user_agent)) return false;
return true; return true;
......
...@@ -80,11 +80,12 @@ bool CheckOSVersion(NPP npp) { ...@@ -80,11 +80,12 @@ bool CheckOSVersion(NPP npp) {
return true; return true;
} }
// Checks user agent string. We only allow Firefox, Chrome, and IE. // Checks user agent string. We only allow Firefox, Chrome, Safari and IE.
bool CheckUserAgent(NPP npp, const std::string &user_agent) { bool CheckUserAgent(NPP npp, const std::string &user_agent) {
if (user_agent.find("Firefox") == user_agent.npos && if (user_agent.find("Firefox") == user_agent.npos &&
user_agent.find("Chrome") == user_agent.npos && user_agent.find("Chrome") == user_agent.npos &&
user_agent.find("MSIE") == user_agent.npos) { user_agent.find("MSIE") == user_agent.npos &&
user_agent.find("Safari") == user_agent.npos) {
std::string error = std::string("Unsupported user agent: ") + user_agent; std::string error = std::string("Unsupported user agent: ") + user_agent;
return AskUser(npp, error); return AskUser(npp, error);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment