diff options
Diffstat (limited to 'chrome_frame/chrome_frame_activex.cc')
-rw-r--r-- | chrome_frame/chrome_frame_activex.cc | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/chrome_frame/chrome_frame_activex.cc b/chrome_frame/chrome_frame_activex.cc index a5d6d99..6085546 100644 --- a/chrome_frame/chrome_frame_activex.cc +++ b/chrome_frame/chrome_frame_activex.cc @@ -246,13 +246,35 @@ void ChromeFrameActivex::OnMessageFromChromeFrame(int tab_handle, } } +bool ChromeFrameActivex::ShouldShowVersionMismatchDialog( + bool is_privileged, + IOleClientSite* client_site) { + if (!is_privileged) { + return true; + } + + if (client_site) { + ScopedComPtr<IChromeFramePrivileged> service; + HRESULT hr = DoQueryService(SID_ChromeFramePrivileged, + client_site, + service.Receive()); + if (SUCCEEDED(hr) && service) { + return (S_FALSE != service->ShouldShowVersionMismatchDialog()); + } + } + + NOTREACHED(); + return true; +} + void ChromeFrameActivex::OnAutomationServerLaunchFailed( AutomationLaunchResult reason, const std::string& server_version) { Base::OnAutomationServerLaunchFailed(reason, server_version); - // Do not display warnings for privileged instances of Chrome Frame. - if (reason == AUTOMATION_VERSION_MISMATCH && !is_privileged_) { - THREAD_SAFE_UMA_HISTOGRAM_COUNTS("ChromeFrame.VersionMismatchDisplayed", 1); + if (reason == AUTOMATION_VERSION_MISMATCH && + ShouldShowVersionMismatchDialog(is_privileged_, m_spClientSite)) { + THREAD_SAFE_UMA_HISTOGRAM_COUNTS( + "ChromeFrame.VersionMismatchDisplayed", 1); DisplayVersionMismatchWarning(m_hWnd, server_version); } } |