OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011 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. | |
4 | |
5 #ifndef CHROME_FRAME_CHROME_ACTIVE_DOCUMENT_H_ | |
6 #define CHROME_FRAME_CHROME_ACTIVE_DOCUMENT_H_ | |
7 | |
8 #include <atlbase.h> | |
9 #include <atlcom.h> | |
10 #include <atlctl.h> | |
11 #include <htiframe.h> | |
12 #include <mshtmcid.h> | |
13 #include <perhist.h> | |
14 | |
15 #include <map> | |
16 #include <string> | |
17 | |
18 #include "base/memory/scoped_ptr.h" | |
19 #include "base/threading/thread.h" | |
20 #include "base/win/scoped_comptr.h" | |
21 | |
22 #include "chrome_frame/chrome_frame_activex_base.h" | |
23 #include "chrome_frame/com_type_info_holder.h" | |
24 #include "chrome_frame/extra_system_apis.h" | |
25 #include "chrome_frame/find_dialog.h" | |
26 #include "chrome_frame/html_private_window_impl.h" | |
27 #include "chrome_frame/html_window_impl.h" | |
28 #include "chrome_frame/resource.h" | |
29 #include "chrome_frame/utils.h" | |
30 #include "third_party/active_doc/in_place_menu.h" | |
31 #include "third_party/active_doc/ole_document_impl.h" | |
32 | |
33 class TabProxy; | |
34 class ChromeActiveDocument; | |
35 | |
36 // A call to IOleCommandTarget::Exec on the webbrowser with this command id | |
37 // and a command group of CGID_EXPLORER causes IE to finalize the current | |
38 // travel log entry and move to a new location (pruning any forward entries | |
39 // if needed) | |
40 #define INTERNAL_CMDID_FINALIZE_TRAVEL_LOG (38) | |
41 | |
42 // To set the lock icon status call IOleCommandTarget::Exec on site with | |
43 // this command id and a command group of CGID_EXPLORER The in arg is one of | |
44 // the values: SECURELOCK_SET_UNSECURE, SECURELOCK_SET_MIXED, | |
45 // SECURELOCK_SET_SECURE128BIT etc declared in shdeprecated.h | |
46 #define INTERNAL_CMDID_SET_SSL_LOCK (37) | |
47 | |
48 // A call to IOleCommandTarget::Exec on the webbrowser with this command id | |
49 // and a command group of CGID_EXPLORER causes IE to replace the URL in the | |
50 // current travel log entry | |
51 #define INTERNAL_CMDID_REPLACE_CURRENT_TRAVEL_LOG_ENTRY_URL (40) | |
52 | |
53 // The following macro is to define the mapping of IE encoding menu item to | |
54 // corresponding available encoding name in Chrome. For each encoding | |
55 // definition, there are three fields. | |
56 // The first one is the definition name of encoding menu item in IE. | |
57 // The second one is execution id of the encoding menu item in IE, starting | |
58 // from 3609(IDM_MIMECSET__FIRST__) to 3699(IDM_MIMECSET__LAST__) end. For | |
59 // the details, please refer to mshtmcid.h. | |
60 // The last one is the available encoding name of the IE encoding menu item | |
61 // in Chrome. If the encoding menu item does not have corresponding encoding | |
62 // in Chrome, it will be "unknown". | |
63 // So far we don't support the encoding auto detect since we can not control | |
64 // the status of encoding menu, such as toggle status of encoding auto detect | |
65 // item on the encoding menu. | |
66 #define INTERNAL_IE_ENCODINGMENU_IDS(V) \ | |
67 V(INTERNAL_IE_ENCODINGMENU_ARABIC_ASMO708, 3609, "unknown") \ | |
68 V(INTERNAL_IE_ENCODINGMENU_ARABIC_DOS, 3610, "unknown") \ | |
69 V(INTERNAL_IE_ENCODINGMENU_ARABIC_ISO, 3611, "ISO-8859-6") \ | |
70 V(INTERNAL_IE_ENCODINGMENU_ARABIC_WINDOWS, 3612, "windows-1256") \ | |
71 V(INTERNAL_IE_ENCODINGMENU_BALTIC_ISO, 3614, "ISO-8859-4") \ | |
72 V(INTERNAL_IE_ENCODINGMENU_BALTIC_WINDOWS, 3615, "windows-1257") \ | |
73 V(INTERNAL_IE_ENCODINGMENU_CENTRAL_EUROPEAN_DOS, 3616, "unknown") \ | |
74 V(INTERNAL_IE_ENCODINGMENU_CENTRAL_EUROPEAN_ISO, 3617, "ISO-8859-2") \ | |
75 V(INTERNAL_IE_ENCODINGMENU_CENTRAL_EUROPEAN_WINDOWS, 3618, "windows-1250") \ | |
76 V(INTERNAL_IE_ENCODINGMENU_CHINESE_SIMP_GB18030, 3619, "gb18030") \ | |
77 V(INTERNAL_IE_ENCODINGMENU_CHINESE_SIMP_GB2312, 3620, "GBK") \ | |
78 V(INTERNAL_IE_ENCODINGMENU_CHINESE_SIMP_HZ, 3621, "unknown") \ | |
79 V(INTERNAL_IE_ENCODINGMENU_CHINESE_TRAD_BIG5, 3622, "Big5") \ | |
80 V(INTERNAL_IE_ENCODINGMENU_CYRILLIC_DOS, 3623, "unknown") \ | |
81 V(INTERNAL_IE_ENCODINGMENU_CYRILLIC_ISO, 3624, "ISO-8859-5") \ | |
82 V(INTERNAL_IE_ENCODINGMENU_CYRILLIC_KOI8R, 3625, "KOI8-R") \ | |
83 V(INTERNAL_IE_ENCODINGMENU_CYRILLIC_KOI8U, 3626, "KOI8-U") \ | |
84 V(INTERNAL_IE_ENCODINGMENU_CYRILLIC_WINDOWS, 3627, "windows-1251") \ | |
85 V(INTERNAL_IE_ENCODINGMENU_GREEK_ISO, 3628, "ISO-8859-7") \ | |
86 V(INTERNAL_IE_ENCODINGMENU_GREEK_WINDOWS, 3629, "windows-1253") \ | |
87 V(INTERNAL_IE_ENCODINGMENU_HEBREW_DOS, 3630, "unknown") \ | |
88 V(INTERNAL_IE_ENCODINGMENU_HEBREW_ISO_LOGICAL, 3631, "ISO-8859-8-I") \ | |
89 V(INTERNAL_IE_ENCODINGMENU_HEBREW_ISO_VISUAL, 3632, "ISO-8859-8") \ | |
90 V(INTERNAL_IE_ENCODINGMENU_HEBREW_WINDOWS, 3633, "windows-1255") \ | |
91 V(INTERNAL_IE_ENCODINGMENU_JAPAN_AUTOSELECT, 3634, "ISO-2022-JP") \ | |
92 V(INTERNAL_IE_ENCODINGMENU_JAPAN_EUC, 3635, "EUC-JP") \ | |
93 V(INTERNAL_IE_ENCODINGMENU_JAPAN_SHIFT_JIS, 3636, "Shift_JIS") \ | |
94 V(INTERNAL_IE_ENCODINGMENU_KOREA, 3637, "EUC-KR") \ | |
95 V(INTERNAL_IE_ENCODINGMENU_THAI, 3638, "windows-874") \ | |
96 V(INTERNAL_IE_ENCODINGMENU_TURKISH_ISO, 3639, "windows-1254") \ | |
97 V(INTERNAL_IE_ENCODINGMENU_TURKISH_WINDOWS, 3640, "windows-1254") \ | |
98 V(INTERNAL_IE_ENCODINGMENU_UTF8, 3641, "UTF-8") \ | |
99 V(INTERNAL_IE_ENCODINGMENU_USERDEFINED, 3642, "windows-1252") \ | |
100 V(INTERNAL_IE_ENCODINGMENU_VIETNAMESE, 3643, "windows-1258") \ | |
101 V(INTERNAL_IE_ENCODINGMENU_WEST_EUROPEAN_ISO8859_1, 3644, "ISO-8859-1") \ | |
102 V(INTERNAL_IE_ENCODINGMENU_WEST_EUROPEAN_WINDOWS, 3645, "windows-1252") \ | |
103 V(INTERNAL_IE_ENCODINGMENU_AUTODETECT, 3699, "unknown") | |
104 | |
105 #define DEFINE_ENCODING_ID(encoding_name, id, chrome_name) \ | |
106 const DWORD encoding_name = id; | |
107 INTERNAL_IE_ENCODINGMENU_IDS(DEFINE_ENCODING_ID) | |
108 #undef DEFINE_ENCODING_ID | |
109 extern const DWORD kIEEncodingIdArray[]; | |
110 | |
111 #ifndef SBCMDID_MIXEDZONE | |
112 // This command is sent by the frame to allow the document to return the URL | |
113 // security zone for display. | |
114 // Please refer to http://msdn.microsoft.com/en-us/library/aa770042(VS.85).aspx | |
115 // for more information. | |
116 #define SBCMDID_MIXEDZONE 39 | |
117 #endif // SBCMDID_MIXEDZONE | |
118 | |
119 // From MSDN: | |
120 // Controlling Navigation: The fact that a document can navigate on its own | |
121 // implies that it will also take care of updating the navigation history. | |
122 // In Internet Explorer 6 and later, the DocObject can indicate to the client | |
123 // site that it can navigate using CGID_DocHostCmdPriv (a privately defined | |
124 // command group GUID) and the DOCHOST_DOCCANNAVIGATE command. A pointer to | |
125 // the object that implements the IHTMLWindow2 interface is passed with the | |
126 // command in the VARIANTARG* parameter pvaIn. (Set pvaIn to NULL if the | |
127 // document cannot perform its own navigation.) | |
128 #define DOCHOST_DOCCANNAVIGATE (0) | |
129 | |
130 #define DOCHOST_DISPLAY_PRIVACY (75) | |
131 | |
132 // This macro should be defined in the public section of the class. | |
133 #define BEGIN_EXEC_COMMAND_MAP(theClass) \ | |
134 public: \ | |
135 HRESULT ProcessExecCommand(const GUID* cmd_group_guid, DWORD command_id, \ | |
136 DWORD cmd_exec_opt, VARIANT* in_args, \ | |
137 VARIANT* out_args) { \ | |
138 HRESULT hr = OLECMDERR_E_NOTSUPPORTED; \ | |
139 do { | |
140 | |
141 #define EXEC_COMMAND_HANDLER(group, id, handler) \ | |
142 if ((id == command_id) && ((group != NULL && cmd_group_guid != NULL && \ | |
143 IsEqualGUID(*reinterpret_cast<const GUID*>(group), *cmd_group_guid)) || \ | |
144 (group == NULL && cmd_group_guid == NULL))) { \ | |
145 hr = S_OK; \ | |
146 handler(cmd_group_guid, command_id, cmd_exec_opt, in_args, out_args); \ | |
147 break; \ | |
148 } | |
149 | |
150 #define EXEC_COMMAND_HANDLER_NO_ARGS(group, id, handler) \ | |
151 if ((id == command_id) && ((group != NULL && cmd_group_guid != NULL && \ | |
152 IsEqualGUID(*reinterpret_cast<const GUID*>(group), *cmd_group_guid)) || \ | |
153 (group == NULL && cmd_group_guid == NULL))) { \ | |
154 hr = S_OK; \ | |
155 handler(); \ | |
156 break; \ | |
157 } | |
158 | |
159 #define EXEC_COMMAND_HANDLER_GENERIC(group, id, code) \ | |
160 if ((id == command_id) && ((group != NULL && cmd_group_guid != NULL && \ | |
161 IsEqualGUID(*reinterpret_cast<const GUID*>(group), *cmd_group_guid)) || \ | |
162 (group == NULL && cmd_group_guid == NULL))) { \ | |
163 hr = S_OK; \ | |
164 code; \ | |
165 break; \ | |
166 } | |
167 | |
168 #define EXEC_GROUP_COMMANDS_HANDLER(group, group_commands, handler) \ | |
169 do { \ | |
170 const DWORD* commands = group_commands; \ | |
171 bool id_in_group_commands = false; \ | |
172 while (*commands) { \ | |
173 if (*commands == command_id) { \ | |
174 id_in_group_commands = true; \ | |
175 break; \ | |
176 } \ | |
177 commands++; \ | |
178 } \ | |
179 if (id_in_group_commands && ((group != NULL && cmd_group_guid != NULL && \ | |
180 IsEqualGUID(*reinterpret_cast<const GUID*>(group), \ | |
181 *cmd_group_guid)) || \ | |
182 (group == NULL && cmd_group_guid == NULL))) { \ | |
183 hr = S_OK; \ | |
184 handler(cmd_group_guid, command_id, cmd_exec_opt, in_args, out_args); \ | |
185 break; \ | |
186 } \ | |
187 } while (0); | |
188 | |
189 #define END_EXEC_COMMAND_MAP() \ | |
190 } while (0); \ | |
191 return hr; \ | |
192 } | |
193 | |
194 // ChromeActiveDocument: Implementation of the Active Document object that is | |
195 // responsible for rendering pages in Chrome. This object delegates to | |
196 // Chrome.exe (via the Chrome IPC-based automation mechanism) for the actual | |
197 // rendering | |
198 class ATL_NO_VTABLE ChromeActiveDocument | |
199 : public ChromeFrameActivexBase<ChromeActiveDocument, | |
200 CLSID_ChromeActiveDocument>, | |
201 public IOleDocumentImpl<ChromeActiveDocument>, | |
202 public IOleDocumentViewImpl<ChromeActiveDocument>, | |
203 public IPersistMoniker, | |
204 public IOleCommandTarget, | |
205 public InPlaceMenu<ChromeActiveDocument>, | |
206 public IWebBrowserEventsUrlService, | |
207 public IPersistHistory, | |
208 public IEnumPrivacyRecords, | |
209 public HTMLWindowImpl<IHTMLWindow2>, | |
210 public HTMLPrivateWindowImpl<IHTMLPrivateWindow> { | |
211 public: | |
212 typedef ChromeFrameActivexBase<ChromeActiveDocument, | |
213 CLSID_ChromeActiveDocument> BaseActiveX; | |
214 | |
215 ChromeActiveDocument(); | |
216 ~ChromeActiveDocument(); | |
217 | |
218 DECLARE_REGISTRY_RESOURCEID(IDR_CHROMEACTIVEDOCUMENT) | |
219 | |
220 BEGIN_COM_MAP(ChromeActiveDocument) | |
221 COM_INTERFACE_ENTRY(IOleDocument) | |
222 COM_INTERFACE_ENTRY(IOleDocumentView) | |
223 COM_INTERFACE_ENTRY(IPersistMoniker) | |
224 COM_INTERFACE_ENTRY(IOleCommandTarget) | |
225 COM_INTERFACE_ENTRY(IWebBrowserEventsUrlService) | |
226 COM_INTERFACE_ENTRY(IPersist) | |
227 COM_INTERFACE_ENTRY(IPersistHistory) | |
228 COM_INTERFACE_ENTRY(IHTMLFramesCollection2) | |
229 COM_INTERFACE_ENTRY(IHTMLWindow2) | |
230 COM_INTERFACE_ENTRY(IHTMLPrivateWindow) | |
231 COM_INTERFACE_ENTRY(IEnumPrivacyRecords) | |
232 COM_INTERFACE_ENTRY_CHAIN(BaseActiveX) | |
233 END_COM_MAP() | |
234 | |
235 BEGIN_MSG_MAP(ChromeActiveDocument) | |
236 MESSAGE_HANDLER(WM_FIRE_PRIVACY_CHANGE_NOTIFICATION, OnFirePrivacyChange) | |
237 COMMAND_ID_HANDLER(IDC_CHROMEFRAME_FORWARD, OnForward) | |
238 COMMAND_ID_HANDLER(IDC_CHROMEFRAME_BACK, OnBack) | |
239 MESSAGE_HANDLER(WM_SHOWWINDOW, OnShowWindow) | |
240 MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus) | |
241 CHAIN_MSG_MAP(BaseActiveX) | |
242 END_MSG_MAP() | |
243 | |
244 HRESULT FinalConstruct(); | |
245 | |
246 #define FORWARD_TAB_COMMAND(group, id, command) \ | |
247 EXEC_COMMAND_HANDLER_GENERIC(group, id, GetTabProxy() ? \ | |
248 GetTabProxy()->command() : 1) | |
249 | |
250 BEGIN_EXEC_COMMAND_MAP(ChromeActiveDocument) | |
251 EXEC_COMMAND_HANDLER_NO_ARGS(NULL, OLECMDID_FIND, OnFindInPage) | |
252 EXEC_COMMAND_HANDLER_NO_ARGS(&CGID_MSHTML, IDM_FIND, OnFindInPage) | |
253 EXEC_COMMAND_HANDLER_NO_ARGS(&CGID_MSHTML, IDM_VIEWSOURCE, OnViewSource) | |
254 FORWARD_TAB_COMMAND(NULL, OLECMDID_SELECTALL, SelectAll) | |
255 FORWARD_TAB_COMMAND(NULL, OLECMDID_CUT, Cut) | |
256 FORWARD_TAB_COMMAND(NULL, OLECMDID_COPY, Copy) | |
257 FORWARD_TAB_COMMAND(NULL, OLECMDID_PASTE, Paste) | |
258 FORWARD_TAB_COMMAND(NULL, OLECMDID_STOP, StopAsync) | |
259 EXEC_COMMAND_HANDLER(NULL, OLECMDID_REFRESH, OnRefreshPage) | |
260 EXEC_COMMAND_HANDLER(&CGID_Explorer, SBCMDID_MIXEDZONE, | |
261 OnDetermineSecurityZone) | |
262 EXEC_COMMAND_HANDLER(&CGID_MSHTML, IDM_BASELINEFONT1, SetPageFontSize) | |
263 EXEC_COMMAND_HANDLER(&CGID_MSHTML, IDM_BASELINEFONT2, SetPageFontSize) | |
264 EXEC_COMMAND_HANDLER(&CGID_MSHTML, IDM_BASELINEFONT3, SetPageFontSize) | |
265 EXEC_COMMAND_HANDLER(&CGID_MSHTML, IDM_BASELINEFONT4, SetPageFontSize) | |
266 EXEC_COMMAND_HANDLER(&CGID_MSHTML, IDM_BASELINEFONT5, SetPageFontSize) | |
267 | |
268 EXEC_GROUP_COMMANDS_HANDLER(&CGID_MSHTML, kIEEncodingIdArray, | |
269 OnEncodingChange) | |
270 | |
271 EXEC_COMMAND_HANDLER_NO_ARGS(&CGID_ShellDocView, DOCHOST_DISPLAY_PRIVACY, | |
272 OnDisplayPrivacyInfo) | |
273 EXEC_COMMAND_HANDLER(NULL, OLECMDID_OPTICAL_GETZOOMRANGE, OnGetZoomRange) | |
274 END_EXEC_COMMAND_MAP() | |
275 | |
276 // Override DoVerb | |
277 STDMETHOD(DoVerb)(LONG verb, | |
278 LPMSG msg, | |
279 IOleClientSite* active_site, | |
280 LONG index, | |
281 HWND parent_window, | |
282 LPCRECT pos); | |
283 | |
284 // Override IOleInPlaceActiveObjectImpl::OnDocWindowActivate | |
285 STDMETHOD(OnDocWindowActivate)(BOOL activate); | |
286 STDMETHOD(TranslateAccelerator)(MSG* msg); | |
287 | |
288 // IPersistMoniker methods | |
289 STDMETHOD(GetClassID)(CLSID* class_id); | |
290 STDMETHOD(IsDirty)(); | |
291 STDMETHOD(GetCurMoniker)(IMoniker** moniker_name); | |
292 STDMETHOD(Load)(BOOL fully_avalable, | |
293 IMoniker* moniker_name, | |
294 LPBC bind_context, | |
295 DWORD mode); | |
296 STDMETHOD(Save)(IMoniker* moniker_name, | |
297 LPBC bind_context, | |
298 BOOL remember); | |
299 STDMETHOD(SaveCompleted)(IMoniker* moniker_name, | |
300 LPBC bind_context); | |
301 | |
302 // IOleCommandTarget methods | |
303 STDMETHOD(QueryStatus)(const GUID* cmd_group_guid, | |
304 ULONG number_of_commands, | |
305 OLECMD commands[], | |
306 OLECMDTEXT* command_text); | |
307 STDMETHOD(Exec)(const GUID* cmd_group_guid, DWORD command_id, | |
308 DWORD cmd_exec_opt, | |
309 VARIANT* in_args, | |
310 VARIANT* out_args); | |
311 | |
312 // IPersistHistory | |
313 STDMETHOD(LoadHistory)(IStream* stream, IBindCtx* bind_context); | |
314 STDMETHOD(SaveHistory)(IStream* stream); | |
315 STDMETHOD(SetPositionCookie)(DWORD position_cookie); | |
316 STDMETHOD(GetPositionCookie)(DWORD* position_cookie); | |
317 | |
318 // IWebBrowserEventsUrlService methods | |
319 STDMETHOD(GetUrlForEvents)(BSTR* url); | |
320 | |
321 // IHTMLPrivateWindow methods | |
322 STDMETHOD(GetAddressBarUrl)(BSTR* url); | |
323 | |
324 // ChromeFrameActivexBase overrides | |
325 HRESULT IOleObject_SetClientSite(IOleClientSite* client_site); | |
326 | |
327 HRESULT ActiveXDocActivate(LONG verb); | |
328 | |
329 // Callbacks from ChromeFramePlugin<T> | |
330 bool PreProcessContextMenu(HMENU menu); | |
331 | |
332 // ChromeFramePlugin overrides. | |
333 virtual void OnAutomationServerReady(); | |
334 | |
335 // IEnumPrivacyRecords | |
336 STDMETHOD(Reset)(); | |
337 STDMETHOD(GetSize)(ULONG* size); | |
338 STDMETHOD(GetPrivacyImpacted)(BOOL* privacy_impacted); | |
339 STDMETHOD(Next)(BSTR* url, BSTR* policy, LONG* reserved, DWORD* flags); | |
340 | |
341 // NavigationConstraints overrides. | |
342 bool IsSchemeAllowed(const GURL& url); | |
343 | |
344 // Accessor for InPlaceMenu. Returns S_OK if set, S_FALSE if NULL. | |
345 HRESULT GetInPlaceFrame(IOleInPlaceFrame** in_place_frame); | |
346 | |
347 protected: | |
348 | |
349 TabProxy* GetTabProxy() const { | |
350 if (automation_client_.get()) | |
351 return automation_client_->tab(); | |
352 return NULL; | |
353 } | |
354 | |
355 // Exec command handlers | |
356 void OnFindInPage(); | |
357 void OnViewSource(); | |
358 void OnDetermineSecurityZone(const GUID* cmd_group_guid, DWORD command_id, | |
359 DWORD cmd_exec_opt, VARIANT* in_args, | |
360 VARIANT* out_args); | |
361 void OnDisplayPrivacyInfo(); | |
362 | |
363 void OnGetZoomRange(const GUID* cmd_group_guid, DWORD command_id, | |
364 DWORD cmd_exec_opt, VARIANT* in_args, VARIANT* out_args); | |
365 | |
366 // Call exec on our site's command target | |
367 HRESULT IEExec(const GUID* cmd_group_guid, DWORD command_id, | |
368 DWORD cmd_exec_opt, VARIANT* in_args, VARIANT* out_args); | |
369 | |
370 // Initiates navigation to the URL passed in. | |
371 // Returns true on success. | |
372 bool LaunchUrl(const ChromeFrameUrl& cf_url, const std::string& referrer); | |
373 | |
374 // Handler to set the page font size in Chrome. | |
375 HRESULT SetPageFontSize(const GUID* cmd_group_guid, | |
376 DWORD command_id, | |
377 DWORD cmd_exec_opt, | |
378 VARIANT* in_args, | |
379 VARIANT* out_args); | |
380 | |
381 // IOleCommandTarget handler for page refresh command | |
382 HRESULT OnRefreshPage(const GUID* cmd_group_guid, DWORD command_id, | |
383 DWORD cmd_exec_opt, VARIANT* in_args, VARIANT* out_args); | |
384 | |
385 // Handler to set the page encoding info in Chrome. | |
386 HRESULT OnEncodingChange(const GUID* cmd_group_guid, DWORD command_id, | |
387 DWORD cmd_exec_opt, VARIANT* in_args, | |
388 VARIANT* out_args); | |
389 | |
390 // Get the travel log from the client site | |
391 HRESULT GetBrowserServiceAndTravelLog(IBrowserService** browser_service, | |
392 ITravelLog** travel_log); | |
393 LRESULT OnForward(WORD notify_code, WORD id, HWND control_window, | |
394 BOOL& bHandled); | |
395 LRESULT OnBack(WORD notify_code, WORD id, HWND control_window, | |
396 BOOL& bHandled); | |
397 | |
398 LRESULT OnFirePrivacyChange(UINT message, WPARAM wparam, LPARAM lparam, | |
399 BOOL& handled); | |
400 LRESULT OnShowWindow(UINT message, WPARAM wparam, LPARAM lparam, | |
401 BOOL& handled); | |
402 LRESULT OnSetFocus(UINT message, WPARAM wparam, LPARAM lparam, | |
403 BOOL& handled); | |
404 | |
405 protected: | |
406 typedef std::map<int, OLECMDF> CommandStatusMap; | |
407 | |
408 bool is_doc_object_; | |
409 | |
410 // This indicates whether this is the first navigation in this | |
411 // active document. It is initalize to true and it is set to false | |
412 // after we get a navigation notification from Chrome | |
413 bool first_navigation_; | |
414 | |
415 // Our find dialog | |
416 CFFindDialog find_dialog_; | |
417 | |
418 // These members contain the status of the commands we support. | |
419 CommandStatusMap null_group_commands_map_; | |
420 CommandStatusMap mshtml_group_commands_map_; | |
421 CommandStatusMap explorer_group_commands_map_; | |
422 CommandStatusMap shdoc_view_group_commands_map_; | |
423 | |
424 // Set to true if the automation_client_ member is initialized from | |
425 // an existing ChromeActiveDocument instance which is going away and | |
426 // a new ChromeActiveDocument instance is taking its place. | |
427 bool is_automation_client_reused_; | |
428 | |
429 base::win::ScopedComPtr<INewWindowManager> popup_manager_; | |
430 bool popup_allowed_; | |
431 HACCEL accelerator_table_; | |
432 | |
433 // Contains privacy data retrieved from the UrlmonUrlRequestManager. This | |
434 // is used to return privacy data in response to the View->Privacy policy | |
435 // command. | |
436 UrlmonUrlRequestManager::PrivacyInfo privacy_info_; | |
437 UrlmonUrlRequestManager::PrivacyInfo::PrivacyRecords::iterator | |
438 next_privacy_record_; | |
439 | |
440 public: | |
441 OLEINPLACEFRAMEINFO frame_info_; | |
442 }; | |
443 | |
444 #endif // CHROME_FRAME_CHROME_ACTIVE_DOCUMENT_H_ | |
OLD | NEW |