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
3 // found in the LICENSE file.
5 // This file will be processed by the MIDL tool to
6 // produce the type library (chrome_tab.tlb) and marshalling code.
14 uuid(FB243E4B-8AC2-4840-95F2-91B9AF9CFF10),
17 helpstring("IChromeFrame Interface"),
18 pointer_default(unique)
20 interface IChromeFrame : IDispatch {
22 HRESULT src([out, retval] BSTR* src);
24 HRESULT src([in] BSTR src);
27 HRESULT postMessage([in] BSTR message, [in, optional] VARIANT target);
30 HRESULT onload([out, retval] VARIANT* onload_handler);
32 HRESULT onload([in] VARIANT onload_handler);
35 HRESULT onloaderror([out, retval] VARIANT* onerror_handler);
37 HRESULT onloaderror([in] VARIANT onerror_handler);
40 HRESULT onmessage([out, retval] VARIANT* onmessage_handler);
42 HRESULT onmessage([in] VARIANT onmessage_handler);
44 [propget, id(DISPID_READYSTATE)]
45 HRESULT readyState([out, retval] long* ready_state);
48 HRESULT addEventListener([in] BSTR event_type, [in] IDispatch* listener,
49 [in, optional] VARIANT use_capture);
52 HRESULT removeEventListener([in] BSTR event_type, [in] IDispatch* listener,
53 [in, optional] VARIANT use_capture);
56 HRESULT version([out, retval] BSTR* version);
59 // This method is available only when the control is in privileged mode.
60 HRESULT postPrivateMessage([in] BSTR message,
65 HRESULT useChromeNetwork([out, retval] VARIANT_BOOL* pVal);
67 HRESULT useChromeNetwork([in] VARIANT_BOOL newVal);
70 // Deprecated. Returns E_NOTIMPL.
71 HRESULT installExtension([in] BSTR crx_path);
74 // Deprecated. Returns E_NOTIMPL.
75 HRESULT loadExtension([in] BSTR extension_path);
78 // Deprecated. Returns E_NOTIMPL.
79 HRESULT getEnabledExtensions();
82 // This method bootstraps the BHO if it is not already loaded.
83 HRESULT registerBhoIfNeeded();
88 uuid(E98FDFD9-312B-444a-A640-8E88F3CC08B8),
93 // Internal implementation interface. Not intended as an API. May change
94 // frequently, don't treat this as frozen.
95 interface IChromeFramePrivileged : IUnknown {
96 // If the host returns false for wants_privileged, the control
97 // won't enable privileged mode.
98 HRESULT GetWantsPrivileged([out] boolean *wants_privileged);
99 // The profile name we want to use.
100 HRESULT GetChromeProfileName([out] BSTR *profile_name);
101 // Called when an automation version mismatch occurs. Returns S_OK if
102 // a dialog should be showed to the user by this CF instance, S_FALSE if
104 HRESULT ShouldShowVersionMismatchDialog();
105 // Allows the host to return the navigation url during the creation of the
106 // ChromeFrameActiveX instance.
107 HRESULT GetNavigationUrl([out] BSTR* url);
110 // Expose this service to the ChromeFrame control to trigger privileged
111 // mode. If the control is in privileged mode, it will forward messages
112 // to the onmessage handler irrespective of origin.
113 cpp_quote("#define SID_ChromeFramePrivileged __uuidof(IChromeFramePrivileged)")
116 CF_EVENT_DISPID_ONLOAD = 1,
117 CF_EVENT_DISPID_ONLOADERROR,
118 CF_EVENT_DISPID_ONMESSAGE,
119 CF_EVENT_DISPID_ONPRIVATEMESSAGE,
120 CF_EVENT_DISPID_ONCHANNELERROR,
121 CF_EVENT_DISPID_ONCLOSE,
122 CF_EVENT_DISPID_ONREADYSTATECHANGED = DISPID_READYSTATECHANGE,
123 } ChromeFrameEventDispId;
126 uuid(6F2664E1-FF6E-488A-BCD1-F4CA6001DFCC),
128 helpstring("ChromeTab 1.0 Type Library")
130 library ChromeTabLib {
131 importlib("stdole2.tlb");
133 [uuid(388B5D64-CE67-415b-9B0F-745C56E868E7)]
134 dispinterface DIChromeFrameEvents {
139 [id(CF_EVENT_DISPID_ONLOAD)]
142 [id(CF_EVENT_DISPID_ONLOADERROR)]
145 [id(CF_EVENT_DISPID_ONMESSAGE)]
146 void onmessage([in] IDispatch* event);
148 [id(CF_EVENT_DISPID_ONREADYSTATECHANGED)]
149 void onreadystatechanged();
151 [id(CF_EVENT_DISPID_ONPRIVATEMESSAGE)]
152 // This event is only fired when the control is in privileged mode.
153 void onprivatemessage([in] IDispatch* event, [in] BSTR target);
155 [id(CF_EVENT_DISPID_ONCHANNELERROR)]
156 // This event is fired when there is an error in communication channel with
157 // Chrome and Automation must be reconnected to continue.
158 void onchannelerror();
160 [id(CF_EVENT_DISPID_ONCLOSE)]
161 // This event is fired when the script inside the page wants to close it.
162 // This is just a notification, there is no way to prevent the script from
167 [uuid(BB1176EE-20DD-41DC-9D1E-AC1335C7BBB0)]
169 [default] interface IUnknown;
172 [uuid(9875BFAF-B04D-445E-8A69-BE36838CDE3E)]
173 coclass ChromeProtocol {
174 [default] interface IUnknown;
177 [uuid(3E1D0E7F-F5E3-44CC-AA6A-C0A637619AB8), control]
178 coclass ChromeActiveDocument {
179 [default] interface IChromeFrame;
182 [uuid(E0A900DF-9611-4446-86BD-4B1D47E7DB2A), control]
183 coclass ChromeFrame {
184 [default] interface IChromeFrame;
185 [default, source] dispinterface DIChromeFrameEvents;
188 [uuid(ECB3C477-1A0A-44bd-BB57-78F9EFE34FA7)]
189 coclass ChromeFrameBHO {
190 [default] interface IUnknown;