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_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ |
6 #define CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 | 10 |
11 #include <deque> | 11 #include <deque> |
12 #include <map> | 12 #include <map> |
13 #include <string> | 13 #include <string> |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 #include "base/basictypes.h" | 16 #include "base/basictypes.h" |
17 #include "base/gtest_prod_util.h" | 17 #include "base/gtest_prod_util.h" |
18 #include "base/scoped_ptr.h" | 18 #include "base/scoped_ptr.h" |
19 #include "chrome/browser/cancelable_request.h" | 19 #include "chrome/browser/cancelable_request.h" |
20 #include "chrome/browser/dom_ui/dom_ui_factory.h" | 20 #include "chrome/browser/dom_ui/dom_ui_factory.h" |
21 #include "chrome/browser/download/save_package.h" | 21 #include "chrome/browser/download/save_package.h" |
22 #include "chrome/browser/extensions/image_loading_tracker.h" | 22 #include "chrome/browser/extensions/image_loading_tracker.h" |
23 #include "chrome/browser/fav_icon_helper.h" | 23 #include "chrome/browser/fav_icon_helper.h" |
24 #include "chrome/browser/find_bar_controller.h" | 24 #include "chrome/browser/find_bar_controller.h" |
25 #include "chrome/browser/find_notification_details.h" | 25 #include "chrome/browser/find_notification_details.h" |
26 #include "chrome/browser/jsmessage_box_client.h" | 26 #include "chrome/browser/jsmessage_box_client.h" |
27 #include "chrome/browser/password_manager/password_manager_delegate.h" | 27 #include "chrome/browser/password_manager/password_manager_delegate.h" |
28 #include "chrome/browser/shell_dialogs.h" | |
29 #include "chrome/browser/renderer_host/render_view_host_delegate.h" | 28 #include "chrome/browser/renderer_host/render_view_host_delegate.h" |
30 #include "chrome/browser/tab_contents/constrained_window.h" | 29 #include "chrome/browser/tab_contents/constrained_window.h" |
31 #include "chrome/browser/tab_contents/language_state.h" | 30 #include "chrome/browser/tab_contents/language_state.h" |
32 #include "chrome/browser/tab_contents/navigation_controller.h" | 31 #include "chrome/browser/tab_contents/navigation_controller.h" |
33 #include "chrome/browser/tab_contents/navigation_entry.h" | 32 #include "chrome/browser/tab_contents/navigation_entry.h" |
34 #include "chrome/browser/tab_contents/page_navigator.h" | 33 #include "chrome/browser/tab_contents/page_navigator.h" |
35 #include "chrome/browser/tab_contents/render_view_host_manager.h" | 34 #include "chrome/browser/tab_contents/render_view_host_manager.h" |
36 #include "chrome/browser/tab_contents/tab_specific_content_settings.h" | 35 #include "chrome/browser/tab_contents/tab_specific_content_settings.h" |
37 #include "chrome/common/notification_registrar.h" | 36 #include "chrome/common/notification_registrar.h" |
38 #include "chrome/common/property_bag.h" | 37 #include "chrome/common/property_bag.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 class OmniboxSearchHint; | 71 class OmniboxSearchHint; |
73 class PasswordManager; | 72 class PasswordManager; |
74 class PluginInstaller; | 73 class PluginInstaller; |
75 class Profile; | 74 class Profile; |
76 struct RendererPreferences; | 75 struct RendererPreferences; |
77 class RenderViewHost; | 76 class RenderViewHost; |
78 class SiteInstance; | 77 class SiteInstance; |
79 class SkBitmap; | 78 class SkBitmap; |
80 class TabContents; | 79 class TabContents; |
81 class TabContentsDelegate; | 80 class TabContentsDelegate; |
| 81 class TabContentsFileSelectHelper; |
82 class TabContentsSSLHelper; | 82 class TabContentsSSLHelper; |
83 class TabContentsView; | 83 class TabContentsView; |
84 class URLPattern; | 84 class URLPattern; |
85 struct ThumbnailScore; | 85 struct ThumbnailScore; |
86 struct ViewHostMsg_DomMessage_Params; | 86 struct ViewHostMsg_DomMessage_Params; |
87 struct ViewHostMsg_FrameNavigate_Params; | 87 struct ViewHostMsg_FrameNavigate_Params; |
88 struct ViewHostMsg_RunFileChooser_Params; | |
89 struct WebPreferences; | 88 struct WebPreferences; |
90 | 89 |
91 // Describes what goes in the main content area of a tab. TabContents is | 90 // Describes what goes in the main content area of a tab. TabContents is |
92 // the only type of TabContents, and these should be merged together. | 91 // the only type of TabContents, and these should be merged together. |
93 class TabContents : public PageNavigator, | 92 class TabContents : public PageNavigator, |
94 public NotificationObserver, | 93 public NotificationObserver, |
95 public RenderViewHostDelegate, | 94 public RenderViewHostDelegate, |
96 public RenderViewHostDelegate::BrowserIntegration, | 95 public RenderViewHostDelegate::BrowserIntegration, |
97 public RenderViewHostDelegate::Resource, | 96 public RenderViewHostDelegate::Resource, |
98 public RenderViewHostManager::Delegate, | 97 public RenderViewHostManager::Delegate, |
99 public SelectFileDialog::Listener, | |
100 public JavaScriptMessageBoxClient, | 98 public JavaScriptMessageBoxClient, |
101 public ImageLoadingTracker::Observer, | 99 public ImageLoadingTracker::Observer, |
102 public PasswordManagerDelegate, | 100 public PasswordManagerDelegate, |
103 public TabSpecificContentSettings::Delegate { | 101 public TabSpecificContentSettings::Delegate { |
104 public: | 102 public: |
105 // Flags passed to the TabContentsDelegate.NavigationStateChanged to tell it | 103 // Flags passed to the TabContentsDelegate.NavigationStateChanged to tell it |
106 // what has changed. Combine them to update more than one thing. | 104 // what has changed. Combine them to update more than one thing. |
107 enum InvalidateTypes { | 105 enum InvalidateTypes { |
108 INVALIDATE_URL = 1 << 0, // The URL has changed. | 106 INVALIDATE_URL = 1 << 0, // The URL has changed. |
109 INVALIDATE_TAB = 1 << 1, // The favicon, app icon, or crashed | 107 INVALIDATE_TAB = 1 << 1, // The favicon, app icon, or crashed |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 | 147 |
150 // Returns the AutoFillManager, creating it if necessary. | 148 // Returns the AutoFillManager, creating it if necessary. |
151 AutoFillManager* GetAutoFillManager(); | 149 AutoFillManager* GetAutoFillManager(); |
152 | 150 |
153 // Returns the PasswordManager, creating it if necessary. | 151 // Returns the PasswordManager, creating it if necessary. |
154 PasswordManager* GetPasswordManager(); | 152 PasswordManager* GetPasswordManager(); |
155 | 153 |
156 // Returns the PluginInstaller, creating it if necessary. | 154 // Returns the PluginInstaller, creating it if necessary. |
157 PluginInstaller* GetPluginInstaller(); | 155 PluginInstaller* GetPluginInstaller(); |
158 | 156 |
159 // Returns the TabContentsSSLHelper, creating if it necessary. | 157 // Returns the TabContentsSSLHelper, creating it if necessary. |
160 TabContentsSSLHelper* GetSSLHelper(); | 158 TabContentsSSLHelper* GetSSLHelper(); |
161 | 159 |
162 // Returns the MatchPreview. Returns NULL if MatchPreview is not enabled. | 160 // Returns the MatchPreview. Returns NULL if MatchPreview is not enabled. |
163 MatchPreview* match_preview() { return match_preview_.get(); } | 161 MatchPreview* match_preview() { return match_preview_.get(); } |
164 | 162 |
165 // Returns the SavePackage which manages the page saving job. May be NULL. | 163 // Returns the SavePackage which manages the page saving job. May be NULL. |
166 SavePackage* save_package() const { return save_package_.get(); } | 164 SavePackage* save_package() const { return save_package_.get(); } |
167 | 165 |
168 // Return the currently active RenderProcessHost and RenderViewHost. Each of | 166 // Return the currently active RenderProcessHost and RenderViewHost. Each of |
169 // these may change over time. | 167 // these may change over time. |
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
880 GetBrowserIntegrationDelegate(); | 878 GetBrowserIntegrationDelegate(); |
881 virtual RenderViewHostDelegate::Resource* GetResourceDelegate(); | 879 virtual RenderViewHostDelegate::Resource* GetResourceDelegate(); |
882 virtual RenderViewHostDelegate::ContentSettings* GetContentSettingsDelegate(); | 880 virtual RenderViewHostDelegate::ContentSettings* GetContentSettingsDelegate(); |
883 virtual RenderViewHostDelegate::Save* GetSaveDelegate(); | 881 virtual RenderViewHostDelegate::Save* GetSaveDelegate(); |
884 virtual RenderViewHostDelegate::Printing* GetPrintingDelegate(); | 882 virtual RenderViewHostDelegate::Printing* GetPrintingDelegate(); |
885 virtual RenderViewHostDelegate::FavIcon* GetFavIconDelegate(); | 883 virtual RenderViewHostDelegate::FavIcon* GetFavIconDelegate(); |
886 virtual RenderViewHostDelegate::Autocomplete* GetAutocompleteDelegate(); | 884 virtual RenderViewHostDelegate::Autocomplete* GetAutocompleteDelegate(); |
887 virtual RenderViewHostDelegate::AutoFill* GetAutoFillDelegate(); | 885 virtual RenderViewHostDelegate::AutoFill* GetAutoFillDelegate(); |
888 virtual RenderViewHostDelegate::BlockedPlugin* GetBlockedPluginDelegate(); | 886 virtual RenderViewHostDelegate::BlockedPlugin* GetBlockedPluginDelegate(); |
889 virtual RenderViewHostDelegate::SSL* GetSSLDelegate(); | 887 virtual RenderViewHostDelegate::SSL* GetSSLDelegate(); |
| 888 virtual RenderViewHostDelegate::FileSelect* GetFileSelectDelegate(); |
890 virtual AutomationResourceRoutingDelegate* | 889 virtual AutomationResourceRoutingDelegate* |
891 GetAutomationResourceRoutingDelegate(); | 890 GetAutomationResourceRoutingDelegate(); |
892 virtual TabContents* GetAsTabContents(); | 891 virtual TabContents* GetAsTabContents(); |
893 virtual ViewType::Type GetRenderViewType() const; | 892 virtual ViewType::Type GetRenderViewType() const; |
894 virtual int GetBrowserWindowID() const; | 893 virtual int GetBrowserWindowID() const; |
895 virtual void RenderViewCreated(RenderViewHost* render_view_host); | 894 virtual void RenderViewCreated(RenderViewHost* render_view_host); |
896 virtual void RenderViewReady(RenderViewHost* render_view_host); | 895 virtual void RenderViewReady(RenderViewHost* render_view_host); |
897 virtual void RenderViewGone(RenderViewHost* render_view_host); | 896 virtual void RenderViewGone(RenderViewHost* render_view_host); |
898 virtual void RenderViewDeleted(RenderViewHost* render_view_host); | 897 virtual void RenderViewDeleted(RenderViewHost* render_view_host); |
899 virtual void DidNavigate(RenderViewHost* render_view_host, | 898 virtual void DidNavigate(RenderViewHost* render_view_host, |
(...skipping 18 matching lines...) Expand all Loading... |
918 virtual void DidStartLoading(); | 917 virtual void DidStartLoading(); |
919 virtual void DidStopLoading(); | 918 virtual void DidStopLoading(); |
920 virtual void RequestOpenURL(const GURL& url, const GURL& referrer, | 919 virtual void RequestOpenURL(const GURL& url, const GURL& referrer, |
921 WindowOpenDisposition disposition); | 920 WindowOpenDisposition disposition); |
922 virtual void DomOperationResponse(const std::string& json_string, | 921 virtual void DomOperationResponse(const std::string& json_string, |
923 int automation_id); | 922 int automation_id); |
924 virtual void ProcessDOMUIMessage(const ViewHostMsg_DomMessage_Params& params); | 923 virtual void ProcessDOMUIMessage(const ViewHostMsg_DomMessage_Params& params); |
925 virtual void ProcessExternalHostMessage(const std::string& message, | 924 virtual void ProcessExternalHostMessage(const std::string& message, |
926 const std::string& origin, | 925 const std::string& origin, |
927 const std::string& target); | 926 const std::string& target); |
928 virtual void RunFileChooser(const ViewHostMsg_RunFileChooser_Params& params); | |
929 virtual void RunJavaScriptMessage(const std::wstring& message, | 927 virtual void RunJavaScriptMessage(const std::wstring& message, |
930 const std::wstring& default_prompt, | 928 const std::wstring& default_prompt, |
931 const GURL& frame_url, | 929 const GURL& frame_url, |
932 const int flags, | 930 const int flags, |
933 IPC::Message* reply_msg, | 931 IPC::Message* reply_msg, |
934 bool* did_suppress_message); | 932 bool* did_suppress_message); |
935 virtual void RunBeforeUnloadConfirm(const std::wstring& message, | 933 virtual void RunBeforeUnloadConfirm(const std::wstring& message, |
936 IPC::Message* reply_msg); | 934 IPC::Message* reply_msg); |
937 virtual void ShowModalHTMLDialog(const GURL& url, int width, int height, | 935 virtual void ShowModalHTMLDialog(const GURL& url, int width, int height, |
938 const std::string& json_arguments, | 936 const std::string& json_arguments, |
(...skipping 15 matching lines...) Expand all Loading... |
954 virtual void RendererUnresponsive(RenderViewHost* render_view_host, | 952 virtual void RendererUnresponsive(RenderViewHost* render_view_host, |
955 bool is_during_unload); | 953 bool is_during_unload); |
956 virtual void RendererResponsive(RenderViewHost* render_view_host); | 954 virtual void RendererResponsive(RenderViewHost* render_view_host); |
957 virtual void LoadStateChanged(const GURL& url, net::LoadState load_state, | 955 virtual void LoadStateChanged(const GURL& url, net::LoadState load_state, |
958 uint64 upload_position, uint64 upload_size); | 956 uint64 upload_position, uint64 upload_size); |
959 virtual bool IsExternalTabContainer() const; | 957 virtual bool IsExternalTabContainer() const; |
960 virtual void DidInsertCSS(); | 958 virtual void DidInsertCSS(); |
961 virtual void FocusedNodeChanged(); | 959 virtual void FocusedNodeChanged(); |
962 virtual void SetDisplayingPDFContent(); | 960 virtual void SetDisplayingPDFContent(); |
963 | 961 |
964 // SelectFileDialog::Listener ------------------------------------------------ | |
965 | |
966 virtual void FileSelected(const FilePath& path, int index, void* params); | |
967 virtual void MultiFilesSelected(const std::vector<FilePath>& files, | |
968 void* params); | |
969 virtual void FileSelectionCanceled(void* params); | |
970 | |
971 // RenderViewHostManager::Delegate ------------------------------------------- | 962 // RenderViewHostManager::Delegate ------------------------------------------- |
972 | 963 |
973 // Blocks/unblocks interaction with renderer process. | 964 // Blocks/unblocks interaction with renderer process. |
974 void BlockTabContent(bool blocked); | 965 void BlockTabContent(bool blocked); |
975 | 966 |
976 virtual void BeforeUnloadFiredFromRenderManager( | 967 virtual void BeforeUnloadFiredFromRenderManager( |
977 bool proceed, | 968 bool proceed, |
978 bool* proceed_to_fire_unload); | 969 bool* proceed_to_fire_unload); |
979 virtual void DidStartLoadingFromRenderManager( | 970 virtual void DidStartLoadingFromRenderManager( |
980 RenderViewHost* render_view_host); | 971 RenderViewHost* render_view_host); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1055 | 1046 |
1056 // PluginInstaller, lazily created. | 1047 // PluginInstaller, lazily created. |
1057 scoped_ptr<PluginInstaller> plugin_installer_; | 1048 scoped_ptr<PluginInstaller> plugin_installer_; |
1058 | 1049 |
1059 // TabContentsSSLHelper, lazily created. | 1050 // TabContentsSSLHelper, lazily created. |
1060 scoped_ptr<TabContentsSSLHelper> ssl_helper_; | 1051 scoped_ptr<TabContentsSSLHelper> ssl_helper_; |
1061 | 1052 |
1062 // BlockedPluginManager, lazily created. | 1053 // BlockedPluginManager, lazily created. |
1063 scoped_ptr<BlockedPluginManager> blocked_plugin_manager_; | 1054 scoped_ptr<BlockedPluginManager> blocked_plugin_manager_; |
1064 | 1055 |
| 1056 // TabContentsFileSelectHelper, lazily created. |
| 1057 scoped_ptr<TabContentsFileSelectHelper> file_select_helper_; |
| 1058 |
1065 // Handles drag and drop event forwarding to extensions. | 1059 // Handles drag and drop event forwarding to extensions. |
1066 BookmarkDrag* bookmark_drag_; | 1060 BookmarkDrag* bookmark_drag_; |
1067 | 1061 |
1068 // Handles downloading favicons. | 1062 // Handles downloading favicons. |
1069 FavIconHelper fav_icon_helper_; | 1063 FavIconHelper fav_icon_helper_; |
1070 | 1064 |
1071 // Dialog box used for choosing files to upload from file form fields. | |
1072 scoped_refptr<SelectFileDialog> select_file_dialog_; | |
1073 | |
1074 // Cached web app info data. | 1065 // Cached web app info data. |
1075 webkit_glue::WebApplicationInfo web_app_info_; | 1066 webkit_glue::WebApplicationInfo web_app_info_; |
1076 | 1067 |
1077 // Cached web app icon. | 1068 // Cached web app icon. |
1078 SkBitmap app_icon_; | 1069 SkBitmap app_icon_; |
1079 | 1070 |
1080 // RenderViewHost::ContentSettingsDelegate. | 1071 // RenderViewHost::ContentSettingsDelegate. |
1081 scoped_ptr<TabSpecificContentSettings> content_settings_delegate_; | 1072 scoped_ptr<TabSpecificContentSettings> content_settings_delegate_; |
1082 | 1073 |
1083 // Data for loading state ---------------------------------------------------- | 1074 // Data for loading state ---------------------------------------------------- |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1255 bool displaying_pdf_content_; | 1246 bool displaying_pdf_content_; |
1256 | 1247 |
1257 scoped_ptr<MatchPreview> match_preview_; | 1248 scoped_ptr<MatchPreview> match_preview_; |
1258 | 1249 |
1259 // --------------------------------------------------------------------------- | 1250 // --------------------------------------------------------------------------- |
1260 | 1251 |
1261 DISALLOW_COPY_AND_ASSIGN(TabContents); | 1252 DISALLOW_COPY_AND_ASSIGN(TabContents); |
1262 }; | 1253 }; |
1263 | 1254 |
1264 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ | 1255 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ |
OLD | NEW |