diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-02 14:47:14 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-02 14:47:14 +0000 |
commit | ca982ec4920857adf2d22a5a92cc54829718d805 (patch) | |
tree | 36664a2941699fdbd6655075ea1818e73c2b752e | |
parent | 84ae53dda0bc194ca7dda812bd5d5b535e4afaab (diff) | |
download | chromium_src-ca982ec4920857adf2d22a5a92cc54829718d805.zip chromium_src-ca982ec4920857adf2d22a5a92cc54829718d805.tar.gz chromium_src-ca982ec4920857adf2d22a5a92cc54829718d805.tar.bz2 |
Fixes to address code review comments from tommi from CL http://codereview.chromium.org/1823001/show
Changes include the following:-
1. Removing the IObjectWithSite::SetSite implementation from the chrome frame activex.
2. Removing the site_ member and using the ATL m_spUnkSite member.
3. Renaming the RegisterBHOIfNeeded member function to registerBhoIfNeeded to be consistent with the
other methods in the IChromeFrame interface.
Fixes bug http://code.google.com/p/chromium/issues/detail?id=42790
Bug=42790
TBR=tommi
Review URL: http://codereview.chromium.org/1831001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46200 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome_frame/CFInstall.js | 2 | ||||
-rw-r--r-- | chrome_frame/chrome_frame_activex.cc | 14 | ||||
-rw-r--r-- | chrome_frame/chrome_frame_activex.h | 7 | ||||
-rw-r--r-- | chrome_frame/chrome_frame_activex_base.h | 2 | ||||
-rw-r--r-- | chrome_frame/chrome_tab.idl | 2 |
5 files changed, 7 insertions, 20 deletions
diff --git a/chrome_frame/CFInstall.js b/chrome_frame/CFInstall.js index 5f2efdf..98c70f4 100644 --- a/chrome_frame/CFInstall.js +++ b/chrome_frame/CFInstall.js @@ -49,7 +49,7 @@ try { var obj = new ActiveXObject('ChromeTab.ChromeFrame'); if (obj) { - obj.RegisterBHOIfNeeded(); + obj.registerBhoIfNeeded(); return true; } } catch(e) { diff --git a/chrome_frame/chrome_frame_activex.cc b/chrome_frame/chrome_frame_activex.cc index ad582bc..a662153 100644 --- a/chrome_frame/chrome_frame_activex.cc +++ b/chrome_frame/chrome_frame_activex.cc @@ -377,14 +377,6 @@ STDMETHODIMP ChromeFrameActivex::put_src(BSTR src) { return Base::put_src(src); } -STDMETHODIMP ChromeFrameActivex::SetSite(IUnknown* site) { - // We need to bootstrap our BHO if IE is running while chrome frame is - // installed. For new tabs and windows the newly registered BHO's are - // loaded. The bootstrapping is only needed for the current tab. - site_ = site; - return IObjectWithSiteImpl<ChromeFrameActivex>::SetSite(site); -} - HRESULT ChromeFrameActivex::IOleObject_SetClientSite( IOleClientSite* client_site) { HRESULT hr = Base::IOleObject_SetClientSite(client_site); @@ -609,8 +601,8 @@ HRESULT ChromeFrameActivex::InstallTopLevelHook(IOleClientSite* client_site) { return chrome_wndproc_hook_ ? S_OK : E_FAIL; } -HRESULT ChromeFrameActivex::RegisterBHOIfNeeded() { - if (!site_) { +HRESULT ChromeFrameActivex::registerBhoIfNeeded() { + if (!m_spUnkSite) { NOTREACHED() << "Invalid client site"; return E_FAIL; } @@ -621,7 +613,7 @@ HRESULT ChromeFrameActivex::RegisterBHOIfNeeded() { } ScopedComPtr<IWebBrowser2> web_browser2; - HRESULT hr = DoQueryService(SID_SWebBrowserApp, site_, + HRESULT hr = DoQueryService(SID_SWebBrowserApp, m_spUnkSite, web_browser2.Receive()); if (FAILED(hr) || web_browser2.get() == NULL) { DLOG(WARNING) << "Failed to get IWebBrowser2 from client site. Error:" diff --git a/chrome_frame/chrome_frame_activex.h b/chrome_frame/chrome_frame_activex.h index 7192126..ffe7880 100644 --- a/chrome_frame/chrome_frame_activex.h +++ b/chrome_frame/chrome_frame_activex.h @@ -85,14 +85,11 @@ END_MSG_MAP() // Overridden to perform security checks. STDMETHOD(put_src)(BSTR src); - // IObjectWithSite - STDMETHOD(SetSite)(IUnknown* site); - // IChromeFrame // On a fresh install of ChromeFrame the BHO will not be loaded in existing // IE tabs/windows. This function instantiates the BHO and registers it // explicitly. - STDMETHOD(RegisterBHOIfNeeded)(); + STDMETHOD(registerBhoIfNeeded)(); protected: // ChromeFrameDelegate overrides @@ -149,8 +146,6 @@ END_MSG_MAP() // A hook attached to the top-level window containing the ActiveX control. HHOOK chrome_wndproc_hook_; - - ScopedComPtr<IUnknown> site_; }; #endif // CHROME_FRAME_CHROME_FRAME_ACTIVEX_H_ diff --git a/chrome_frame/chrome_frame_activex_base.h b/chrome_frame/chrome_frame_activex_base.h index eb1391f..de60462 100644 --- a/chrome_frame/chrome_frame_activex_base.h +++ b/chrome_frame/chrome_frame_activex_base.h @@ -808,7 +808,7 @@ END_MSG_MAP() return S_OK; } - STDMETHOD(RegisterBHOIfNeeded)() { + STDMETHOD(registerBhoIfNeeded)() { return E_NOTIMPL; } diff --git a/chrome_frame/chrome_tab.idl b/chrome_frame/chrome_tab.idl index aa492bc..d2181ac 100644 --- a/chrome_frame/chrome_tab.idl +++ b/chrome_frame/chrome_tab.idl @@ -80,7 +80,7 @@ interface IChromeFrame : IDispatch { [id(15)] // This method bootstraps the BHO if it is not already loaded. - HRESULT RegisterBHOIfNeeded(); + HRESULT registerBhoIfNeeded(); }; [ |