Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Side by Side Diff: content/browser/tab_contents/tab_contents.h

Issue 8498022: Have ExtensionHost use TabContents instead of RenderViewHost. Try #2. The first (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 DidStartLoading() OVERRIDE;
503 virtual void DidStopLoading() OVERRIDE;
504 virtual void DidCancelLoading() OVERRIDE;
505 virtual void DidChangeLoadProgress(double progress) OVERRIDE;
506 virtual void DocumentAvailableInMainFrame(
507 RenderViewHost* render_view_host) OVERRIDE;
508 virtual void DocumentOnLoadCompletedInMainFrame(
509 RenderViewHost* render_view_host,
510 int32 page_id) OVERRIDE;
511 virtual void RequestOpenURL(const GURL& url,
512 const GURL& referrer,
513 WindowOpenDisposition disposition,
514 int64 source_frame_id) OVERRIDE;
515 virtual void RunJavaScriptMessage(const RenderViewHost* rvh,
516 const string16& message,
517 const string16& default_prompt,
518 const GURL& frame_url,
519 const int flags,
520 IPC::Message* reply_msg,
521 bool* did_suppress_message) OVERRIDE;
522 virtual void RunBeforeUnloadConfirm(const RenderViewHost* rvh,
523 const string16& message,
524 IPC::Message* reply_msg) OVERRIDE;
525 virtual content::RendererPreferences GetRendererPrefs(
526 content::BrowserContext* browser_context) const OVERRIDE;
527 virtual WebPreferences GetWebkitPrefs() OVERRIDE;
528 virtual void OnUserGesture() OVERRIDE;
529 virtual void OnIgnoredUIEvent() OVERRIDE;
530 virtual void RendererUnresponsive(RenderViewHost* render_view_host,
531 bool is_during_unload) OVERRIDE;
532 virtual void RendererResponsive(RenderViewHost* render_view_host) OVERRIDE;
533 virtual void LoadStateChanged(const GURL& url,
534 const net::LoadStateWithParam& load_state,
535 uint64 upload_position,
536 uint64 upload_size) OVERRIDE;
537 virtual void WorkerCrashed() OVERRIDE;
538 virtual void Activate() OVERRIDE;
539 virtual void Deactivate() OVERRIDE;
540 virtual void LostCapture() OVERRIDE;
541 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event,
542 bool* is_keyboard_shortcut) OVERRIDE;
543 virtual void HandleKeyboardEvent(
544 const NativeWebKeyboardEvent& event) OVERRIDE;
545 virtual void HandleMouseUp() OVERRIDE;
546 virtual void HandleMouseActivate() OVERRIDE;
547 virtual bool OnMessageReceived(const IPC::Message& message);
548 virtual void RunFileChooser(RenderViewHost* render_view_host,
549 const ViewHostMsg_RunFileChooser_Params& params);
550 virtual void ToggleFullscreenMode(bool enter_fullscreen) OVERRIDE;
551 virtual bool IsFullscreenForCurrentTab() const OVERRIDE;
552 virtual void UpdatePreferredSize(const gfx::Size& pref_size) OVERRIDE;
553 virtual void RequestToLockMouse() OVERRIDE;
554 virtual void LostMouseLock() OVERRIDE;
555
474 protected: 556 protected:
475 friend class TabContentsObserver; 557 friend class TabContentsObserver;
476 558
477 // Add and remove observers for page navigation notifications. Adding or 559 // Add and remove observers for page navigation notifications. Adding or
478 // removing multiple times has no effect. The order in which notifications 560 // 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 561 // are sent to observers is undefined. Clients must be sure to remove the
480 // observer before they go away. 562 // observer before they go away.
481 void AddObserver(TabContentsObserver* observer); 563 void AddObserver(TabContentsObserver* observer);
482 void RemoveObserver(TabContentsObserver* observer); 564 void RemoveObserver(TabContentsObserver* observer);
483 565
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 int merge_history_length, 691 int merge_history_length,
610 int32 minimum_page_id); 692 int32 minimum_page_id);
611 693
612 // Misc non-view stuff ------------------------------------------------------- 694 // Misc non-view stuff -------------------------------------------------------
613 695
614 // Helper functions for sending notifications. 696 // Helper functions for sending notifications.
615 void NotifySwapped(); 697 void NotifySwapped();
616 void NotifyConnected(); 698 void NotifyConnected();
617 void NotifyDisconnected(); 699 void NotifyDisconnected();
618 700
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 RequestMove(const gfx::Rect& new_bounds) OVERRIDE;
648 virtual void DidStartLoading() OVERRIDE;
649 virtual void DidStopLoading() OVERRIDE;
650 virtual void DidCancelLoading() OVERRIDE;
651 virtual void DidChangeLoadProgress(double progress) OVERRIDE;
652 virtual void DocumentOnLoadCompletedInMainFrame(
653 RenderViewHost* render_view_host,
654 int32 page_id) OVERRIDE;
655 virtual void RequestOpenURL(const GURL& url,
656 const GURL& referrer,
657 WindowOpenDisposition disposition,
658 int64 source_frame_id) OVERRIDE;
659 virtual void RunJavaScriptMessage(const RenderViewHost* rvh,
660 const string16& message,
661 const string16& default_prompt,
662 const GURL& frame_url,
663 const int flags,
664 IPC::Message* reply_msg,
665 bool* did_suppress_message) OVERRIDE;
666 virtual void RunBeforeUnloadConfirm(const RenderViewHost* rvh,
667 const string16& message,
668 IPC::Message* reply_msg) OVERRIDE;
669 virtual content::RendererPreferences GetRendererPrefs(
670 content::BrowserContext* browser_context) const OVERRIDE;
671 virtual WebPreferences GetWebkitPrefs() OVERRIDE;
672 virtual void OnUserGesture() OVERRIDE;
673 virtual void OnIgnoredUIEvent() OVERRIDE;
674 virtual void RendererUnresponsive(RenderViewHost* render_view_host,
675 bool is_during_unload) OVERRIDE;
676 virtual void RendererResponsive(RenderViewHost* render_view_host) OVERRIDE;
677 virtual void LoadStateChanged(const GURL& url,
678 const net::LoadStateWithParam& load_state,
679 uint64 upload_position,
680 uint64 upload_size) OVERRIDE;
681 virtual void WorkerCrashed() OVERRIDE;
682 virtual void Activate() OVERRIDE;
683 virtual void Deactivate() OVERRIDE;
684 virtual void LostCapture() OVERRIDE;
685 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event,
686 bool* is_keyboard_shortcut) OVERRIDE;
687 virtual void HandleKeyboardEvent(
688 const NativeWebKeyboardEvent& event) OVERRIDE;
689 virtual void HandleMouseDown() OVERRIDE; 701 virtual void HandleMouseDown() OVERRIDE;
jam 2011/11/11 21:51:31 why not move this?
Matt Perry 2011/11/11 21:54:57 oops... merge fail. thanks
690 virtual void HandleMouseUp() OVERRIDE;
691 virtual void HandleMouseActivate() OVERRIDE;
692 virtual bool OnMessageReceived(const IPC::Message& message);
693 virtual void RunFileChooser(RenderViewHost* render_view_host,
694 const ViewHostMsg_RunFileChooser_Params& params);
695 virtual void ToggleFullscreenMode(bool enter_fullscreen) OVERRIDE;
696 virtual bool IsFullscreenForCurrentTab() const OVERRIDE;
697 virtual void UpdatePreferredSize(const gfx::Size& pref_size) OVERRIDE;
698 virtual void WebUISend(RenderViewHost* render_view_host, 702 virtual void WebUISend(RenderViewHost* render_view_host,
jam 2011/11/11 21:51:31 ditto
699 const GURL& source_url, 703 const GURL& source_url,
700 const std::string& name, 704 const std::string& name,
701 const base::ListValue& args) OVERRIDE; 705 const base::ListValue& args) OVERRIDE;
702 virtual void RequestToLockMouse() OVERRIDE;
703 virtual void LostMouseLock() OVERRIDE;
704
705 // RenderViewHostManager::Delegate ------------------------------------------- 706 // RenderViewHostManager::Delegate -------------------------------------------
706 707
707 virtual void BeforeUnloadFiredFromRenderManager( 708 virtual void BeforeUnloadFiredFromRenderManager(
708 bool proceed, 709 bool proceed,
709 bool* proceed_to_fire_unload); 710 bool* proceed_to_fire_unload);
710 virtual void DidStartLoadingFromRenderManager( 711 virtual void DidStartLoadingFromRenderManager(
711 RenderViewHost* render_view_host); 712 RenderViewHost* render_view_host);
712 virtual void RenderViewGoneFromRenderManager( 713 virtual void RenderViewGoneFromRenderManager(
713 RenderViewHost* render_view_host); 714 RenderViewHost* render_view_host);
714 virtual void UpdateRenderViewSizeForRenderManager(); 715 virtual void UpdateRenderViewSizeForRenderManager();
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 // (full-page plugins for now only) permissions. 868 // (full-page plugins for now only) permissions.
868 int content_restrictions_; 869 int content_restrictions_;
869 870
870 // Our view type. Default is VIEW_TYPE_TAB_CONTENTS. 871 // Our view type. Default is VIEW_TYPE_TAB_CONTENTS.
871 content::ViewType view_type_; 872 content::ViewType view_type_;
872 873
873 DISALLOW_COPY_AND_ASSIGN(TabContents); 874 DISALLOW_COPY_AND_ASSIGN(TabContents);
874 }; 875 };
875 876
876 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ 877 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_mac.mm ('k') | content/browser/tab_contents/tab_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698