diff options
author | robertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-11 20:39:18 +0000 |
---|---|---|
committer | robertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-11 20:39:18 +0000 |
commit | c41468f5e92ef7bcc7f223b809b9eab5ccf78635 (patch) | |
tree | 529f884cc317376e8972418a0e423603c303962c /chrome_frame/chrome_tab.cc | |
parent | d62373fa58514f213ed116ae984eaae942dce018 (diff) | |
download | chromium_src-c41468f5e92ef7bcc7f223b809b9eab5ccf78635.zip chromium_src-c41468f5e92ef7bcc7f223b809b9eab5ccf78635.tar.gz chromium_src-c41468f5e92ef7bcc7f223b809b9eab5ccf78635.tar.bz2 |
Add NPAPI plugin registration persistence code to chrome frame. If the DLL is already registered as an NPAPI plugin, keep that registration information up to date across updates.
Review URL: http://codereview.chromium.org/385015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31697 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/chrome_tab.cc')
-rw-r--r-- | chrome_frame/chrome_tab.cc | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/chrome_frame/chrome_tab.cc b/chrome_frame/chrome_tab.cc index 0c79b03..01d862a 100644 --- a/chrome_frame/chrome_tab.cc +++ b/chrome_frame/chrome_tab.cc @@ -126,9 +126,9 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE instance, ATL::CTrace::s_trace.ChangeCategory(atlTraceRegistrar, 0, ATLTRACESTATUS_DISABLED); #endif + g_exit_manager = new base::AtExitManager(); CommandLine::Init(0, NULL); InitializeCrashReporting(); - g_exit_manager = new base::AtExitManager(); logging::InitLogging(NULL, logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG, logging::LOCK_LOG_FILE, logging::DELETE_OLD_LOG_FILE); } else if (reason == DLL_PROCESS_DETACH) { @@ -281,6 +281,10 @@ STDAPI DllRegisterServer() { hr = E_FAIL; } + if (UtilIsPersistentNPAPIMarkerSet()) { + hr = _AtlModule.UpdateRegistryFromResourceS(IDR_CHROMEFRAME_NPAPI, TRUE); + } + return hr; } @@ -296,18 +300,37 @@ STDAPI DllUnregisterServer() { if (!RegisterSecuredMimeHandler(false)) hr = E_FAIL; } + + if (UtilIsNPAPIPluginRegistered()) { + hr = _AtlModule.UpdateRegistryFromResourceS(IDR_CHROMEFRAME_NPAPI, FALSE); + } + return hr; } +// Registers the NPAPI plugin and sets the persistent marker that tells us +// to re-register it through updates. STDAPI RegisterNPAPIPlugin() { HRESULT hr = _AtlModule.UpdateRegistryFromResourceS(IDR_CHROMEFRAME_NPAPI, TRUE); + if (SUCCEEDED(hr)) { + if (!UtilChangePersistentNPAPIMarker(true)) { + hr = E_FAIL; + } + } return hr; } +// Unregisters the NPAPI plugin and clears the persistent marker that tells us +// to re-register it through updates. STDAPI UnregisterNPAPIPlugin() { HRESULT hr = _AtlModule.UpdateRegistryFromResourceS(IDR_CHROMEFRAME_NPAPI, FALSE); + if (SUCCEEDED(hr)) { + if (!UtilChangePersistentNPAPIMarker(false)) { + hr = E_FAIL; + } + } return hr; } |