summaryrefslogtreecommitdiffstats
path: root/chrome_frame/chrome_tab.idl
blob: 5f3dcbba2f7a1d09dcab0beb38123f055e8a5b1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// This file will be processed by the MIDL tool to
// produce the type library (chrome_tab.tlb) and marshalling code.

#include "olectl.h"
import "oaidl.idl";
import "ocidl.idl";

[
  object,
  uuid(FB243E4B-8AC2-4840-95F2-91B9AF9CFF10),
  dual,
  nonextensible,
  helpstring("IChromeFrame Interface"),
  pointer_default(unique)
]
interface IChromeFrame : IDispatch {
  [propget, id(1)]
  HRESULT src([out, retval] BSTR* src);
  [propput, id(1)]
  HRESULT src([in] BSTR src);

  [id(3)]
  HRESULT postMessage([in] BSTR message, [in, optional] VARIANT target);

  [id(4), propget]
  HRESULT onload([out, retval] VARIANT* onload_handler);
  [id(4), propput]
  HRESULT onload([in] VARIANT onload_handler);

  [propget, id(5)]
  HRESULT onloaderror([out, retval] VARIANT* onerror_handler);
  [propput, id(5)]
  HRESULT onloaderror([in] VARIANT onerror_handler);

  [propget, id(6)]
  HRESULT onmessage([out, retval] VARIANT* onmessage_handler);
  [propput, id(6)]
  HRESULT onmessage([in] VARIANT onmessage_handler);

  [propget, id(DISPID_READYSTATE)]
  HRESULT readyState([out, retval] long* ready_state);

  [id(7)]
  HRESULT addEventListener([in] BSTR event_type, [in] IDispatch* listener,
                           [in, optional] VARIANT use_capture);

  [id(8)]
  HRESULT removeEventListener([in] BSTR event_type, [in] IDispatch* listener,
                              [in, optional] VARIANT use_capture);

  [propget, id(9)]
  HRESULT version([out, retval] BSTR* version);

  [id(10), hidden]
  // This method is available only when the control is in privileged mode.
  HRESULT postPrivateMessage([in] BSTR message,
                             [in] BSTR origin,
                             [in] BSTR target);

  [propget, id(11)]
  HRESULT useChromeNetwork([out, retval] VARIANT_BOOL* pVal);
  [propput, id(11)]
  HRESULT useChromeNetwork([in] VARIANT_BOOL newVal);

  [id(12), hidden]
  // This method is available only when the control is in privileged mode.
  HRESULT installExtension([in] BSTR crx_path);

  [id(13), hidden]
  // This method is available only when the control is in privileged mode.
  HRESULT loadExtension([in] BSTR extension_path);

  [id(14), hidden]
  // This method is available only when the control is in privileged mode.
  HRESULT getEnabledExtensions();

  [id(15)]
  // This method bootstraps the BHO if it is not already loaded.
  HRESULT registerBhoIfNeeded();
};

[
  uuid(851bedec-4b2c-4959-abc0-a53403117257)
]
// Internal implementation interface. Not intended as an API. May change
// frequently, don't treat this as frozen.
interface IChromeFrameInternal : IUnknown {
  // This method is available only when the control is in privileged mode.
  HRESULT getSessionId([out, retval] int* session_id);
};

[
  object,
  uuid(8AD52429-3CE0-4883-BC69-2DFA055D20D4),
  oleautomation,
  nonextensible,
  hidden,
]
interface IChromeFramePrivileged : IUnknown {
  // If the host returns false for wants_privileged, the control
  // won't enable privileged mode.
  HRESULT GetWantsPrivileged([out] boolean *wants_privileged);
  // Extra arguments to supply to the Chrome instance.  Returns S_FALSE when
  // no extra arguments are needed.  Always sets the output string to non-NULL.
  HRESULT GetChromeExtraArguments([out] BSTR *args);
  // The profile name we want to use.
  HRESULT GetChromeProfileName([out] BSTR *profile_name);
  // The comma-separated list of extension API functions you wish to automate.
  // Return S_FALSE to leave the default, which is to not automate any 
  // functions.
  HRESULT GetExtensionApisToAutomate([out] BSTR *extension_apis);
  // Called when an automation version mismatch occurs. Returns S_OK if
  // a dialog should be showed to the user by this CF instance, S_FALSE if
  // not.
  HRESULT ShouldShowVersionMismatchDialog();
};

// Expose this service to the ChromeFrame control to trigger privileged
// mode. If the control is in privileged mode, it will forward messages
// to the onmessage handler irrespective of origin.
cpp_quote("#define SID_ChromeFramePrivileged __uuidof(IChromeFramePrivileged)")

typedef enum {
  CF_EVENT_DISPID_ONLOAD = 1,
  CF_EVENT_DISPID_ONLOADERROR,
  CF_EVENT_DISPID_ONMESSAGE,
  CF_EVENT_DISPID_ONPRIVATEMESSAGE,
  CF_EVENT_DISPID_ONEXTENSIONREADY,
  CF_EVENT_DISPID_ONGETENABLEDEXTENSIONSCOMPLETE,
  CF_EVENT_DISPID_ONCHANNELERROR,
  CF_EVENT_DISPID_ONCLOSE,
  CF_EVENT_DISPID_ONREADYSTATECHANGED = DISPID_READYSTATECHANGE,
} ChromeFrameEventDispId;

[
  uuid(6F2664E1-FF6E-488A-BCD1-F4CA6001DFCC),
  version(1.0),
  helpstring("ChromeTab 1.0 Type Library")
]
library ChromeTabLib {
  importlib("stdole2.tlb");

  [uuid(388B5D64-CE67-415b-9B0F-745C56E868E7)]
  dispinterface DIChromeFrameEvents {
   properties:
    // None.

   methods:
    [id(CF_EVENT_DISPID_ONLOAD)]
    void onload();
    
    [id(CF_EVENT_DISPID_ONLOADERROR)]
    void onloaderror();
    
    [id(CF_EVENT_DISPID_ONMESSAGE)]
    void onmessage([in] IDispatch* event);
    
    [id(CF_EVENT_DISPID_ONREADYSTATECHANGED)]
    void onreadystatechanged();
    
    [id(CF_EVENT_DISPID_ONPRIVATEMESSAGE)]
    // This event is only fired when the control is in privileged mode.
    void onprivatemessage([in] IDispatch* event, [in] BSTR target);

    [id(CF_EVENT_DISPID_ONEXTENSIONREADY)]
    // This event is only fired when the control is in privileged mode.
    // response is one of AutomationMsg_ExtensionResponseValues.
    void onextensionready([in] BSTR path, [in] long response);

    [id(CF_EVENT_DISPID_ONGETENABLEDEXTENSIONSCOMPLETE)]
    // This event is only fired when the control is in privileged mode.
    // extension_paths is an array of BSTRs of the base directories of
    // enabled extensions.
    void ongetenabledextensionscomplete([in] SAFEARRAY(BSTR) extension_paths);

    [id(CF_EVENT_DISPID_ONCHANNELERROR)]
    // This event is fired when there is an error in communication channel with
    // Chrome and Automation must be reconnected to continue.
    void onchannelerror();

    [id(CF_EVENT_DISPID_ONCLOSE)]
    // This event is fired when the script inside the page wants to close it.
    // This is just a notification, there is no way to prevent the script from
    // closing.
    void onclose();
  };

  [uuid(BB1176EE-20DD-41DC-9D1E-AC1335C7BBB0)]
  coclass HtmlFilter {
    [default] interface IUnknown;
  };

  [uuid(9875BFAF-B04D-445E-8A69-BE36838CDE3E)]
  coclass ChromeProtocol {
    [default] interface IUnknown;
  };

  [uuid(3E1D0E7F-F5E3-44CC-AA6A-C0A637619AB8), control]
  coclass ChromeActiveDocument {
    [default] interface IChromeFrame;
  };

  [uuid(E0A900DF-9611-4446-86BD-4B1D47E7DB2A), control]
  coclass ChromeFrame {
    [default] interface IChromeFrame;
    [default, source] dispinterface DIChromeFrameEvents;
  };

  [uuid(ECB3C477-1A0A-44bd-BB57-78F9EFE34FA7)]
  coclass ChromeFrameBHO {
    [default] interface IUnknown;
  };
};