OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_ACTIVE_DOCUMENT_H_ | 5 #ifndef CHROME_FRAME_CHROME_ACTIVE_DOCUMENT_H_ |
6 #define CHROME_FRAME_CHROME_ACTIVE_DOCUMENT_H_ | 6 #define CHROME_FRAME_CHROME_ACTIVE_DOCUMENT_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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 OnEncodingChange) | 273 OnEncodingChange) |
274 | 274 |
275 EXEC_COMMAND_HANDLER_NO_ARGS(&CGID_ShellDocView, DOCHOST_DISPLAY_PRIVACY, | 275 EXEC_COMMAND_HANDLER_NO_ARGS(&CGID_ShellDocView, DOCHOST_DISPLAY_PRIVACY, |
276 OnDisplayPrivacyInfo) | 276 OnDisplayPrivacyInfo) |
277 EXEC_COMMAND_HANDLER(NULL, OLECMDID_OPTICAL_GETZOOMRANGE, OnGetZoomRange) | 277 EXEC_COMMAND_HANDLER(NULL, OLECMDID_OPTICAL_GETZOOMRANGE, OnGetZoomRange) |
278 EXEC_COMMAND_HANDLER(NULL, OLECMDID_OPTICAL_ZOOM, OnSetZoomRange) | 278 EXEC_COMMAND_HANDLER(NULL, OLECMDID_OPTICAL_ZOOM, OnSetZoomRange) |
279 EXEC_COMMAND_HANDLER(NULL, OLECMDID_ONUNLOAD, OnUnload) | 279 EXEC_COMMAND_HANDLER(NULL, OLECMDID_ONUNLOAD, OnUnload) |
280 END_EXEC_COMMAND_MAP() | 280 END_EXEC_COMMAND_MAP() |
281 | 281 |
282 // IPCs from automation server. | 282 // IPCs from automation server. |
283 virtual void OnNavigationStateChanged(int tab_handle, int flags, | 283 virtual void OnNavigationStateChanged( |
284 const IPC::NavigationInfo& nav_info); | 284 int flags, const NavigationInfo& nav_info); |
285 virtual void OnUpdateTargetUrl(int tab_handle, | 285 virtual void OnUpdateTargetUrl(const std::wstring& new_target_url); |
286 const std::wstring& new_target_url); | 286 virtual void OnAcceleratorPressed(const MSG& accel_message); |
287 virtual void OnAcceleratorPressed(int tab_handle, const MSG& accel_message); | 287 virtual void OnTabbedOut(bool reverse); |
288 virtual void OnTabbedOut(int tab_handle, bool reverse); | 288 virtual void OnDidNavigate(const NavigationInfo& nav_info); |
289 virtual void OnDidNavigate(int tab_handle, | 289 virtual void OnCloseTab(); |
290 const IPC::NavigationInfo& nav_info); | |
291 virtual void OnCloseTab(int tab_handle); | |
292 // Override DoVerb | 290 // Override DoVerb |
293 STDMETHOD(DoVerb)(LONG verb, | 291 STDMETHOD(DoVerb)(LONG verb, |
294 LPMSG msg, | 292 LPMSG msg, |
295 IOleClientSite* active_site, | 293 IOleClientSite* active_site, |
296 LONG index, | 294 LONG index, |
297 HWND parent_window, | 295 HWND parent_window, |
298 LPCRECT pos); | 296 LPCRECT pos); |
299 | 297 |
300 // Override IOleInPlaceActiveObjectImpl::OnDocWindowActivate | 298 // Override IOleInPlaceActiveObjectImpl::OnDocWindowActivate |
301 STDMETHOD(OnDocWindowActivate)(BOOL activate); | 299 STDMETHOD(OnDocWindowActivate)(BOOL activate); |
302 STDMETHOD(TranslateAccelerator)(MSG* msg); | 300 STDMETHOD(TranslateAccelerator)(MSG* msg); |
303 | 301 |
304 // IPersistMoniker methods | 302 // IPersistMoniker methodsch |
305 STDMETHOD(GetClassID)(CLSID* class_id); | 303 STDMETHOD(GetClassID)(CLSID* class_id); |
306 STDMETHOD(IsDirty)(); | 304 STDMETHOD(IsDirty)(); |
307 STDMETHOD(GetCurMoniker)(IMoniker** moniker_name); | 305 STDMETHOD(GetCurMoniker)(IMoniker** moniker_name); |
308 STDMETHOD(Load)(BOOL fully_avalable, | 306 STDMETHOD(Load)(BOOL fully_avalable, |
309 IMoniker* moniker_name, | 307 IMoniker* moniker_name, |
310 LPBC bind_context, | 308 LPBC bind_context, |
311 DWORD mode); | 309 DWORD mode); |
312 STDMETHOD(Save)(IMoniker* moniker_name, | 310 STDMETHOD(Save)(IMoniker* moniker_name, |
313 LPBC bind_context, | 311 LPBC bind_context, |
314 BOOL remember); | 312 BOOL remember); |
(...skipping 22 matching lines...) Expand all Loading... |
337 // IHTMLPrivateWindow methods | 335 // IHTMLPrivateWindow methods |
338 STDMETHOD(GetAddressBarUrl)(BSTR* url); | 336 STDMETHOD(GetAddressBarUrl)(BSTR* url); |
339 | 337 |
340 // ChromeFrameActivexBase overrides | 338 // ChromeFrameActivexBase overrides |
341 HRESULT IOleObject_SetClientSite(IOleClientSite* client_site); | 339 HRESULT IOleObject_SetClientSite(IOleClientSite* client_site); |
342 | 340 |
343 HRESULT ActiveXDocActivate(LONG verb); | 341 HRESULT ActiveXDocActivate(LONG verb); |
344 | 342 |
345 // Callbacks from ChromeFramePlugin<T> | 343 // Callbacks from ChromeFramePlugin<T> |
346 bool PreProcessContextMenu(HMENU menu); | 344 bool PreProcessContextMenu(HMENU menu); |
347 bool HandleContextMenuCommand(UINT cmd, | 345 bool HandleContextMenuCommand(UINT cmd, const MiniContextMenuParams& params); |
348 const IPC::MiniContextMenuParams& params); | |
349 | 346 |
350 // ChromeFramePlugin overrides. | 347 // ChromeFramePlugin overrides. |
351 virtual void OnAutomationServerReady(); | 348 virtual void OnAutomationServerReady(); |
352 | 349 |
353 // IEnumPrivacyRecords | 350 // IEnumPrivacyRecords |
354 STDMETHOD(Reset)(); | 351 STDMETHOD(Reset)(); |
355 STDMETHOD(GetSize)(ULONG* size); | 352 STDMETHOD(GetSize)(ULONG* size); |
356 STDMETHOD(GetPrivacyImpacted)(BOOL* privacy_impacted); | 353 STDMETHOD(GetPrivacyImpacted)(BOOL* privacy_impacted); |
357 STDMETHOD(Next)(BSTR* url, BSTR* policy, LONG* reserved, DWORD* flags); | 354 STDMETHOD(Next)(BSTR* url, BSTR* policy, LONG* reserved, DWORD* flags); |
358 | 355 |
359 // NavigationConstraints overrides. | 356 // NavigationConstraints overrides. |
360 bool IsSchemeAllowed(const GURL& url); | 357 bool IsSchemeAllowed(const GURL& url); |
361 | 358 |
362 // Accessor for InPlaceMenu. Returns S_OK if set, S_FALSE if NULL. | 359 // Accessor for InPlaceMenu. Returns S_OK if set, S_FALSE if NULL. |
363 HRESULT GetInPlaceFrame(IOleInPlaceFrame** in_place_frame); | 360 HRESULT GetInPlaceFrame(IOleInPlaceFrame** in_place_frame); |
364 | 361 |
365 protected: | 362 protected: |
366 // ChromeFrameActivexBase overrides | 363 // ChromeFrameActivexBase overrides |
367 virtual void OnOpenURL(int tab_handle, const GURL& url_to_open, | 364 virtual void OnOpenURL( |
368 const GURL& referrer, int open_disposition); | 365 const GURL& url_to_open, const GURL& referrer, int open_disposition); |
369 virtual void OnAttachExternalTab(int tab_handle, | 366 virtual void OnAttachExternalTab(const AttachExternalTabParams& params); |
370 const IPC::AttachExternalTabParams& params); | 367 virtual void OnGoToHistoryEntryOffset(int offset); |
371 virtual void OnGoToHistoryEntryOffset(int tab_handle, int offset); | |
372 | 368 |
373 // A helper method that updates our internal navigation state | 369 // A helper method that updates our internal navigation state |
374 // as well as IE's navigation state (viz Title and current URL). | 370 // as well as IE's navigation state (viz Title and current URL). |
375 // The navigation_flags is a TabContents::InvalidateTypes enum | 371 // The navigation_flags is a TabContents::InvalidateTypes enum |
376 void UpdateNavigationState(const IPC::NavigationInfo& nav_info); | 372 void UpdateNavigationState(const NavigationInfo& nav_info); |
377 | 373 |
378 TabProxy* GetTabProxy() const { | 374 TabProxy* GetTabProxy() const { |
379 if (automation_client_.get()) | 375 if (automation_client_.get()) |
380 return automation_client_->tab(); | 376 return automation_client_->tab(); |
381 return NULL; | 377 return NULL; |
382 } | 378 } |
383 | 379 |
384 // Exec command handlers | 380 // Exec command handlers |
385 void OnFindInPage(); | 381 void OnFindInPage(); |
386 void OnViewSource(); | 382 void OnViewSource(); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 BOOL& handled); | 435 BOOL& handled); |
440 LRESULT OnSetFocus(UINT message, WPARAM wparam, LPARAM lparam, | 436 LRESULT OnSetFocus(UINT message, WPARAM wparam, LPARAM lparam, |
441 BOOL& handled); | 437 BOOL& handled); |
442 | 438 |
443 // Sets the dimensions on the IE window. These dimensions are parsed out from | 439 // Sets the dimensions on the IE window. These dimensions are parsed out from |
444 // the information passed in from Chrome during window.open. | 440 // the information passed in from Chrome during window.open. |
445 void SetWindowDimensions(); | 441 void SetWindowDimensions(); |
446 | 442 |
447 // Returns true if the NavigationInfo object passed in represents a new | 443 // Returns true if the NavigationInfo object passed in represents a new |
448 // navigation initiated by the renderer. | 444 // navigation initiated by the renderer. |
449 bool IsNewNavigation(const IPC::NavigationInfo& new_navigation_info) const; | 445 bool IsNewNavigation(const NavigationInfo& new_navigation_info) const; |
450 | 446 |
451 protected: | 447 protected: |
452 typedef std::map<int, OLECMDF> CommandStatusMap; | 448 typedef std::map<int, OLECMDF> CommandStatusMap; |
453 | 449 |
454 IPC::NavigationInfo navigation_info_; | 450 NavigationInfo navigation_info_; |
455 bool is_doc_object_; | 451 bool is_doc_object_; |
456 | 452 |
457 // This indicates whether this is the first navigation in this | 453 // This indicates whether this is the first navigation in this |
458 // active document. It is initalize to true and it is set to false | 454 // active document. It is initalize to true and it is set to false |
459 // after we get a navigation notification from Chrome | 455 // after we get a navigation notification from Chrome |
460 bool first_navigation_; | 456 bool first_navigation_; |
461 | 457 |
462 // Our find dialog | 458 // Our find dialog |
463 CFFindDialog find_dialog_; | 459 CFFindDialog find_dialog_; |
464 | 460 |
(...skipping 19 matching lines...) Expand all Loading... |
484 UrlmonUrlRequestManager::PrivacyInfo::PrivacyRecords::iterator | 480 UrlmonUrlRequestManager::PrivacyInfo::PrivacyRecords::iterator |
485 next_privacy_record_; | 481 next_privacy_record_; |
486 | 482 |
487 // Dimensions of the window. Used only when opening popups. | 483 // Dimensions of the window. Used only when opening popups. |
488 gfx::Rect dimensions_; | 484 gfx::Rect dimensions_; |
489 public: | 485 public: |
490 OLEINPLACEFRAMEINFO frame_info_; | 486 OLEINPLACEFRAMEINFO frame_info_; |
491 }; | 487 }; |
492 | 488 |
493 #endif // CHROME_FRAME_CHROME_ACTIVE_DOCUMENT_H_ | 489 #endif // CHROME_FRAME_CHROME_ACTIVE_DOCUMENT_H_ |
OLD | NEW |