| 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 #ifndef CHROME_FRAME_CHROME_FRAME_ACTIVEX_BASE_H_ | 5 #ifndef CHROME_FRAME_CHROME_FRAME_ACTIVEX_BASE_H_ |
| 6 #define CHROME_FRAME_CHROME_FRAME_ACTIVEX_BASE_H_ | 6 #define CHROME_FRAME_CHROME_FRAME_ACTIVEX_BASE_H_ |
| 7 | 7 |
| 8 #include <atlbase.h> | 8 #include <atlbase.h> |
| 9 #include <atlcom.h> | 9 #include <atlcom.h> |
| 10 #include <atlctl.h> | 10 #include <atlctl.h> |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 public ISupportErrorInfo, | 143 public ISupportErrorInfo, |
| 144 public IQuickActivateImpl<T>, | 144 public IQuickActivateImpl<T>, |
| 145 public com_util::IProvideClassInfo2Impl<class_id, | 145 public com_util::IProvideClassInfo2Impl<class_id, |
| 146 DIID_DIChromeFrameEvents>, | 146 DIID_DIChromeFrameEvents>, |
| 147 public com_util::IDispatchImpl<IChromeFrame>, | 147 public com_util::IDispatchImpl<IChromeFrame>, |
| 148 public IConnectionPointContainerImpl<T>, | 148 public IConnectionPointContainerImpl<T>, |
| 149 public ProxyDIChromeFrameEvents<T>, | 149 public ProxyDIChromeFrameEvents<T>, |
| 150 public IPropertyNotifySinkCP<T>, | 150 public IPropertyNotifySinkCP<T>, |
| 151 public CComCoClass<T, &class_id>, | 151 public CComCoClass<T, &class_id>, |
| 152 public CComControl<T>, | 152 public CComControl<T>, |
| 153 public ChromeFramePlugin<T>, | 153 public ChromeFramePlugin<T> { |
| 154 public TaskMarshallerThroughWindowsMessages< | |
| 155 ChromeFrameActivexBase<T, class_id> > { | |
| 156 protected: | 154 protected: |
| 157 typedef std::set<ScopedComPtr<IDispatch> > EventHandlers; | 155 typedef std::set<ScopedComPtr<IDispatch> > EventHandlers; |
| 158 typedef TaskMarshallerThroughWindowsMessages< | |
| 159 ChromeFrameActivexBase<T, class_id> > TaskMarshaller; | |
| 160 typedef ChromeFrameActivexBase<T, class_id> Base; | 156 typedef ChromeFrameActivexBase<T, class_id> Base; |
| 161 | 157 |
| 162 public: | 158 public: |
| 163 ChromeFrameActivexBase() | 159 ChromeFrameActivexBase() |
| 164 : ready_state_(READYSTATE_UNINITIALIZED), | 160 : ready_state_(READYSTATE_UNINITIALIZED), |
| 165 worker_thread_("ChromeFrameWorker_Thread") { | 161 worker_thread_("ChromeFrameWorker_Thread") { |
| 166 m_bWindowOnly = TRUE; | 162 m_bWindowOnly = TRUE; |
| 167 } | 163 } |
| 168 | 164 |
| 169 ~ChromeFrameActivexBase() { | 165 ~ChromeFrameActivexBase() { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 197 BEGIN_CONNECTION_POINT_MAP(T) | 193 BEGIN_CONNECTION_POINT_MAP(T) |
| 198 CONNECTION_POINT_ENTRY(IID_IPropertyNotifySink) | 194 CONNECTION_POINT_ENTRY(IID_IPropertyNotifySink) |
| 199 CONNECTION_POINT_ENTRY(DIID_DIChromeFrameEvents) | 195 CONNECTION_POINT_ENTRY(DIID_DIChromeFrameEvents) |
| 200 END_CONNECTION_POINT_MAP() | 196 END_CONNECTION_POINT_MAP() |
| 201 | 197 |
| 202 BEGIN_MSG_MAP(ChromeFrameActivexBase) | 198 BEGIN_MSG_MAP(ChromeFrameActivexBase) |
| 203 MESSAGE_HANDLER(WM_CREATE, OnCreate) | 199 MESSAGE_HANDLER(WM_CREATE, OnCreate) |
| 204 MESSAGE_HANDLER(WM_DESTROY, OnDestroy) | 200 MESSAGE_HANDLER(WM_DESTROY, OnDestroy) |
| 205 CHAIN_MSG_MAP(ChromeFramePlugin<T>) | 201 CHAIN_MSG_MAP(ChromeFramePlugin<T>) |
| 206 CHAIN_MSG_MAP(CComControl<T>) | 202 CHAIN_MSG_MAP(CComControl<T>) |
| 207 CHAIN_MSG_MAP(TaskMarshaller) | |
| 208 DEFAULT_REFLECTION_HANDLER() | 203 DEFAULT_REFLECTION_HANDLER() |
| 209 END_MSG_MAP() | 204 END_MSG_MAP() |
| 210 | 205 |
| 211 // IViewObjectEx | 206 // IViewObjectEx |
| 212 DECLARE_VIEW_STATUS(VIEWSTATUS_SOLIDBKGND | VIEWSTATUS_OPAQUE) | 207 DECLARE_VIEW_STATUS(VIEWSTATUS_SOLIDBKGND | VIEWSTATUS_OPAQUE) |
| 213 | 208 |
| 214 inline HRESULT IViewObject_Draw(DWORD draw_aspect, LONG index, | 209 inline HRESULT IViewObject_Draw(DWORD draw_aspect, LONG index, |
| 215 void* aspect_info, DVTARGETDEVICE* ptd, HDC info_dc, HDC dc, | 210 void* aspect_info, DVTARGETDEVICE* ptd, HDC info_dc, HDC dc, |
| 216 LPCRECTL bounds, LPCRECTL win_bounds) { | 211 LPCRECTL bounds, LPCRECTL win_bounds) { |
| 217 // ATL ASSERTs if dwDrawAspect is DVASPECT_DOCPRINT, so we cheat. | 212 // ATL ASSERTs if dwDrawAspect is DVASPECT_DOCPRINT, so we cheat. |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 } | 436 } |
| 442 | 437 |
| 443 DCHECK(request.get() != NULL); | 438 DCHECK(request.get() != NULL); |
| 444 | 439 |
| 445 if (request->Initialize( | 440 if (request->Initialize( |
| 446 automation_client_.get(), tab_handle, request_id, request_info.url, | 441 automation_client_.get(), tab_handle, request_id, request_info.url, |
| 447 request_info.method, request_info.referrer, | 442 request_info.method, request_info.referrer, |
| 448 request_info.extra_request_headers, request_info.upload_data.get(), | 443 request_info.extra_request_headers, request_info.upload_data.get(), |
| 449 static_cast<T*>(this)->is_frame_busting_enabled())) { | 444 static_cast<T*>(this)->is_frame_busting_enabled())) { |
| 450 request->set_worker_thread(&worker_thread_); | 445 request->set_worker_thread(&worker_thread_); |
| 451 request->set_task_marshaller(this); | |
| 452 // If Start is successful, it will add a self reference. | 446 // If Start is successful, it will add a self reference. |
| 453 request->Start(); | 447 request->Start(); |
| 454 request->set_parent_window(m_hWnd); | 448 request->set_parent_window(m_hWnd); |
| 455 } | 449 } |
| 456 } | 450 } |
| 457 | 451 |
| 458 virtual void OnRequestRead(int tab_handle, int request_id, | 452 virtual void OnRequestRead(int tab_handle, int request_id, |
| 459 int bytes_to_read) { | 453 int bytes_to_read) { |
| 460 automation_client_->ReadRequest(request_id, bytes_to_read); | 454 automation_client_->ReadRequest(request_id, bytes_to_read); |
| 461 } | 455 } |
| (...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1012 EventHandlers onprivatemessage_; | 1006 EventHandlers onprivatemessage_; |
| 1013 EventHandlers onextensionready_; | 1007 EventHandlers onextensionready_; |
| 1014 | 1008 |
| 1015 // The UrlmonUrlRequest instance instantiated for downloading the base URL. | 1009 // The UrlmonUrlRequest instance instantiated for downloading the base URL. |
| 1016 scoped_refptr<CComObject<UrlmonUrlRequest> > base_url_request_; | 1010 scoped_refptr<CComObject<UrlmonUrlRequest> > base_url_request_; |
| 1017 | 1011 |
| 1018 base::Thread worker_thread_; | 1012 base::Thread worker_thread_; |
| 1019 }; | 1013 }; |
| 1020 | 1014 |
| 1021 #endif // CHROME_FRAME_CHROME_FRAME_ACTIVEX_BASE_H_ | 1015 #endif // CHROME_FRAME_CHROME_FRAME_ACTIVEX_BASE_H_ |
| OLD | NEW |