OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
3 * All rights reserved. | 3 * All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 #include "third_party/npapi/include/npfunctions.h" | 47 #include "third_party/npapi/include/npfunctions.h" |
48 | 48 |
49 struct NPObject; | 49 struct NPObject; |
50 class NPBrowserProxy; | 50 class NPBrowserProxy; |
51 | 51 |
52 // COM class implementing a basic IDispatchEx interface that wraps the NPAPI | 52 // COM class implementing a basic IDispatchEx interface that wraps the NPAPI |
53 // NPObject scripting functionality. | 53 // NPObject scripting functionality. |
54 class ATL_NO_VTABLE NPObjectProxy : | 54 class ATL_NO_VTABLE NPObjectProxy : |
55 public CComObjectRootEx<CComSingleThreadModel>, | 55 public CComObjectRootEx<CComSingleThreadModel>, |
56 public CComCoClass<NPObjectProxy, &CLSID_NPObjectProxy>, | |
57 public IDispatchImpl<INPObjectProxy, &IID_INPObjectProxy, | 56 public IDispatchImpl<INPObjectProxy, &IID_INPObjectProxy, |
58 &LIBID_npapi_host_controlLib>, | 57 &LIBID_npapi_host_controlLib>, |
59 public IObjectSafetyImpl<NPObjectProxy, | 58 public IObjectSafetyImpl<NPObjectProxy, |
60 INTERFACESAFE_FOR_UNTRUSTED_CALLER> { | 59 INTERFACESAFE_FOR_UNTRUSTED_CALLER> { |
61 public: | 60 public: |
62 NPObjectProxy(); | 61 NPObjectProxy(); |
63 virtual ~NPObjectProxy(); | 62 virtual ~NPObjectProxy(); |
64 | 63 |
65 DECLARE_REGISTRY_RESOURCEID(IDR_NPOBJECTPROXY) | |
66 | |
67 BEGIN_COM_MAP(NPObjectProxy) | 64 BEGIN_COM_MAP(NPObjectProxy) |
68 COM_INTERFACE_ENTRY(INPObjectProxy) | 65 COM_INTERFACE_ENTRY(INPObjectProxy) |
69 COM_INTERFACE_ENTRY(IDispatch) | 66 COM_INTERFACE_ENTRY(IDispatch) |
70 COM_INTERFACE_ENTRY(IDispatchEx) | 67 COM_INTERFACE_ENTRY(IDispatchEx) |
71 END_COM_MAP() | 68 END_COM_MAP() |
72 | 69 |
73 STDMETHOD(SetBrowserProxy)(void* browser_proxy) { | 70 STDMETHOD(SetBrowserProxy)(void* browser_proxy) { |
74 browser_proxy_ = static_cast<NPBrowserProxy*>(browser_proxy); | 71 browser_proxy_ = static_cast<NPBrowserProxy*>(browser_proxy); |
75 return S_OK; | 72 return S_OK; |
76 } | 73 } |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 | 114 |
118 // Pointer to NPObject for which this instance is a proxy IDispatchEx. | 115 // Pointer to NPObject for which this instance is a proxy IDispatchEx. |
119 NPObject *hosted_; | 116 NPObject *hosted_; |
120 | 117 |
121 // Back-pointer to the NPAPI browser proxy. | 118 // Back-pointer to the NPAPI browser proxy. |
122 NPBrowserProxy* browser_proxy_; | 119 NPBrowserProxy* browser_proxy_; |
123 | 120 |
124 DISALLOW_COPY_AND_ASSIGN(NPObjectProxy); | 121 DISALLOW_COPY_AND_ASSIGN(NPObjectProxy); |
125 }; | 122 }; |
126 | 123 |
127 // Register this COM class with the COM module. | |
128 OBJECT_ENTRY_AUTO(__uuidof(NPObjectProxy), NPObjectProxy); | |
129 | |
130 #endif // O3D_PLUGIN_NPAPI_HOST_CONTROL_WIN_NP_OBJECT_PROXY_H_ | 124 #endif // O3D_PLUGIN_NPAPI_HOST_CONTROL_WIN_NP_OBJECT_PROXY_H_ |
OLD | NEW |