OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Implementation of ChromeActiveDocument | 5 // Implementation of ChromeActiveDocument |
6 #include "chrome_frame/chrome_active_document.h" | 6 #include "chrome_frame/chrome_active_document.h" |
7 | 7 |
8 #include <hlink.h> | 8 #include <hlink.h> |
9 #include <htiface.h> | 9 #include <htiface.h> |
10 #include <mshtmcid.h> | 10 #include <mshtmcid.h> |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 } | 132 } |
133 } | 133 } |
134 return IOleObjectImpl<ChromeActiveDocument>::DoVerb(verb, | 134 return IOleObjectImpl<ChromeActiveDocument>::DoVerb(verb, |
135 msg, | 135 msg, |
136 active_site, | 136 active_site, |
137 index, | 137 index, |
138 parent_window, | 138 parent_window, |
139 pos); | 139 pos); |
140 } | 140 } |
141 | 141 |
142 STDMETHODIMP ChromeActiveDocument::InPlaceDeactivate(void) { | |
143 // Release the pointers we have no need for now. | |
144 doc_site_.Release(); | |
145 in_place_frame_.Release(); | |
146 return IOleInPlaceObjectWindowlessImpl<ChromeActiveDocument>:: | |
147 InPlaceDeactivate(); | |
148 } | |
149 | |
150 // Override IOleInPlaceActiveObjectImpl::OnDocWindowActivate | 142 // Override IOleInPlaceActiveObjectImpl::OnDocWindowActivate |
151 STDMETHODIMP ChromeActiveDocument::OnDocWindowActivate(BOOL activate) { | 143 STDMETHODIMP ChromeActiveDocument::OnDocWindowActivate(BOOL activate) { |
152 DLOG(INFO) << __FUNCTION__; | 144 DLOG(INFO) << __FUNCTION__; |
153 return S_OK; | 145 return S_OK; |
154 } | 146 } |
155 | 147 |
156 STDMETHODIMP ChromeActiveDocument::TranslateAccelerator(MSG* msg) { | 148 STDMETHODIMP ChromeActiveDocument::TranslateAccelerator(MSG* msg) { |
157 DLOG(INFO) << __FUNCTION__; | 149 DLOG(INFO) << __FUNCTION__; |
158 if (msg == NULL) | 150 if (msg == NULL) |
159 return E_POINTER; | 151 return E_POINTER; |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 | 283 |
292 HRESULT ChromeActiveDocument::IOleObject_SetClientSite( | 284 HRESULT ChromeActiveDocument::IOleObject_SetClientSite( |
293 IOleClientSite* client_site) { | 285 IOleClientSite* client_site) { |
294 if (client_site == NULL) { | 286 if (client_site == NULL) { |
295 ChromeActiveDocument* cached_document = g_active_doc_cache.Get(); | 287 ChromeActiveDocument* cached_document = g_active_doc_cache.Get(); |
296 if (cached_document) { | 288 if (cached_document) { |
297 DCHECK(this == cached_document); | 289 DCHECK(this == cached_document); |
298 g_active_doc_cache.Set(NULL); | 290 g_active_doc_cache.Set(NULL); |
299 cached_document->Release(); | 291 cached_document->Release(); |
300 } | 292 } |
| 293 |
| 294 ScopedComPtr<IDocHostUIHandler> doc_host_handler; |
| 295 doc_host_handler.QueryFrom(doc_site_); |
| 296 |
| 297 if (doc_host_handler.get()) { |
| 298 doc_host_handler->HideUI(); |
| 299 } |
| 300 |
| 301 doc_site_.Release(); |
| 302 in_place_frame_.Release(); |
301 } | 303 } |
302 return Base::IOleObject_SetClientSite(client_site); | 304 return Base::IOleObject_SetClientSite(client_site); |
303 } | 305 } |
304 | 306 |
305 | 307 |
306 HRESULT ChromeActiveDocument::ActiveXDocActivate(LONG verb) { | 308 HRESULT ChromeActiveDocument::ActiveXDocActivate(LONG verb) { |
307 HRESULT hr = S_OK; | 309 HRESULT hr = S_OK; |
308 m_bNegotiatedWnd = TRUE; | 310 m_bNegotiatedWnd = TRUE; |
309 if (!m_bInPlaceActive) { | 311 if (!m_bInPlaceActive) { |
310 hr = m_spInPlaceSite->CanInPlaceActivate(); | 312 hr = m_spInPlaceSite->CanInPlaceActivate(); |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
808 ScopedComPtr<IBrowserService> browser_service; | 810 ScopedComPtr<IBrowserService> browser_service; |
809 DoQueryService(SID_SShellBrowser, m_spClientSite, browser_service.Receive()); | 811 DoQueryService(SID_SShellBrowser, m_spClientSite, browser_service.Receive()); |
810 if (browser_service) { | 812 if (browser_service) { |
811 ScopedComPtr<ITravelLog> travel_log; | 813 ScopedComPtr<ITravelLog> travel_log; |
812 browser_service->GetTravelLog(travel_log.Receive()); | 814 browser_service->GetTravelLog(travel_log.Receive()); |
813 if (travel_log) { | 815 if (travel_log) { |
814 travel_log->Travel(browser_service, offset); | 816 travel_log->Travel(browser_service, offset); |
815 } | 817 } |
816 } | 818 } |
817 } | 819 } |
OLD | NEW |