OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ | 5 #ifndef CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ |
6 #define CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ | 6 #define CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <deque> | 9 #include <deque> |
10 #include <map> | 10 #include <map> |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 | 464 |
465 // Called when the reponse to a pending mouse lock request has arrived. | 465 // Called when the reponse to a pending mouse lock request has arrived. |
466 // Returns true if |allowed| is true and the mouse has been successfully | 466 // Returns true if |allowed| is true and the mouse has been successfully |
467 // locked. | 467 // locked. |
468 bool GotResponseToLockMouseRequest(bool allowed); | 468 bool GotResponseToLockMouseRequest(bool allowed); |
469 | 469 |
470 JavaBridgeDispatcherHostManager* java_bridge_dispatcher_host_manager() const { | 470 JavaBridgeDispatcherHostManager* java_bridge_dispatcher_host_manager() const { |
471 return java_bridge_dispatcher_host_manager_.get(); | 471 return java_bridge_dispatcher_host_manager_.get(); |
472 } | 472 } |
473 | 473 |
| 474 // RenderViewHostDelegate ---------------------------------------------------- |
| 475 |
| 476 virtual RenderViewHostDelegate::View* GetViewDelegate() OVERRIDE; |
| 477 virtual RenderViewHostDelegate::RendererManagement* |
| 478 GetRendererManagementDelegate() OVERRIDE; |
| 479 virtual TabContents* GetAsTabContents() OVERRIDE; |
| 480 virtual content::ViewType GetRenderViewType() const OVERRIDE; |
| 481 virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE; |
| 482 virtual void RenderViewReady(RenderViewHost* render_view_host) OVERRIDE; |
| 483 virtual void RenderViewGone(RenderViewHost* render_view_host, |
| 484 base::TerminationStatus status, |
| 485 int error_code) OVERRIDE; |
| 486 virtual void RenderViewDeleted(RenderViewHost* render_view_host) OVERRIDE; |
| 487 virtual void DidNavigate( |
| 488 RenderViewHost* render_view_host, |
| 489 const ViewHostMsg_FrameNavigate_Params& params) OVERRIDE; |
| 490 virtual void UpdateState(RenderViewHost* render_view_host, |
| 491 int32 page_id, |
| 492 const std::string& state) OVERRIDE; |
| 493 virtual void UpdateTitle(RenderViewHost* render_view_host, |
| 494 int32 page_id, |
| 495 const string16& title, |
| 496 base::i18n::TextDirection title_direction) OVERRIDE; |
| 497 virtual void UpdateEncoding(RenderViewHost* render_view_host, |
| 498 const std::string& encoding) OVERRIDE; |
| 499 virtual void UpdateTargetURL(int32 page_id, const GURL& url) OVERRIDE; |
| 500 virtual void Close(RenderViewHost* render_view_host) OVERRIDE; |
| 501 virtual void RequestMove(const gfx::Rect& new_bounds) OVERRIDE; |
| 502 virtual void SwappedOut(RenderViewHost* render_view_host) OVERRIDE; |
| 503 virtual void DidStartLoading() OVERRIDE; |
| 504 virtual void DidStopLoading() OVERRIDE; |
| 505 virtual void DidCancelLoading() OVERRIDE; |
| 506 virtual void DidChangeLoadProgress(double progress) OVERRIDE; |
| 507 virtual void DocumentAvailableInMainFrame( |
| 508 RenderViewHost* render_view_host) OVERRIDE; |
| 509 virtual void DocumentOnLoadCompletedInMainFrame( |
| 510 RenderViewHost* render_view_host, |
| 511 int32 page_id) OVERRIDE; |
| 512 virtual void RequestOpenURL(const GURL& url, |
| 513 const GURL& referrer, |
| 514 WindowOpenDisposition disposition, |
| 515 int64 source_frame_id) OVERRIDE; |
| 516 virtual void RunJavaScriptMessage(const RenderViewHost* rvh, |
| 517 const string16& message, |
| 518 const string16& default_prompt, |
| 519 const GURL& frame_url, |
| 520 const int flags, |
| 521 IPC::Message* reply_msg, |
| 522 bool* did_suppress_message) OVERRIDE; |
| 523 virtual void RunBeforeUnloadConfirm(const RenderViewHost* rvh, |
| 524 const string16& message, |
| 525 IPC::Message* reply_msg) OVERRIDE; |
| 526 virtual content::RendererPreferences GetRendererPrefs( |
| 527 content::BrowserContext* browser_context) const OVERRIDE; |
| 528 virtual WebPreferences GetWebkitPrefs() OVERRIDE; |
| 529 virtual void OnUserGesture() OVERRIDE; |
| 530 virtual void OnIgnoredUIEvent() OVERRIDE; |
| 531 virtual void RendererUnresponsive(RenderViewHost* render_view_host, |
| 532 bool is_during_unload) OVERRIDE; |
| 533 virtual void RendererResponsive(RenderViewHost* render_view_host) OVERRIDE; |
| 534 virtual void LoadStateChanged(const GURL& url, |
| 535 const net::LoadStateWithParam& load_state, |
| 536 uint64 upload_position, |
| 537 uint64 upload_size) OVERRIDE; |
| 538 virtual void WorkerCrashed() OVERRIDE; |
| 539 virtual void Activate() OVERRIDE; |
| 540 virtual void Deactivate() OVERRIDE; |
| 541 virtual void LostCapture() OVERRIDE; |
| 542 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, |
| 543 bool* is_keyboard_shortcut) OVERRIDE; |
| 544 virtual void HandleKeyboardEvent( |
| 545 const NativeWebKeyboardEvent& event) OVERRIDE; |
| 546 virtual void HandleMouseDown() OVERRIDE; |
| 547 virtual void HandleMouseUp() OVERRIDE; |
| 548 virtual void HandleMouseActivate() OVERRIDE; |
| 549 virtual bool OnMessageReceived(const IPC::Message& message); |
| 550 virtual void RunFileChooser(RenderViewHost* render_view_host, |
| 551 const ViewHostMsg_RunFileChooser_Params& params); |
| 552 virtual void ToggleFullscreenMode(bool enter_fullscreen) OVERRIDE; |
| 553 virtual bool IsFullscreenForCurrentTab() const OVERRIDE; |
| 554 virtual void UpdatePreferredSize(const gfx::Size& pref_size) OVERRIDE; |
| 555 virtual void WebUISend(RenderViewHost* render_view_host, |
| 556 const GURL& source_url, |
| 557 const std::string& name, |
| 558 const base::ListValue& args) OVERRIDE; |
| 559 virtual void RequestToLockMouse() OVERRIDE; |
| 560 virtual void LostMouseLock() OVERRIDE; |
| 561 |
474 protected: | 562 protected: |
475 friend class TabContentsObserver; | 563 friend class TabContentsObserver; |
476 | 564 |
477 // Add and remove observers for page navigation notifications. Adding or | 565 // Add and remove observers for page navigation notifications. Adding or |
478 // removing multiple times has no effect. The order in which notifications | 566 // removing multiple times has no effect. The order in which notifications |
479 // are sent to observers is undefined. Clients must be sure to remove the | 567 // are sent to observers is undefined. Clients must be sure to remove the |
480 // observer before they go away. | 568 // observer before they go away. |
481 void AddObserver(TabContentsObserver* observer); | 569 void AddObserver(TabContentsObserver* observer); |
482 void RemoveObserver(TabContentsObserver* observer); | 570 void RemoveObserver(TabContentsObserver* observer); |
483 | 571 |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
609 int merge_history_length, | 697 int merge_history_length, |
610 int32 minimum_page_id); | 698 int32 minimum_page_id); |
611 | 699 |
612 // Misc non-view stuff ------------------------------------------------------- | 700 // Misc non-view stuff ------------------------------------------------------- |
613 | 701 |
614 // Helper functions for sending notifications. | 702 // Helper functions for sending notifications. |
615 void NotifySwapped(); | 703 void NotifySwapped(); |
616 void NotifyConnected(); | 704 void NotifyConnected(); |
617 void NotifyDisconnected(); | 705 void NotifyDisconnected(); |
618 | 706 |
619 // RenderViewHostDelegate ---------------------------------------------------- | |
620 | |
621 // RenderViewHostDelegate implementation. | |
622 virtual RenderViewHostDelegate::View* GetViewDelegate() OVERRIDE; | |
623 virtual RenderViewHostDelegate::RendererManagement* | |
624 GetRendererManagementDelegate() OVERRIDE; | |
625 virtual TabContents* GetAsTabContents() OVERRIDE; | |
626 virtual content::ViewType GetRenderViewType() const OVERRIDE; | |
627 virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE; | |
628 virtual void RenderViewReady(RenderViewHost* render_view_host) OVERRIDE; | |
629 virtual void RenderViewGone(RenderViewHost* render_view_host, | |
630 base::TerminationStatus status, | |
631 int error_code) OVERRIDE; | |
632 virtual void RenderViewDeleted(RenderViewHost* render_view_host) OVERRIDE; | |
633 virtual void DidNavigate( | |
634 RenderViewHost* render_view_host, | |
635 const ViewHostMsg_FrameNavigate_Params& params) OVERRIDE; | |
636 virtual void UpdateState(RenderViewHost* render_view_host, | |
637 int32 page_id, | |
638 const std::string& state) OVERRIDE; | |
639 virtual void UpdateTitle(RenderViewHost* render_view_host, | |
640 int32 page_id, | |
641 const string16& title, | |
642 base::i18n::TextDirection title_direction) OVERRIDE; | |
643 virtual void UpdateEncoding(RenderViewHost* render_view_host, | |
644 const std::string& encoding) OVERRIDE; | |
645 virtual void UpdateTargetURL(int32 page_id, const GURL& url) OVERRIDE; | |
646 virtual void Close(RenderViewHost* render_view_host) OVERRIDE; | |
647 virtual void SwappedOut(RenderViewHost* render_view_host) OVERRIDE; | |
648 virtual void RequestMove(const gfx::Rect& new_bounds) OVERRIDE; | |
649 virtual void DidStartLoading() OVERRIDE; | |
650 virtual void DidStopLoading() OVERRIDE; | |
651 virtual void DidCancelLoading() OVERRIDE; | |
652 virtual void DidChangeLoadProgress(double progress) OVERRIDE; | |
653 virtual void DocumentOnLoadCompletedInMainFrame( | |
654 RenderViewHost* render_view_host, | |
655 int32 page_id) OVERRIDE; | |
656 virtual void RequestOpenURL(const GURL& url, | |
657 const GURL& referrer, | |
658 WindowOpenDisposition disposition, | |
659 int64 source_frame_id) OVERRIDE; | |
660 virtual void RunJavaScriptMessage(const RenderViewHost* rvh, | |
661 const string16& message, | |
662 const string16& default_prompt, | |
663 const GURL& frame_url, | |
664 const int flags, | |
665 IPC::Message* reply_msg, | |
666 bool* did_suppress_message) OVERRIDE; | |
667 virtual void RunBeforeUnloadConfirm(const RenderViewHost* rvh, | |
668 const string16& message, | |
669 IPC::Message* reply_msg) OVERRIDE; | |
670 virtual content::RendererPreferences GetRendererPrefs( | |
671 content::BrowserContext* browser_context) const OVERRIDE; | |
672 virtual WebPreferences GetWebkitPrefs() OVERRIDE; | |
673 virtual void OnUserGesture() OVERRIDE; | |
674 virtual void OnIgnoredUIEvent() OVERRIDE; | |
675 virtual void RendererUnresponsive(RenderViewHost* render_view_host, | |
676 bool is_during_unload) OVERRIDE; | |
677 virtual void RendererResponsive(RenderViewHost* render_view_host) OVERRIDE; | |
678 virtual void LoadStateChanged(const GURL& url, | |
679 const net::LoadStateWithParam& load_state, | |
680 uint64 upload_position, | |
681 uint64 upload_size) OVERRIDE; | |
682 virtual void WorkerCrashed() OVERRIDE; | |
683 virtual void Activate() OVERRIDE; | |
684 virtual void Deactivate() OVERRIDE; | |
685 virtual void LostCapture() OVERRIDE; | |
686 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, | |
687 bool* is_keyboard_shortcut) OVERRIDE; | |
688 virtual void HandleKeyboardEvent( | |
689 const NativeWebKeyboardEvent& event) OVERRIDE; | |
690 virtual void HandleMouseDown() OVERRIDE; | |
691 virtual void HandleMouseUp() OVERRIDE; | |
692 virtual void HandleMouseActivate() OVERRIDE; | |
693 virtual bool OnMessageReceived(const IPC::Message& message); | |
694 virtual void RunFileChooser(RenderViewHost* render_view_host, | |
695 const ViewHostMsg_RunFileChooser_Params& params); | |
696 virtual void ToggleFullscreenMode(bool enter_fullscreen) OVERRIDE; | |
697 virtual bool IsFullscreenForCurrentTab() const OVERRIDE; | |
698 virtual void UpdatePreferredSize(const gfx::Size& pref_size) OVERRIDE; | |
699 virtual void WebUISend(RenderViewHost* render_view_host, | |
700 const GURL& source_url, | |
701 const std::string& name, | |
702 const base::ListValue& args) OVERRIDE; | |
703 virtual void RequestToLockMouse() OVERRIDE; | |
704 virtual void LostMouseLock() OVERRIDE; | |
705 | |
706 // RenderViewHostManager::Delegate ------------------------------------------- | 707 // RenderViewHostManager::Delegate ------------------------------------------- |
707 | 708 |
708 virtual void BeforeUnloadFiredFromRenderManager( | 709 virtual void BeforeUnloadFiredFromRenderManager( |
709 bool proceed, | 710 bool proceed, |
710 bool* proceed_to_fire_unload); | 711 bool* proceed_to_fire_unload); |
711 virtual void DidStartLoadingFromRenderManager( | 712 virtual void DidStartLoadingFromRenderManager( |
712 RenderViewHost* render_view_host); | 713 RenderViewHost* render_view_host); |
713 virtual void RenderViewGoneFromRenderManager( | 714 virtual void RenderViewGoneFromRenderManager( |
714 RenderViewHost* render_view_host); | 715 RenderViewHost* render_view_host); |
715 virtual void UpdateRenderViewSizeForRenderManager(); | 716 virtual void UpdateRenderViewSizeForRenderManager(); |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
868 // (full-page plugins for now only) permissions. | 869 // (full-page plugins for now only) permissions. |
869 int content_restrictions_; | 870 int content_restrictions_; |
870 | 871 |
871 // Our view type. Default is VIEW_TYPE_TAB_CONTENTS. | 872 // Our view type. Default is VIEW_TYPE_TAB_CONTENTS. |
872 content::ViewType view_type_; | 873 content::ViewType view_type_; |
873 | 874 |
874 DISALLOW_COPY_AND_ASSIGN(TabContents); | 875 DISALLOW_COPY_AND_ASSIGN(TabContents); |
875 }; | 876 }; |
876 | 877 |
877 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ | 878 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ |
OLD | NEW |