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> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/string16.h" | 16 #include "base/string16.h" |
17 #include "chrome/browser/prefs/pref_change_registrar.h" | |
18 #include "chrome/browser/ui/app_modal_dialogs/js_modal_dialog.h" | 17 #include "chrome/browser/ui/app_modal_dialogs/js_modal_dialog.h" |
19 #include "content/browser/renderer_host/render_view_host_delegate.h" | 18 #include "content/browser/renderer_host/render_view_host_delegate.h" |
20 #include "content/browser/tab_contents/constrained_window.h" | 19 #include "content/browser/tab_contents/constrained_window.h" |
21 #include "content/browser/tab_contents/navigation_controller.h" | 20 #include "content/browser/tab_contents/navigation_controller.h" |
22 #include "content/browser/tab_contents/navigation_entry.h" | 21 #include "content/browser/tab_contents/navigation_entry.h" |
23 #include "content/browser/tab_contents/page_navigator.h" | 22 #include "content/browser/tab_contents/page_navigator.h" |
24 #include "content/browser/tab_contents/render_view_host_manager.h" | 23 #include "content/browser/tab_contents/render_view_host_manager.h" |
25 #include "content/browser/tab_contents/tab_contents_observer.h" | 24 #include "content/browser/tab_contents/tab_contents_observer.h" |
26 #include "content/browser/webui/web_ui.h" | 25 #include "content/browser/webui/web_ui.h" |
27 #include "content/common/notification_registrar.h" | 26 #include "content/common/notification_registrar.h" |
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 const NavigationController::LoadCommittedDetails& details, | 593 const NavigationController::LoadCommittedDetails& details, |
595 const ViewHostMsg_FrameNavigate_Params& params); | 594 const ViewHostMsg_FrameNavigate_Params& params); |
596 void DidNavigateAnyFramePostCommit( | 595 void DidNavigateAnyFramePostCommit( |
597 RenderViewHost* render_view_host, | 596 RenderViewHost* render_view_host, |
598 const NavigationController::LoadCommittedDetails& details, | 597 const NavigationController::LoadCommittedDetails& details, |
599 const ViewHostMsg_FrameNavigate_Params& params); | 598 const ViewHostMsg_FrameNavigate_Params& params); |
600 | 599 |
601 // Closes all constrained windows. | 600 // Closes all constrained windows. |
602 void CloseConstrainedWindows(); | 601 void CloseConstrainedWindows(); |
603 | 602 |
604 // Send the alternate error page URL to the renderer. This method is virtual | |
605 // so special html pages can override this (e.g., the new tab page). | |
606 virtual void UpdateAlternateErrorPageURL(); | |
607 | |
608 // Send webkit specific settings to the renderer. | |
609 void UpdateWebPreferences(); | |
610 | |
611 // Instruct the renderer to update the zoom level. | |
612 void UpdateZoomLevel(); | |
613 | |
614 // If our controller was restored and the page id is > than the site | 603 // If our controller was restored and the page id is > than the site |
615 // instance's page id, the site instances page id is updated as well as the | 604 // instance's page id, the site instances page id is updated as well as the |
616 // renderers max page id. | 605 // renderers max page id. |
617 void UpdateMaxPageIDIfNecessary(SiteInstance* site_instance, | 606 void UpdateMaxPageIDIfNecessary(SiteInstance* site_instance, |
618 RenderViewHost* rvh); | 607 RenderViewHost* rvh); |
619 | 608 |
620 // Saves the given title to the navigation entry and does associated work. It | 609 // Saves the given title to the navigation entry and does associated work. It |
621 // will update history and the view for the new title, and also synthesize | 610 // will update history and the view for the new title, and also synthesize |
622 // titles for file URLs that have none (so we require that the URL of the | 611 // titles for file URLs that have none (so we require that the URL of the |
623 // entry already be set). | 612 // entry already be set). |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 virtual void RunJavaScriptMessage(const RenderViewHost* rvh, | 672 virtual void RunJavaScriptMessage(const RenderViewHost* rvh, |
684 const std::wstring& message, | 673 const std::wstring& message, |
685 const std::wstring& default_prompt, | 674 const std::wstring& default_prompt, |
686 const GURL& frame_url, | 675 const GURL& frame_url, |
687 const int flags, | 676 const int flags, |
688 IPC::Message* reply_msg, | 677 IPC::Message* reply_msg, |
689 bool* did_suppress_message); | 678 bool* did_suppress_message); |
690 virtual void RunBeforeUnloadConfirm(const RenderViewHost* rvh, | 679 virtual void RunBeforeUnloadConfirm(const RenderViewHost* rvh, |
691 const std::wstring& message, | 680 const std::wstring& message, |
692 IPC::Message* reply_msg); | 681 IPC::Message* reply_msg); |
693 virtual GURL GetAlternateErrorPageURL() const; | |
694 virtual RendererPreferences GetRendererPrefs(Profile* profile) const; | 682 virtual RendererPreferences GetRendererPrefs(Profile* profile) const; |
695 virtual WebPreferences GetWebkitPrefs(); | 683 virtual WebPreferences GetWebkitPrefs(); |
696 virtual void OnUserGesture(); | 684 virtual void OnUserGesture(); |
697 virtual void OnIgnoredUIEvent(); | 685 virtual void OnIgnoredUIEvent(); |
698 virtual void OnCrossSiteResponse(int new_render_process_host_id, | 686 virtual void OnCrossSiteResponse(int new_render_process_host_id, |
699 int new_request_id); | 687 int new_request_id); |
700 virtual void RendererUnresponsive(RenderViewHost* render_view_host, | 688 virtual void RendererUnresponsive(RenderViewHost* render_view_host, |
701 bool is_during_unload); | 689 bool is_during_unload); |
702 virtual void RendererResponsive(RenderViewHost* render_view_host); | 690 virtual void RendererResponsive(RenderViewHost* render_view_host); |
703 virtual void LoadStateChanged(const GURL& url, net::LoadState load_state, | 691 virtual void LoadStateChanged(const GURL& url, net::LoadState load_state, |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 | 752 |
765 // Manages creation and swapping of render views. | 753 // Manages creation and swapping of render views. |
766 RenderViewHostManager render_manager_; | 754 RenderViewHostManager render_manager_; |
767 | 755 |
768 // Stores random bits of data for others to associate with this object. | 756 // Stores random bits of data for others to associate with this object. |
769 PropertyBag property_bag_; | 757 PropertyBag property_bag_; |
770 | 758 |
771 // Registers and unregisters us for notifications. | 759 // Registers and unregisters us for notifications. |
772 NotificationRegistrar registrar_; | 760 NotificationRegistrar registrar_; |
773 | 761 |
774 // Registers and unregisters for pref notifications. | |
775 PrefChangeRegistrar pref_change_registrar_; | |
776 | |
777 // Handles drag and drop event forwarding to extensions. | 762 // Handles drag and drop event forwarding to extensions. |
778 BookmarkDrag* bookmark_drag_; | 763 BookmarkDrag* bookmark_drag_; |
779 | 764 |
780 // Data for loading state ---------------------------------------------------- | 765 // Data for loading state ---------------------------------------------------- |
781 | 766 |
782 // Indicates whether we're currently loading a resource. | 767 // Indicates whether we're currently loading a resource. |
783 bool is_loading_; | 768 bool is_loading_; |
784 | 769 |
785 // Indicates if the tab is considered crashed. | 770 // Indicates if the tab is considered crashed. |
786 base::TerminationStatus crashed_status_; | 771 base::TerminationStatus crashed_status_; |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
882 ObserverList<TabContentsObserver> observers_; | 867 ObserverList<TabContentsObserver> observers_; |
883 | 868 |
884 // Content restrictions, used to disable print/copy etc based on content's | 869 // Content restrictions, used to disable print/copy etc based on content's |
885 // (full-page plugins for now only) permissions. | 870 // (full-page plugins for now only) permissions. |
886 int content_restrictions_; | 871 int content_restrictions_; |
887 | 872 |
888 DISALLOW_COPY_AND_ASSIGN(TabContents); | 873 DISALLOW_COPY_AND_ASSIGN(TabContents); |
889 }; | 874 }; |
890 | 875 |
891 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ | 876 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ |
OLD | NEW |