[email protected] | 91854cd | 2012-01-10 19:43:57 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
[email protected] | 93ddb3c | 2012-04-11 21:44:29 | [diff] [blame] | 5 | #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
| 6 | #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 7 | #pragma once |
| 8 | |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 9 | #include <map> |
| 10 | #include <string> |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 11 | |
[email protected] | 01d6517 | 2011-12-25 04:39:30 | [diff] [blame] | 12 | #include "base/compiler_specific.h" |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 13 | #include "base/gtest_prod_util.h" |
[email protected] | 3b63f8f4 | 2011-03-28 01:54:15 | [diff] [blame] | 14 | #include "base/memory/scoped_ptr.h" |
[email protected] | 6eac57a | 2011-07-12 21:15:09 | [diff] [blame] | 15 | #include "base/observer_list.h" |
[email protected] | 45644f6 | 2011-11-23 00:58:23 | [diff] [blame] | 16 | #include "base/property_bag.h" |
[email protected] | 172cf71 | 2012-05-23 15:07:39 | [diff] [blame] | 17 | #include "content/browser/browser_plugin/browser_plugin_host.h" |
[email protected] | 0716190 | 2011-11-11 09:57:42 | [diff] [blame] | 18 | #include "content/browser/renderer_host/java/java_bridge_dispatcher_host_manager.h" |
[email protected] | 2e3bf99 | 2012-05-24 17:36:24 | [diff] [blame] | 19 | #include "content/browser/renderer_host/render_view_host_delegate.h" |
[email protected] | 4ca76c0 | 2012-05-16 16:19:05 | [diff] [blame] | 20 | #include "content/browser/renderer_host/render_widget_host_delegate.h" |
[email protected] | f9e4dae | 2012-04-10 21:26:37 | [diff] [blame] | 21 | #include "content/browser/web_contents/navigation_controller_impl.h" |
[email protected] | 0c4e92e6 | 2012-04-11 15:19:00 | [diff] [blame] | 22 | #include "content/browser/web_contents/render_view_host_manager.h" |
[email protected] | 8d128d6 | 2011-09-13 22:11:57 | [diff] [blame] | 23 | #include "content/common/content_export.h" |
[email protected] | 14392a5 | 2012-05-02 20:28:44 | [diff] [blame] | 24 | #include "content/public/browser/notification_observer.h" |
| 25 | #include "content/public/browser/notification_registrar.h" |
[email protected] | 58f5d56 | 2011-12-20 17:13:03 | [diff] [blame] | 26 | #include "content/public/browser/web_contents.h" |
[email protected] | daf82f8 | 2011-10-31 22:35:31 | [diff] [blame] | 27 | #include "content/public/common/renderer_preferences.h" |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 28 | #include "net/base/load_states.h" |
[email protected] | bcd281560 | 2012-01-14 18:17:23 | [diff] [blame] | 29 | #include "ui/gfx/size.h" |
[email protected] | 7043596 | 2011-08-02 20:13:28 | [diff] [blame] | 30 | #include "webkit/glue/resource_type.h" |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 31 | |
| 32 | #if defined(OS_WIN) |
| 33 | #include "base/win/scoped_handle.h" |
| 34 | #endif |
| 35 | |
[email protected] | cadaec5 | 2012-02-08 21:53:13 | [diff] [blame] | 36 | class InterstitialPageImpl; |
[email protected] | a53209b | 2012-01-20 16:48:16 | [diff] [blame] | 37 | class SavePackage; |
[email protected] | adbfb8df | 2012-02-24 01:19:43 | [diff] [blame] | 38 | class SessionStorageNamespaceImpl; |
[email protected] | f66df82 | 2012-05-18 16:52:17 | [diff] [blame] | 39 | class WebContentsImpl; |
[email protected] | f546640b | 2012-05-15 00:03:49 | [diff] [blame] | 40 | struct ViewMsg_PostMessage_Params; |
[email protected] | daf82f8 | 2011-10-31 22:35:31 | [diff] [blame] | 41 | |
[email protected] | e582fdd | 2011-12-20 16:48:17 | [diff] [blame] | 42 | namespace content { |
[email protected] | da854376 | 2012-03-20 08:52:20 | [diff] [blame] | 43 | class ColorChooser; |
[email protected] | e582fdd | 2011-12-20 16:48:17 | [diff] [blame] | 44 | class DownloadItem; |
[email protected] | 51da7e3 | 2012-01-30 19:24:52 | [diff] [blame] | 45 | class JavaScriptDialogCreator; |
[email protected] | eaabba2 | 2012-03-07 15:02:11 | [diff] [blame] | 46 | class RenderViewHost; |
[email protected] | 5a3bdf5 | 2012-05-24 15:12:57 | [diff] [blame] | 47 | class RenderViewHostDelegateView; |
[email protected] | eaabba2 | 2012-03-07 15:02:11 | [diff] [blame] | 48 | class RenderViewHostImpl; |
[email protected] | 09d31d5 | 2012-03-11 22:30:27 | [diff] [blame] | 49 | class SiteInstance; |
[email protected] | 80e776ae | 2012-03-23 16:17:20 | [diff] [blame] | 50 | class TestWebContents; |
[email protected] | 674bc59 | 2011-12-20 23:00:42 | [diff] [blame] | 51 | class WebContentsDelegate; |
[email protected] | 51da7e3 | 2012-01-30 19:24:52 | [diff] [blame] | 52 | class WebContentsObserver; |
[email protected] | 8643e6d | 2012-01-18 20:26:10 | [diff] [blame] | 53 | class WebContentsView; |
[email protected] | f66df82 | 2012-05-18 16:52:17 | [diff] [blame] | 54 | class WebContentsViewDelegate; |
[email protected] | 09d31d5 | 2012-03-11 22:30:27 | [diff] [blame] | 55 | struct LoadNotificationDetails; |
[email protected] | f66df82 | 2012-05-18 16:52:17 | [diff] [blame] | 56 | |
| 57 | // Factory function for the implementations that content knows about. Takes |
| 58 | // ownership of |delegate|. |
[email protected] | 5a3bdf5 | 2012-05-24 15:12:57 | [diff] [blame] | 59 | WebContentsView* CreateWebContentsView( |
| 60 | WebContentsImpl* web_contents, |
| 61 | WebContentsViewDelegate* delegate, |
| 62 | RenderViewHostDelegateView** render_view_host_delegate_view); |
[email protected] | 97714c8 | 2012-06-06 10:15:13 | [diff] [blame] | 63 | |
| 64 | } // namespace content |
[email protected] | e582fdd | 2011-12-20 16:48:17 | [diff] [blame] | 65 | |
[email protected] | daf82f8 | 2011-10-31 22:35:31 | [diff] [blame] | 66 | namespace webkit_glue { |
| 67 | struct WebIntentData; |
[email protected] | 3a3b75a | 2012-06-01 08:38:36 | [diff] [blame] | 68 | struct WebIntentServiceData; |
[email protected] | daf82f8 | 2011-10-31 22:35:31 | [diff] [blame] | 69 | } |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 70 | |
[email protected] | b172aee | 2012-04-10 17:05:26 | [diff] [blame] | 71 | class CONTENT_EXPORT WebContentsImpl |
[email protected] | 01d6517 | 2011-12-25 04:39:30 | [diff] [blame] | 72 | : public NON_EXPORTED_BASE(content::WebContents), |
[email protected] | b0b67cf | 2012-01-18 21:59:57 | [diff] [blame] | 73 | public content::RenderViewHostDelegate, |
[email protected] | 4ca76c0 | 2012-05-16 16:19:05 | [diff] [blame] | 74 | public content::RenderWidgetHostDelegate, |
[email protected] | 14392a5 | 2012-05-02 20:28:44 | [diff] [blame] | 75 | public RenderViewHostManager::Delegate, |
| 76 | public content::NotificationObserver { |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 77 | public: |
[email protected] | a81343d23 | 2011-12-27 07:39:20 | [diff] [blame] | 78 | // See WebContents::Create for a description of these parameters. |
[email protected] | b172aee | 2012-04-10 17:05:26 | [diff] [blame] | 79 | WebContentsImpl(content::BrowserContext* browser_context, |
| 80 | content::SiteInstance* site_instance, |
| 81 | int routing_id, |
| 82 | const WebContentsImpl* base_web_contents, |
[email protected] | 14392a5 | 2012-05-02 20:28:44 | [diff] [blame] | 83 | WebContentsImpl* opener, |
[email protected] | b172aee | 2012-04-10 17:05:26 | [diff] [blame] | 84 | SessionStorageNamespaceImpl* session_storage_namespace); |
| 85 | virtual ~WebContentsImpl(); |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 86 | |
[email protected] | 64d69de4 | 2012-02-06 00:19:54 | [diff] [blame] | 87 | // Returns the content specific prefs for the given RVH. |
[email protected] | 6717bf27 | 2012-05-11 23:31:25 | [diff] [blame] | 88 | static webkit_glue::WebPreferences GetWebkitPrefs( |
[email protected] | eaabba2 | 2012-03-07 15:02:11 | [diff] [blame] | 89 | content::RenderViewHost* rvh, const GURL& url); |
[email protected] | 64d69de4 | 2012-02-06 00:19:54 | [diff] [blame] | 90 | |
[email protected] | c7dd2f6 | 2011-07-18 15:57:59 | [diff] [blame] | 91 | // Returns the SavePackage which manages the page saving job. May be NULL. |
| 92 | SavePackage* save_package() const { return save_package_.get(); } |
| 93 | |
[email protected] | b172aee | 2012-04-10 17:05:26 | [diff] [blame] | 94 | // Updates the max page ID for the current SiteInstance in this |
| 95 | // WebContentsImpl to be at least |page_id|. |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 96 | void UpdateMaxPageID(int32 page_id); |
| 97 | |
[email protected] | b172aee | 2012-04-10 17:05:26 | [diff] [blame] | 98 | // Updates the max page ID for the given SiteInstance in this WebContentsImpl |
[email protected] | 74ce1ad | 2011-12-16 21:51:46 | [diff] [blame] | 99 | // to be at least |page_id|. |
[email protected] | b658359 | 2012-01-25 19:52:33 | [diff] [blame] | 100 | void UpdateMaxPageIDForSiteInstance(content::SiteInstance* site_instance, |
[email protected] | 74ce1ad | 2011-12-16 21:51:46 | [diff] [blame] | 101 | int32 page_id); |
| 102 | |
[email protected] | 91854cd | 2012-01-10 19:43:57 | [diff] [blame] | 103 | // Copy the current map of SiteInstance ID to max page ID from another tab. |
| 104 | // This is necessary when this tab adopts the NavigationEntries from |
[email protected] | b172aee | 2012-04-10 17:05:26 | [diff] [blame] | 105 | // |web_contents|. |
| 106 | void CopyMaxPageIDsFrom(WebContentsImpl* web_contents); |
[email protected] | 91854cd | 2012-01-10 19:43:57 | [diff] [blame] | 107 | |
[email protected] | b172aee | 2012-04-10 17:05:26 | [diff] [blame] | 108 | // Called by the NavigationController to cause the WebContentsImpl to navigate |
| 109 | // to the current pending entry. The NavigationController should be called |
| 110 | // back with RendererDidNavigate on success or DiscardPendingEntry on failure. |
[email protected] | 9a7e68c | 2011-05-26 17:35:50 | [diff] [blame] | 111 | // The callbacks can be inside of this function, or at some future time. |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 112 | // |
| 113 | // The entry has a PageID of -1 if newly created (corresponding to navigation |
| 114 | // to a new URL). |
| 115 | // |
| 116 | // If this method returns false, then the navigation is discarded (equivalent |
| 117 | // to calling DiscardPendingEntry on the NavigationController). |
[email protected] | 0bfbf88 | 2011-12-22 18:19:27 | [diff] [blame] | 118 | bool NavigateToPendingEntry( |
[email protected] | 71fde35 | 2011-12-29 03:29:56 | [diff] [blame] | 119 | content::NavigationController::ReloadType reload_type); |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 120 | |
[email protected] | ba45bfd | 2012-05-22 21:51:44 | [diff] [blame] | 121 | // Called by InterstitialPageImpl when it creates a RenderViewHost. |
| 122 | void RenderViewForInterstitialPageCreated( |
| 123 | content::RenderViewHost* render_view_host); |
| 124 | |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 125 | // Sets the passed passed interstitial as the currently showing interstitial. |
| 126 | // |interstitial_page| should be non NULL (use the remove_interstitial_page |
| 127 | // method to unset the interstitial) and no interstitial page should be set |
| 128 | // when there is already a non NULL interstitial page set. |
[email protected] | cadaec5 | 2012-02-08 21:53:13 | [diff] [blame] | 129 | void set_interstitial_page(InterstitialPageImpl* interstitial_page) { |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 130 | render_manager_.set_interstitial_page(interstitial_page); |
| 131 | } |
| 132 | |
| 133 | // Unsets the currently showing interstitial. |
| 134 | void remove_interstitial_page() { |
| 135 | render_manager_.remove_interstitial_page(); |
| 136 | } |
| 137 | |
[email protected] | 01ec4ec | 2012-01-18 04:13:47 | [diff] [blame] | 138 | void set_opener_web_ui_type(content::WebUI::TypeID opener_web_ui_type) { |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 139 | opener_web_ui_type_ = opener_web_ui_type; |
| 140 | } |
| 141 | |
[email protected] | 276b37a2 | 2011-11-08 20:45:46 | [diff] [blame] | 142 | JavaBridgeDispatcherHostManager* java_bridge_dispatcher_host_manager() const { |
| 143 | return java_bridge_dispatcher_host_manager_.get(); |
| 144 | } |
| 145 | |
[email protected] | 172cf71 | 2012-05-23 15:07:39 | [diff] [blame] | 146 | content::BrowserPluginHost* browser_plugin_host() const { |
| 147 | return browser_plugin_host_.get(); |
| 148 | } |
| 149 | |
[email protected] | cdcb1dee | 2012-01-04 00:46:20 | [diff] [blame] | 150 | // Like GetController from WebContents, but returns the concrete object. |
[email protected] | d202a7c | 2012-01-04 07:53:47 | [diff] [blame] | 151 | NavigationControllerImpl& GetControllerImpl(); |
[email protected] | cdcb1dee | 2012-01-04 00:46:20 | [diff] [blame] | 152 | |
[email protected] | 76518718 | 2012-01-11 23:59:28 | [diff] [blame] | 153 | // Expose the render manager for testing. |
| 154 | RenderViewHostManager* GetRenderManagerForTesting(); |
| 155 | |
[email protected] | 58f5d56 | 2011-12-20 17:13:03 | [diff] [blame] | 156 | // content::WebContents ------------------------------------------------------ |
[email protected] | 6934a70 | 2011-12-20 00:04:51 | [diff] [blame] | 157 | virtual const base::PropertyBag* GetPropertyBag() const OVERRIDE; |
| 158 | virtual base::PropertyBag* GetPropertyBag() OVERRIDE; |
[email protected] | 674bc59 | 2011-12-20 23:00:42 | [diff] [blame] | 159 | virtual content::WebContentsDelegate* GetDelegate() OVERRIDE; |
| 160 | virtual void SetDelegate(content::WebContentsDelegate* delegate) OVERRIDE; |
[email protected] | cdcb1dee | 2012-01-04 00:46:20 | [diff] [blame] | 161 | virtual content::NavigationController& GetController() OVERRIDE; |
| 162 | virtual const content::NavigationController& GetController() const OVERRIDE; |
[email protected] | 627e051 | 2011-12-21 22:55:30 | [diff] [blame] | 163 | virtual content::BrowserContext* GetBrowserContext() const OVERRIDE; |
[email protected] | f5fa20e | 2011-12-21 22:35:56 | [diff] [blame] | 164 | virtual content::RenderProcessHost* GetRenderProcessHost() const OVERRIDE; |
[email protected] | eaabba2 | 2012-03-07 15:02:11 | [diff] [blame] | 165 | virtual content::RenderViewHost* GetRenderViewHost() const OVERRIDE; |
[email protected] | 5626b089 | 2012-02-20 14:46:58 | [diff] [blame] | 166 | virtual content::RenderWidgetHostView* |
| 167 | GetRenderWidgetHostView() const OVERRIDE; |
[email protected] | 8643e6d | 2012-01-18 20:26:10 | [diff] [blame] | 168 | virtual content::WebContentsView* GetView() const OVERRIDE; |
[email protected] | 01ec4ec | 2012-01-18 04:13:47 | [diff] [blame] | 169 | virtual content::WebUI* CreateWebUI(const GURL& url) OVERRIDE; |
| 170 | virtual content::WebUI* GetWebUI() const OVERRIDE; |
| 171 | virtual content::WebUI* GetCommittedWebUI() const OVERRIDE; |
[email protected] | 86ef6a39 | 2012-05-11 22:03:11 | [diff] [blame] | 172 | virtual void SetUserAgentOverride(const std::string& override) OVERRIDE; |
| 173 | virtual const std::string& GetUserAgentOverride() const OVERRIDE; |
[email protected] | be1f56ab | 2011-12-22 06:55:31 | [diff] [blame] | 174 | virtual const string16& GetTitle() const OVERRIDE; |
| 175 | virtual int32 GetMaxPageID() OVERRIDE; |
| 176 | virtual int32 GetMaxPageIDForSiteInstance( |
[email protected] | b658359 | 2012-01-25 19:52:33 | [diff] [blame] | 177 | content::SiteInstance* site_instance) OVERRIDE; |
| 178 | virtual content::SiteInstance* GetSiteInstance() const OVERRIDE; |
| 179 | virtual content::SiteInstance* GetPendingSiteInstance() const OVERRIDE; |
[email protected] | be1f56ab | 2011-12-22 06:55:31 | [diff] [blame] | 180 | virtual bool IsLoading() const OVERRIDE; |
| 181 | virtual bool IsWaitingForResponse() const OVERRIDE; |
| 182 | virtual const net::LoadStateWithParam& GetLoadState() const OVERRIDE; |
| 183 | virtual const string16& GetLoadStateHost() const OVERRIDE; |
| 184 | virtual uint64 GetUploadSize() const OVERRIDE; |
| 185 | virtual uint64 GetUploadPosition() const OVERRIDE; |
| 186 | virtual const std::string& GetEncoding() const OVERRIDE; |
| 187 | virtual bool DisplayedInsecureContent() const OVERRIDE; |
| 188 | virtual void SetCapturingContents(bool cap) OVERRIDE; |
| 189 | virtual bool IsCrashed() const OVERRIDE; |
| 190 | virtual void SetIsCrashed(base::TerminationStatus status, |
| 191 | int error_code) OVERRIDE; |
| 192 | virtual base::TerminationStatus GetCrashedStatus() const OVERRIDE; |
| 193 | virtual bool IsBeingDestroyed() const OVERRIDE; |
| 194 | virtual void NotifyNavigationStateChanged(unsigned changed_flags) OVERRIDE; |
| 195 | virtual void DidBecomeSelected() OVERRIDE; |
| 196 | virtual base::TimeTicks GetLastSelectedTime() const OVERRIDE; |
| 197 | virtual void WasHidden() OVERRIDE; |
[email protected] | 375fa1b | 2012-05-22 22:05:37 | [diff] [blame] | 198 | virtual void WasRestored() OVERRIDE; |
[email protected] | be1f56ab | 2011-12-22 06:55:31 | [diff] [blame] | 199 | virtual void ShowContents() OVERRIDE; |
| 200 | virtual void HideContents() OVERRIDE; |
| 201 | virtual bool NeedToFireBeforeUnload() OVERRIDE; |
[email protected] | 0bfbf88 | 2011-12-22 18:19:27 | [diff] [blame] | 202 | virtual void Stop() OVERRIDE; |
[email protected] | d908348 | 2012-01-06 00:38:46 | [diff] [blame] | 203 | virtual content::WebContents* Clone() OVERRIDE; |
[email protected] | 2a6bc3e | 2011-12-28 23:51:33 | [diff] [blame] | 204 | virtual void AddNewContents(content::WebContents* new_contents, |
[email protected] | 0bfbf88 | 2011-12-22 18:19:27 | [diff] [blame] | 205 | WindowOpenDisposition disposition, |
| 206 | const gfx::Rect& initial_pos, |
| 207 | bool user_gesture) OVERRIDE; |
| 208 | virtual gfx::NativeView GetContentNativeView() const OVERRIDE; |
| 209 | virtual gfx::NativeView GetNativeView() const OVERRIDE; |
| 210 | virtual void GetContainerBounds(gfx::Rect* out) const OVERRIDE; |
| 211 | virtual void Focus() OVERRIDE; |
| 212 | virtual void FocusThroughTabTraversal(bool reverse) OVERRIDE; |
| 213 | virtual bool ShowingInterstitialPage() const OVERRIDE; |
[email protected] | cadaec5 | 2012-02-08 21:53:13 | [diff] [blame] | 214 | virtual content::InterstitialPage* GetInterstitialPage() const OVERRIDE; |
[email protected] | a53209b | 2012-01-20 16:48:16 | [diff] [blame] | 215 | virtual bool IsSavable() OVERRIDE; |
[email protected] | 0bfbf88 | 2011-12-22 18:19:27 | [diff] [blame] | 216 | virtual void OnSavePage() OVERRIDE; |
| 217 | virtual bool SavePage(const FilePath& main_file, |
| 218 | const FilePath& dir_path, |
[email protected] | a53209b | 2012-01-20 16:48:16 | [diff] [blame] | 219 | content::SavePageType save_type) OVERRIDE; |
[email protected] | aa4f397 | 2012-03-01 18:12:12 | [diff] [blame] | 220 | virtual void GenerateMHTML( |
| 221 | const FilePath& file, |
| 222 | const base::Callback<void(const FilePath&, int64)>& callback) OVERRIDE; |
[email protected] | 0bfbf88 | 2011-12-22 18:19:27 | [diff] [blame] | 223 | virtual bool IsActiveEntry(int32 page_id) OVERRIDE; |
| 224 | |
| 225 | virtual const std::string& GetContentsMimeType() const OVERRIDE; |
| 226 | virtual bool WillNotifyDisconnection() const OVERRIDE; |
| 227 | virtual void SetOverrideEncoding(const std::string& encoding) OVERRIDE; |
| 228 | virtual void ResetOverrideEncoding() OVERRIDE; |
| 229 | virtual content::RendererPreferences* GetMutableRendererPrefs() OVERRIDE; |
| 230 | virtual void SetNewTabStartTime(const base::TimeTicks& time) OVERRIDE; |
| 231 | virtual base::TimeTicks GetNewTabStartTime() const OVERRIDE; |
[email protected] | e35ccd5 | 2012-05-23 16:22:47 | [diff] [blame] | 232 | virtual void Close() OVERRIDE; |
[email protected] | 0bfbf88 | 2011-12-22 18:19:27 | [diff] [blame] | 233 | virtual void OnCloseStarted() OVERRIDE; |
| 234 | virtual bool ShouldAcceptDragAndDrop() const OVERRIDE; |
| 235 | virtual void SystemDragEnded() OVERRIDE; |
[email protected] | e35ccd5 | 2012-05-23 16:22:47 | [diff] [blame] | 236 | virtual void UserGestureDone() OVERRIDE; |
[email protected] | 0bfbf88 | 2011-12-22 18:19:27 | [diff] [blame] | 237 | virtual void SetClosedByUserGesture(bool value) OVERRIDE; |
| 238 | virtual bool GetClosedByUserGesture() const OVERRIDE; |
| 239 | virtual double GetZoomLevel() const OVERRIDE; |
| 240 | virtual int GetZoomPercent(bool* enable_increment, |
| 241 | bool* enable_decrement) OVERRIDE; |
| 242 | virtual void ViewSource() OVERRIDE; |
| 243 | virtual void ViewFrameSource(const GURL& url, |
| 244 | const std::string& content_state) OVERRIDE; |
| 245 | virtual int GetMinimumZoomPercent() const OVERRIDE; |
| 246 | virtual int GetMaximumZoomPercent() const OVERRIDE; |
[email protected] | bcd281560 | 2012-01-14 18:17:23 | [diff] [blame] | 247 | virtual gfx::Size GetPreferredSize() const OVERRIDE; |
[email protected] | 0bfbf88 | 2011-12-22 18:19:27 | [diff] [blame] | 248 | virtual int GetContentRestrictions() const OVERRIDE; |
[email protected] | 01ec4ec | 2012-01-18 04:13:47 | [diff] [blame] | 249 | virtual content::WebUI::TypeID GetWebUITypeForCurrentState() OVERRIDE; |
| 250 | virtual content::WebUI* GetWebUIForCurrentState() OVERRIDE; |
[email protected] | 0bfbf88 | 2011-12-22 18:19:27 | [diff] [blame] | 251 | virtual bool GotResponseToLockMouseRequest(bool allowed) OVERRIDE; |
[email protected] | a0358d7 | 2012-03-09 14:06:50 | [diff] [blame] | 252 | virtual bool HasOpener() const OVERRIDE; |
[email protected] | da854376 | 2012-03-20 08:52:20 | [diff] [blame] | 253 | virtual void DidChooseColorInColorChooser(int color_chooser_id, |
[email protected] | 55578b0a | 2012-04-18 14:31:32 | [diff] [blame] | 254 | SkColor color) OVERRIDE; |
[email protected] | da854376 | 2012-03-20 08:52:20 | [diff] [blame] | 255 | virtual void DidEndColorChooser(int color_chooser_id) OVERRIDE; |
[email protected] | 0bfbf88 | 2011-12-22 18:19:27 | [diff] [blame] | 256 | |
| 257 | // Implementation of PageNavigator. |
[email protected] | e5d549d | 2011-12-28 01:29:20 | [diff] [blame] | 258 | virtual content::WebContents* OpenURL( |
| 259 | const content::OpenURLParams& params) OVERRIDE; |
[email protected] | 151a63d | 2011-12-20 22:32:52 | [diff] [blame] | 260 | |
[email protected] | 952a68e | 2011-11-17 00:36:10 | [diff] [blame] | 261 | // RenderViewHostDelegate ---------------------------------------------------- |
| 262 | |
[email protected] | 5a3bdf5 | 2012-05-24 15:12:57 | [diff] [blame] | 263 | virtual content::RenderViewHostDelegateView* GetDelegateView() OVERRIDE; |
[email protected] | b0b67cf | 2012-01-18 21:59:57 | [diff] [blame] | 264 | virtual content::RenderViewHostDelegate::RendererManagement* |
[email protected] | 952a68e | 2011-11-17 00:36:10 | [diff] [blame] | 265 | GetRendererManagementDelegate() OVERRIDE; |
[email protected] | be1f56ab | 2011-12-22 06:55:31 | [diff] [blame] | 266 | virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 267 | virtual const GURL& GetURL() const OVERRIDE; |
[email protected] | 768c547 | 2011-12-26 19:06:17 | [diff] [blame] | 268 | virtual WebContents* GetAsWebContents() OVERRIDE; |
[email protected] | b7a756d4 | 2012-01-23 18:08:17 | [diff] [blame] | 269 | virtual gfx::Rect GetRootWindowResizerRect() const OVERRIDE; |
[email protected] | eaabba2 | 2012-03-07 15:02:11 | [diff] [blame] | 270 | virtual void RenderViewCreated( |
| 271 | content::RenderViewHost* render_view_host) OVERRIDE; |
| 272 | virtual void RenderViewReady( |
| 273 | content::RenderViewHost* render_view_host) OVERRIDE; |
| 274 | virtual void RenderViewGone(content::RenderViewHost* render_view_host, |
[email protected] | 952a68e | 2011-11-17 00:36:10 | [diff] [blame] | 275 | base::TerminationStatus status, |
| 276 | int error_code) OVERRIDE; |
[email protected] | eaabba2 | 2012-03-07 15:02:11 | [diff] [blame] | 277 | virtual void RenderViewDeleted( |
| 278 | content::RenderViewHost* render_view_host) OVERRIDE; |
[email protected] | 54047eb5 | 2012-05-08 21:45:57 | [diff] [blame] | 279 | virtual void DidStartProvisionalLoadForFrame( |
| 280 | content::RenderViewHost* render_view_host, |
| 281 | int64 frame_id, |
| 282 | bool main_frame, |
| 283 | const GURL& opener_url, |
| 284 | const GURL& url) OVERRIDE; |
[email protected] | 400992b | 2012-06-14 00:03:54 | [diff] [blame^] | 285 | virtual void DidRedirectProvisionalLoad( |
| 286 | content::RenderViewHost* render_view_host, |
| 287 | int32 page_id, |
| 288 | const GURL& opener_url, |
| 289 | const GURL& source_url, |
| 290 | const GURL& target_url) OVERRIDE; |
[email protected] | 54047eb5 | 2012-05-08 21:45:57 | [diff] [blame] | 291 | virtual void DidFailProvisionalLoadWithError( |
| 292 | content::RenderViewHost* render_view_host, |
| 293 | const ViewHostMsg_DidFailProvisionalLoadWithError_Params& params) |
| 294 | OVERRIDE; |
[email protected] | 952a68e | 2011-11-17 00:36:10 | [diff] [blame] | 295 | virtual void DidNavigate( |
[email protected] | eaabba2 | 2012-03-07 15:02:11 | [diff] [blame] | 296 | content::RenderViewHost* render_view_host, |
[email protected] | 952a68e | 2011-11-17 00:36:10 | [diff] [blame] | 297 | const ViewHostMsg_FrameNavigate_Params& params) OVERRIDE; |
[email protected] | eaabba2 | 2012-03-07 15:02:11 | [diff] [blame] | 298 | virtual void UpdateState(content::RenderViewHost* render_view_host, |
[email protected] | 952a68e | 2011-11-17 00:36:10 | [diff] [blame] | 299 | int32 page_id, |
| 300 | const std::string& state) OVERRIDE; |
[email protected] | eaabba2 | 2012-03-07 15:02:11 | [diff] [blame] | 301 | virtual void UpdateTitle(content::RenderViewHost* render_view_host, |
[email protected] | 952a68e | 2011-11-17 00:36:10 | [diff] [blame] | 302 | int32 page_id, |
| 303 | const string16& title, |
| 304 | base::i18n::TextDirection title_direction) OVERRIDE; |
[email protected] | eaabba2 | 2012-03-07 15:02:11 | [diff] [blame] | 305 | virtual void UpdateEncoding(content::RenderViewHost* render_view_host, |
[email protected] | 952a68e | 2011-11-17 00:36:10 | [diff] [blame] | 306 | const std::string& encoding) OVERRIDE; |
| 307 | virtual void UpdateTargetURL(int32 page_id, const GURL& url) OVERRIDE; |
[email protected] | eaabba2 | 2012-03-07 15:02:11 | [diff] [blame] | 308 | virtual void Close(content::RenderViewHost* render_view_host) OVERRIDE; |
[email protected] | 952a68e | 2011-11-17 00:36:10 | [diff] [blame] | 309 | virtual void RequestMove(const gfx::Rect& new_bounds) OVERRIDE; |
[email protected] | eaabba2 | 2012-03-07 15:02:11 | [diff] [blame] | 310 | virtual void SwappedOut(content::RenderViewHost* render_view_host) OVERRIDE; |
[email protected] | 952a68e | 2011-11-17 00:36:10 | [diff] [blame] | 311 | virtual void DidStartLoading() OVERRIDE; |
| 312 | virtual void DidStopLoading() OVERRIDE; |
| 313 | virtual void DidCancelLoading() OVERRIDE; |
| 314 | virtual void DidChangeLoadProgress(double progress) OVERRIDE; |
[email protected] | 87717d0e | 2012-04-26 02:58:43 | [diff] [blame] | 315 | virtual void DocumentAvailableInMainFrame( |
| 316 | content::RenderViewHost* render_view_host) OVERRIDE; |
[email protected] | 952a68e | 2011-11-17 00:36:10 | [diff] [blame] | 317 | virtual void DocumentOnLoadCompletedInMainFrame( |
[email protected] | eaabba2 | 2012-03-07 15:02:11 | [diff] [blame] | 318 | content::RenderViewHost* render_view_host, |
[email protected] | 952a68e | 2011-11-17 00:36:10 | [diff] [blame] | 319 | int32 page_id) OVERRIDE; |
[email protected] | 196159d | 2012-05-04 17:26:54 | [diff] [blame] | 320 | virtual void RequestOpenURL(content::RenderViewHost* rvh, |
| 321 | const GURL& url, |
[email protected] | 445e104 | 2011-12-03 21:03:15 | [diff] [blame] | 322 | const content::Referrer& referrer, |
[email protected] | 952a68e | 2011-11-17 00:36:10 | [diff] [blame] | 323 | WindowOpenDisposition disposition, |
| 324 | int64 source_frame_id) OVERRIDE; |
[email protected] | 4ad5d77d | 2011-12-03 02:00:48 | [diff] [blame] | 325 | virtual void RequestTransferURL( |
| 326 | const GURL& url, |
[email protected] | bce1f1c | 2011-12-05 15:11:58 | [diff] [blame] | 327 | const content::Referrer& referrer, |
[email protected] | 4ad5d77d | 2011-12-03 02:00:48 | [diff] [blame] | 328 | WindowOpenDisposition disposition, |
| 329 | int64 source_frame_id, |
[email protected] | e5d549d | 2011-12-28 01:29:20 | [diff] [blame] | 330 | const content::GlobalRequestID& transferred_global_request_id) OVERRIDE; |
[email protected] | e1c3a55 | 2012-05-04 20:51:32 | [diff] [blame] | 331 | virtual void RouteCloseEvent(content::RenderViewHost* rvh) OVERRIDE; |
[email protected] | f546640b | 2012-05-15 00:03:49 | [diff] [blame] | 332 | virtual void RouteMessageEvent( |
| 333 | content::RenderViewHost* rvh, |
| 334 | const ViewMsg_PostMessage_Params& params) OVERRIDE; |
[email protected] | eaabba2 | 2012-03-07 15:02:11 | [diff] [blame] | 335 | virtual void RunJavaScriptMessage(content::RenderViewHost* rvh, |
[email protected] | 952a68e | 2011-11-17 00:36:10 | [diff] [blame] | 336 | const string16& message, |
| 337 | const string16& default_prompt, |
| 338 | const GURL& frame_url, |
[email protected] | be2510c0 | 2012-05-28 14:52:14 | [diff] [blame] | 339 | content::JavaScriptMessageType type, |
[email protected] | 952a68e | 2011-11-17 00:36:10 | [diff] [blame] | 340 | IPC::Message* reply_msg, |
| 341 | bool* did_suppress_message) OVERRIDE; |
[email protected] | eaabba2 | 2012-03-07 15:02:11 | [diff] [blame] | 342 | virtual void RunBeforeUnloadConfirm(content::RenderViewHost* rvh, |
[email protected] | 952a68e | 2011-11-17 00:36:10 | [diff] [blame] | 343 | const string16& message, |
[email protected] | 3b3301f6 | 2012-02-29 04:32:32 | [diff] [blame] | 344 | bool is_reload, |
[email protected] | 952a68e | 2011-11-17 00:36:10 | [diff] [blame] | 345 | IPC::Message* reply_msg) OVERRIDE; |
[email protected] | a796f20 | 2012-05-30 14:14:25 | [diff] [blame] | 346 | virtual bool AddMessageToConsole(int32 level, |
| 347 | const string16& message, |
| 348 | int32 line_no, |
| 349 | const string16& source_id) OVERRIDE; |
[email protected] | 952a68e | 2011-11-17 00:36:10 | [diff] [blame] | 350 | virtual content::RendererPreferences GetRendererPrefs( |
| 351 | content::BrowserContext* browser_context) const OVERRIDE; |
[email protected] | 6717bf27 | 2012-05-11 23:31:25 | [diff] [blame] | 352 | virtual webkit_glue::WebPreferences GetWebkitPrefs() OVERRIDE; |
[email protected] | 952a68e | 2011-11-17 00:36:10 | [diff] [blame] | 353 | virtual void OnUserGesture() OVERRIDE; |
| 354 | virtual void OnIgnoredUIEvent() OVERRIDE; |
[email protected] | eaabba2 | 2012-03-07 15:02:11 | [diff] [blame] | 355 | virtual void RendererUnresponsive(content::RenderViewHost* render_view_host, |
[email protected] | 952a68e | 2011-11-17 00:36:10 | [diff] [blame] | 356 | bool is_during_unload) OVERRIDE; |
[email protected] | eaabba2 | 2012-03-07 15:02:11 | [diff] [blame] | 357 | virtual void RendererResponsive( |
| 358 | content::RenderViewHost* render_view_host) OVERRIDE; |
[email protected] | 952a68e | 2011-11-17 00:36:10 | [diff] [blame] | 359 | virtual void LoadStateChanged(const GURL& url, |
| 360 | const net::LoadStateWithParam& load_state, |
| 361 | uint64 upload_position, |
| 362 | uint64 upload_size) OVERRIDE; |
| 363 | virtual void WorkerCrashed() OVERRIDE; |
| 364 | virtual void Activate() OVERRIDE; |
| 365 | virtual void Deactivate() OVERRIDE; |
| 366 | virtual void LostCapture() OVERRIDE; |
[email protected] | 952a68e | 2011-11-17 00:36:10 | [diff] [blame] | 367 | virtual void HandleMouseDown() OVERRIDE; |
| 368 | virtual void HandleMouseUp() OVERRIDE; |
| 369 | virtual void HandleMouseActivate() OVERRIDE; |
[email protected] | edc64de | 2011-11-17 20:07:38 | [diff] [blame] | 370 | virtual void RunFileChooser( |
[email protected] | eaabba2 | 2012-03-07 15:02:11 | [diff] [blame] | 371 | content::RenderViewHost* render_view_host, |
[email protected] | 8caadeb | 2011-11-22 02:45:23 | [diff] [blame] | 372 | const content::FileChooserParams& params) OVERRIDE; |
[email protected] | 952a68e | 2011-11-17 00:36:10 | [diff] [blame] | 373 | virtual void ToggleFullscreenMode(bool enter_fullscreen) OVERRIDE; |
| 374 | virtual bool IsFullscreenForCurrentTab() const OVERRIDE; |
| 375 | virtual void UpdatePreferredSize(const gfx::Size& pref_size) OVERRIDE; |
[email protected] | 61e2b3cc | 2012-03-02 16:13:34 | [diff] [blame] | 376 | virtual void ResizeDueToAutoResize(const gfx::Size& new_size) OVERRIDE; |
[email protected] | a9c81f0 | 2012-06-01 00:15:44 | [diff] [blame] | 377 | virtual void RequestToLockMouse(bool user_gesture, |
| 378 | bool last_unlocked_by_target) OVERRIDE; |
[email protected] | 952a68e | 2011-11-17 00:36:10 | [diff] [blame] | 379 | virtual void LostMouseLock() OVERRIDE; |
[email protected] | bafe6cd | 2012-05-23 23:09:50 | [diff] [blame] | 380 | virtual void CreateNewWindow( |
| 381 | int route_id, |
[email protected] | 97714c8 | 2012-06-06 10:15:13 | [diff] [blame] | 382 | const ViewHostMsg_CreateWindow_Params& params, |
| 383 | content::SessionStorageNamespace* session_storage_namespace) OVERRIDE; |
[email protected] | bafe6cd | 2012-05-23 23:09:50 | [diff] [blame] | 384 | virtual void CreateNewWidget(int route_id, |
| 385 | WebKit::WebPopupType popup_type) OVERRIDE; |
| 386 | virtual void CreateNewFullscreenWidget(int route_id) OVERRIDE; |
| 387 | virtual void ShowCreatedWindow(int route_id, |
| 388 | WindowOpenDisposition disposition, |
| 389 | const gfx::Rect& initial_pos, |
| 390 | bool user_gesture) OVERRIDE; |
| 391 | virtual void ShowCreatedWidget(int route_id, |
| 392 | const gfx::Rect& initial_pos) OVERRIDE; |
| 393 | virtual void ShowCreatedFullscreenWidget(int route_id) OVERRIDE; |
| 394 | virtual void ShowContextMenu( |
| 395 | const content::ContextMenuParams& params) OVERRIDE; |
[email protected] | f13b420 | 2012-06-12 23:53:23 | [diff] [blame] | 396 | virtual void RequestMediaAccessPermission( |
| 397 | const content::MediaStreamRequest* request, |
| 398 | const content::MediaResponseCallback& callback) OVERRIDE; |
[email protected] | 952a68e | 2011-11-17 00:36:10 | [diff] [blame] | 399 | |
[email protected] | 4ca76c0 | 2012-05-16 16:19:05 | [diff] [blame] | 400 | // RenderWidgetHostDelegate -------------------------------------------------- |
| 401 | |
[email protected] | b87ee52 | 2012-05-18 15:16:54 | [diff] [blame] | 402 | virtual bool PreHandleKeyboardEvent( |
| 403 | const content::NativeWebKeyboardEvent& event, |
| 404 | bool* is_keyboard_shortcut) OVERRIDE; |
[email protected] | 4ca76c0 | 2012-05-16 16:19:05 | [diff] [blame] | 405 | virtual void HandleKeyboardEvent( |
[email protected] | b87ee52 | 2012-05-18 15:16:54 | [diff] [blame] | 406 | const content::NativeWebKeyboardEvent& event) OVERRIDE; |
[email protected] | 4ca76c0 | 2012-05-16 16:19:05 | [diff] [blame] | 407 | |
[email protected] | 0bfbf88 | 2011-12-22 18:19:27 | [diff] [blame] | 408 | // RenderViewHostManager::Delegate ------------------------------------------- |
| 409 | |
| 410 | virtual bool CreateRenderViewForRenderManager( |
[email protected] | 14392a5 | 2012-05-02 20:28:44 | [diff] [blame] | 411 | content::RenderViewHost* render_view_host, int opener_route_id) OVERRIDE; |
[email protected] | 0bfbf88 | 2011-12-22 18:19:27 | [diff] [blame] | 412 | virtual void BeforeUnloadFiredFromRenderManager( |
| 413 | bool proceed, |
| 414 | bool* proceed_to_fire_unload) OVERRIDE; |
| 415 | virtual void DidStartLoadingFromRenderManager( |
[email protected] | eaabba2 | 2012-03-07 15:02:11 | [diff] [blame] | 416 | content::RenderViewHost* render_view_host) OVERRIDE; |
[email protected] | 0bfbf88 | 2011-12-22 18:19:27 | [diff] [blame] | 417 | virtual void RenderViewGoneFromRenderManager( |
[email protected] | eaabba2 | 2012-03-07 15:02:11 | [diff] [blame] | 418 | content::RenderViewHost* render_view_host) OVERRIDE; |
[email protected] | 0bfbf88 | 2011-12-22 18:19:27 | [diff] [blame] | 419 | virtual void UpdateRenderViewSizeForRenderManager() OVERRIDE; |
| 420 | virtual void NotifySwappedFromRenderManager() OVERRIDE; |
[email protected] | 14392a5 | 2012-05-02 20:28:44 | [diff] [blame] | 421 | virtual int CreateOpenerRenderViewsForRenderManager( |
| 422 | content::SiteInstance* instance) OVERRIDE; |
[email protected] | d202a7c | 2012-01-04 07:53:47 | [diff] [blame] | 423 | virtual NavigationControllerImpl& GetControllerForRenderManager() OVERRIDE; |
[email protected] | d235345 | 2012-01-19 19:53:56 | [diff] [blame] | 424 | virtual WebUIImpl* CreateWebUIForRenderManager(const GURL& url) OVERRIDE; |
[email protected] | ad23a09 | 2011-12-28 07:02:04 | [diff] [blame] | 425 | virtual content::NavigationEntry* |
[email protected] | 0bfbf88 | 2011-12-22 18:19:27 | [diff] [blame] | 426 | GetLastCommittedNavigationEntryForRenderManager() OVERRIDE; |
| 427 | virtual bool FocusLocationBarByDefault() OVERRIDE; |
| 428 | virtual void SetFocusToLocationBar(bool select_all) OVERRIDE; |
[email protected] | eaabba2 | 2012-03-07 15:02:11 | [diff] [blame] | 429 | virtual void CreateViewAndSetSizeForRVH( |
| 430 | content::RenderViewHost* rvh) OVERRIDE; |
[email protected] | 0bfbf88 | 2011-12-22 18:19:27 | [diff] [blame] | 431 | |
[email protected] | 14392a5 | 2012-05-02 20:28:44 | [diff] [blame] | 432 | // content::NotificationObserver --------------------------------------------- |
| 433 | |
| 434 | virtual void Observe(int type, |
| 435 | const content::NotificationSource& source, |
| 436 | const content::NotificationDetails& details) OVERRIDE; |
| 437 | |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 438 | protected: |
[email protected] | d8c66043 | 2011-12-22 20:51:25 | [diff] [blame] | 439 | friend class content::WebContentsObserver; |
[email protected] | 553602e1 | 2011-04-05 17:01:18 | [diff] [blame] | 440 | |
| 441 | // Add and remove observers for page navigation notifications. Adding or |
| 442 | // removing multiple times has no effect. The order in which notifications |
| 443 | // are sent to observers is undefined. Clients must be sure to remove the |
| 444 | // observer before they go away. |
[email protected] | d8c66043 | 2011-12-22 20:51:25 | [diff] [blame] | 445 | void AddObserver(content::WebContentsObserver* observer); |
| 446 | void RemoveObserver(content::WebContentsObserver* observer); |
[email protected] | 553602e1 | 2011-04-05 17:01:18 | [diff] [blame] | 447 | |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 448 | private: |
[email protected] | d202a7c | 2012-01-04 07:53:47 | [diff] [blame] | 449 | friend class NavigationControllerImpl; |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 450 | |
[email protected] | 2db9bd7 | 2012-04-13 20:20:56 | [diff] [blame] | 451 | FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, NoJSMessageOnInterstitials); |
| 452 | FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, UpdateTitle); |
| 453 | FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, |
| 454 | CrossSiteCantPreemptAfterUnload); |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 455 | FRIEND_TEST_ALL_PREFIXES(FormStructureBrowserTest, HTMLFiles); |
| 456 | FRIEND_TEST_ALL_PREFIXES(NavigationControllerTest, HistoryNavigate); |
| 457 | FRIEND_TEST_ALL_PREFIXES(RenderViewHostManagerTest, PageDoesBackAndReload); |
| 458 | |
[email protected] | cadaec5 | 2012-02-08 21:53:13 | [diff] [blame] | 459 | // So InterstitialPageImpl can access SetIsLoading. |
| 460 | friend class InterstitialPageImpl; |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 461 | |
[email protected] | 80e776ae | 2012-03-23 16:17:20 | [diff] [blame] | 462 | // TODO(brettw) TestWebContents shouldn't exist! |
| 463 | friend class content::TestWebContents; |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 464 | |
[email protected] | 14392a5 | 2012-05-02 20:28:44 | [diff] [blame] | 465 | // Clears this tab's opener if it has been closed. |
| 466 | void OnWebContentsDestroyed(content::WebContents* web_contents); |
| 467 | |
[email protected] | 51da7e3 | 2012-01-30 19:24:52 | [diff] [blame] | 468 | // Callback function when showing JS dialogs. |
[email protected] | eaabba2 | 2012-03-07 15:02:11 | [diff] [blame] | 469 | void OnDialogClosed(content::RenderViewHost* rvh, |
[email protected] | 51da7e3 | 2012-01-30 19:24:52 | [diff] [blame] | 470 | IPC::Message* reply_msg, |
| 471 | bool success, |
| 472 | const string16& user_input); |
| 473 | |
[email protected] | d0759f49 | 2012-04-19 22:50:50 | [diff] [blame] | 474 | // IPC message handlers. |
[email protected] | 3a3b75a | 2012-06-01 08:38:36 | [diff] [blame] | 475 | void OnRegisterIntentService(const webkit_glue::WebIntentServiceData& data, |
| 476 | bool user_gesture); |
[email protected] | 67810501 | 2011-12-09 04:01:21 | [diff] [blame] | 477 | void OnWebIntentDispatch(const webkit_glue::WebIntentData& intent, |
[email protected] | 63c23932 | 2011-10-31 23:56:30 | [diff] [blame] | 478 | int intent_id); |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 479 | void OnDidLoadResourceFromMemoryCache(const GURL& url, |
[email protected] | 7043596 | 2011-08-02 20:13:28 | [diff] [blame] | 480 | const std::string& security_info, |
| 481 | const std::string& http_request, |
[email protected] | 6d6cfb3a | 2012-05-23 22:53:18 | [diff] [blame] | 482 | const std::string& mime_type, |
[email protected] | 7043596 | 2011-08-02 20:13:28 | [diff] [blame] | 483 | ResourceType::Type resource_type); |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 484 | void OnDidDisplayInsecureContent(); |
| 485 | void OnDidRunInsecureContent(const std::string& security_origin, |
| 486 | const GURL& target_url); |
| 487 | void OnDocumentLoadedInFrame(int64 frame_id); |
[email protected] | 1a55c5be | 2011-11-29 11:36:31 | [diff] [blame] | 488 | void OnDidFinishLoad(int64 frame_id, |
| 489 | const GURL& validated_url, |
| 490 | bool is_main_frame); |
| 491 | void OnDidFailLoadWithError(int64 frame_id, |
| 492 | const GURL& validated_url, |
| 493 | bool is_main_frame, |
| 494 | int error_code, |
| 495 | const string16& error_description); |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 496 | void OnUpdateContentRestrictions(int restrictions); |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 497 | void OnGoToEntryAtOffset(int offset); |
[email protected] | 21681395 | 2011-05-19 22:21:26 | [diff] [blame] | 498 | void OnUpdateZoomLimits(int minimum_percent, |
| 499 | int maximum_percent, |
| 500 | bool remember); |
[email protected] | 20b433a | 2012-05-15 21:23:46 | [diff] [blame] | 501 | void OnSaveURL(const GURL& url, const content::Referrer& referrer); |
[email protected] | 3a29a6e | 2011-08-24 18:26:21 | [diff] [blame] | 502 | void OnEnumerateDirectory(int request_id, const FilePath& path); |
[email protected] | 7d18902 | 2011-08-25 22:54:20 | [diff] [blame] | 503 | void OnJSOutOfMemory(); |
[email protected] | b7a756d4 | 2012-01-23 18:08:17 | [diff] [blame] | 504 | |
[email protected] | 7d18902 | 2011-08-25 22:54:20 | [diff] [blame] | 505 | void OnRegisterProtocolHandler(const std::string& protocol, |
| 506 | const GURL& url, |
[email protected] | 3a3b75a | 2012-06-01 08:38:36 | [diff] [blame] | 507 | const string16& title, |
| 508 | bool user_gesture); |
[email protected] | b888919c | 2011-09-02 00:32:16 | [diff] [blame] | 509 | void OnFindReply(int request_id, int number_of_matches, |
| 510 | const gfx::Rect& selection_rect, int active_match_ordinal, |
| 511 | bool final_update); |
[email protected] | d952a05 | 2011-09-06 18:42:45 | [diff] [blame] | 512 | void OnCrashedPlugin(const FilePath& plugin_path); |
[email protected] | 7fc4bbb | 2011-09-08 21:23:10 | [diff] [blame] | 513 | void OnAppCacheAccessed(const GURL& manifest_url, bool blocked_by_policy); |
[email protected] | 55578b0a | 2012-04-18 14:31:32 | [diff] [blame] | 514 | void OnOpenColorChooser(int color_chooser_id, SkColor color); |
[email protected] | da854376 | 2012-03-20 08:52:20 | [diff] [blame] | 515 | void OnEndColorChooser(int color_chooser_id); |
[email protected] | 55578b0a | 2012-04-18 14:31:32 | [diff] [blame] | 516 | void OnSetSelectedColorInColorChooser(int color_chooser_id, SkColor color); |
[email protected] | 8be4584 | 2012-04-13 19:49:29 | [diff] [blame] | 517 | void OnPepperPluginHung(int plugin_child_id, |
| 518 | const FilePath& path, |
| 519 | bool is_hung); |
[email protected] | d0759f49 | 2012-04-19 22:50:50 | [diff] [blame] | 520 | void OnWebUISend(const GURL& source_url, |
| 521 | const std::string& name, |
| 522 | const base::ListValue& args); |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 523 | |
| 524 | // Changes the IsLoading state and notifies delegate as needed |
| 525 | // |details| is used to provide details on the load that just finished |
| 526 | // (but can be null if not applicable). Can be overridden. |
| 527 | void SetIsLoading(bool is_loading, |
[email protected] | 09d31d5 | 2012-03-11 22:30:27 | [diff] [blame] | 528 | content::LoadNotificationDetails* details); |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 529 | |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 530 | // Called by derived classes to indicate that we're no longer waiting for a |
| 531 | // response. This won't actually update the throbber, but it will get picked |
| 532 | // up at the next animation step if the throbber is going. |
| 533 | void SetNotWaitingForResponse() { waiting_for_response_ = false; } |
| 534 | |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 535 | // Navigation helpers -------------------------------------------------------- |
| 536 | // |
| 537 | // These functions are helpers for Navigate() and DidNavigate(). |
| 538 | |
| 539 | // Handles post-navigation tasks in DidNavigate AFTER the entry has been |
| 540 | // committed to the navigation controller. Note that the navigation entry is |
| 541 | // not provided since it may be invalid/changed after being committed. The |
| 542 | // current navigation entry is in the NavigationController at this point. |
| 543 | void DidNavigateMainFramePostCommit( |
[email protected] | 8286f51a | 2011-05-31 17:39:13 | [diff] [blame] | 544 | const content::LoadCommittedDetails& details, |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 545 | const ViewHostMsg_FrameNavigate_Params& params); |
| 546 | void DidNavigateAnyFramePostCommit( |
[email protected] | eaabba2 | 2012-03-07 15:02:11 | [diff] [blame] | 547 | content::RenderViewHost* render_view_host, |
[email protected] | 8286f51a | 2011-05-31 17:39:13 | [diff] [blame] | 548 | const content::LoadCommittedDetails& details, |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 549 | const ViewHostMsg_FrameNavigate_Params& params); |
| 550 | |
[email protected] | 74ce1ad | 2011-12-16 21:51:46 | [diff] [blame] | 551 | // If our controller was restored, update the max page ID associated with the |
| 552 | // given RenderViewHost to be larger than the number of restored entries. |
| 553 | // This is called in CreateRenderView before any navigations in the RenderView |
| 554 | // have begun, to prevent any races in updating RenderView::next_page_id. |
[email protected] | eaabba2 | 2012-03-07 15:02:11 | [diff] [blame] | 555 | void UpdateMaxPageIDIfNecessary(content::RenderViewHost* rvh); |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 556 | |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 557 | // Saves the given title to the navigation entry and does associated work. It |
| 558 | // will update history and the view for the new title, and also synthesize |
| 559 | // titles for file URLs that have none (so we require that the URL of the |
| 560 | // entry already be set). |
| 561 | // |
| 562 | // This is used as the backend for state updates, which include a new title, |
| 563 | // or the dedicated set title message. It returns true if the new title is |
| 564 | // different and was therefore updated. |
[email protected] | 10f417c5 | 2011-12-28 21:04:23 | [diff] [blame] | 565 | bool UpdateTitleForEntry(content::NavigationEntryImpl* entry, |
| 566 | const string16& title); |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 567 | |
[email protected] | b172aee | 2012-04-10 17:05:26 | [diff] [blame] | 568 | // Causes the WebContentsImpl to navigate in the right renderer to |entry|, |
| 569 | // which must be already part of the entries in the navigation controller. |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 570 | // This does not change the NavigationController state. |
[email protected] | 10f417c5 | 2011-12-28 21:04:23 | [diff] [blame] | 571 | bool NavigateToEntry(const content::NavigationEntryImpl& entry, |
[email protected] | 71fde35 | 2011-12-29 03:29:56 | [diff] [blame] | 572 | content::NavigationController::ReloadType reload_type); |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 573 | |
[email protected] | b172aee | 2012-04-10 17:05:26 | [diff] [blame] | 574 | // Sets the history for this WebContentsImpl to |history_length| entries, and |
[email protected] | 796931a9 | 2011-08-10 01:32:14 | [diff] [blame] | 575 | // moves the current page_id to the last entry in the list if it's valid. |
| 576 | // This is mainly used when a prerendered page is swapped into the current |
[email protected] | 9e1ad4b | 2011-08-14 16:49:19 | [diff] [blame] | 577 | // tab. The method is virtual for testing. |
[email protected] | b658359 | 2012-01-25 19:52:33 | [diff] [blame] | 578 | virtual void SetHistoryLengthAndPrune( |
| 579 | const content::SiteInstance* site_instance, |
| 580 | int merge_history_length, |
| 581 | int32 minimum_page_id); |
[email protected] | 796931a9 | 2011-08-10 01:32:14 | [diff] [blame] | 582 | |
[email protected] | 14392a5 | 2012-05-02 20:28:44 | [diff] [blame] | 583 | // Recursively creates swapped out RenderViews for this tab's opener chain |
| 584 | // (including this tab) in the given SiteInstance, allowing other tabs to send |
| 585 | // cross-process JavaScript calls to their opener(s). Returns the route ID of |
| 586 | // this tab's RenderView for |instance|. |
| 587 | int CreateOpenerRenderViews(content::SiteInstance* instance); |
| 588 | |
[email protected] | bafe6cd | 2012-05-23 23:09:50 | [diff] [blame] | 589 | // Helper for CreateNewWidget/CreateNewFullscreenWidget. |
| 590 | void CreateNewWidget(int route_id, |
| 591 | bool is_fullscreen, |
| 592 | WebKit::WebPopupType popup_type); |
| 593 | |
| 594 | // Helper for ShowCreatedWidget/ShowCreatedFullscreenWidget. |
| 595 | void ShowCreatedWidget(int route_id, |
| 596 | bool is_fullscreen, |
| 597 | const gfx::Rect& initial_pos); |
| 598 | |
| 599 | // Finds the new RenderWidgetHost and returns it. Note that this can only be |
| 600 | // called once as this call also removes it from the internal map. |
| 601 | content::RenderWidgetHostView* GetCreatedWidget(int route_id); |
| 602 | |
| 603 | // Finds the new WebContentsImpl by route_id, initializes it for |
| 604 | // renderer-initiated creation, and returns it. Note that this can only be |
| 605 | // called once as this call also removes it from the internal map. |
| 606 | WebContentsImpl* GetCreatedWindow(int route_id); |
| 607 | |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 608 | // Misc non-view stuff ------------------------------------------------------- |
| 609 | |
| 610 | // Helper functions for sending notifications. |
| 611 | void NotifySwapped(); |
| 612 | void NotifyConnected(); |
| 613 | void NotifyDisconnected(); |
| 614 | |
[email protected] | be1f56ab | 2011-12-22 06:55:31 | [diff] [blame] | 615 | void SetEncoding(const std::string& encoding); |
| 616 | |
[email protected] | 27678b2a | 2012-02-04 22:09:14 | [diff] [blame] | 617 | // Save a URL to the local filesystem. |
[email protected] | 20b433a | 2012-05-15 21:23:46 | [diff] [blame] | 618 | void SaveURL(const GURL& url, |
| 619 | const content::Referrer& referrer, |
| 620 | bool is_main_frame); |
[email protected] | 27678b2a | 2012-02-04 22:09:14 | [diff] [blame] | 621 | |
[email protected] | eaabba2 | 2012-03-07 15:02:11 | [diff] [blame] | 622 | content::RenderViewHostImpl* GetRenderViewHostImpl(); |
[email protected] | 9f76c1e | 2012-03-05 15:15:58 | [diff] [blame] | 623 | |
[email protected] | 7900bfdb | 2012-05-24 19:31:24 | [diff] [blame] | 624 | void GetBrowserPluginEmbedderInfo(content::RenderViewHost* render_view_host, |
| 625 | std::string* embedder_channel_name, |
| 626 | int* embedder_container_id); |
| 627 | |
[email protected] | 8189899 | 2011-06-14 22:15:00 | [diff] [blame] | 628 | // Stores random bits of data for others to associate with this object. |
| 629 | // WARNING: this needs to be deleted after NavigationController. |
[email protected] | 45644f6 | 2011-11-23 00:58:23 | [diff] [blame] | 630 | base::PropertyBag property_bag_; |
[email protected] | 8189899 | 2011-06-14 22:15:00 | [diff] [blame] | 631 | |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 632 | // Data for core operation --------------------------------------------------- |
| 633 | |
| 634 | // Delegate for notifying our owner about stuff. Not owned by us. |
[email protected] | 674bc59 | 2011-12-20 23:00:42 | [diff] [blame] | 635 | content::WebContentsDelegate* delegate_; |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 636 | |
| 637 | // Handles the back/forward list and loading. |
[email protected] | d202a7c | 2012-01-04 07:53:47 | [diff] [blame] | 638 | NavigationControllerImpl controller_; |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 639 | |
| 640 | // The corresponding view. |
[email protected] | 8643e6d | 2012-01-18 20:26:10 | [diff] [blame] | 641 | scoped_ptr<content::WebContentsView> view_; |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 642 | |
[email protected] | 5a3bdf5 | 2012-05-24 15:12:57 | [diff] [blame] | 643 | // The view of the RVHD. Usually this is our WebContentsView implementation, |
| 644 | // but if an embedder uses a different WebContentsView, they'll need to |
| 645 | // provide this. |
| 646 | content::RenderViewHostDelegateView* render_view_host_delegate_view_; |
| 647 | |
[email protected] | bafe6cd | 2012-05-23 23:09:50 | [diff] [blame] | 648 | // Tracks created WebContentsImpl objects that have not been shown yet. They |
| 649 | // are identified by the route ID passed to CreateNewWindow. |
| 650 | typedef std::map<int, WebContentsImpl*> PendingContents; |
| 651 | PendingContents pending_contents_; |
| 652 | |
| 653 | // These maps hold on to the widgets that we created on behalf of the renderer |
| 654 | // that haven't shown yet. |
| 655 | typedef std::map<int, content::RenderWidgetHostView*> PendingWidgetViews; |
| 656 | PendingWidgetViews pending_widget_views_; |
| 657 | |
[email protected] | 99604297 | 2011-11-08 22:43:59 | [diff] [blame] | 658 | // A list of observers notified when page state changes. Weak references. |
| 659 | // This MUST be listed above render_manager_ since at destruction time the |
| 660 | // latter might cause RenderViewHost's destructor to call us and we might use |
| 661 | // the observer list then. |
[email protected] | d8c66043 | 2011-12-22 20:51:25 | [diff] [blame] | 662 | ObserverList<content::WebContentsObserver> observers_; |
[email protected] | 99604297 | 2011-11-08 22:43:59 | [diff] [blame] | 663 | |
[email protected] | 14392a5 | 2012-05-02 20:28:44 | [diff] [blame] | 664 | // The tab that opened this tab, if any. Will be set to null if the opener |
| 665 | // is closed. |
| 666 | WebContentsImpl* opener_; |
| 667 | |
[email protected] | 86ef6a39 | 2012-05-11 22:03:11 | [diff] [blame] | 668 | // User agent to use if a NavigationEntry requires that the default user agent |
| 669 | // is overridden. |
| 670 | std::string user_agent_override_; |
| 671 | |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 672 | // Helper classes ------------------------------------------------------------ |
| 673 | |
| 674 | // Manages creation and swapping of render views. |
| 675 | RenderViewHostManager render_manager_; |
| 676 | |
[email protected] | 483623eb | 2011-10-25 09:30:00 | [diff] [blame] | 677 | // Manages injecting Java objects into all RenderViewHosts associated with |
[email protected] | b172aee | 2012-04-10 17:05:26 | [diff] [blame] | 678 | // this WebContentsImpl. |
[email protected] | 483623eb | 2011-10-25 09:30:00 | [diff] [blame] | 679 | scoped_ptr<JavaBridgeDispatcherHostManager> |
| 680 | java_bridge_dispatcher_host_manager_; |
| 681 | |
[email protected] | 172cf71 | 2012-05-23 15:07:39 | [diff] [blame] | 682 | // Manages the browser plugin instances hosted by this WebContents. |
| 683 | scoped_ptr<content::BrowserPluginHost> browser_plugin_host_; |
| 684 | |
[email protected] | c7dd2f6 | 2011-07-18 15:57:59 | [diff] [blame] | 685 | // SavePackage, lazily created. |
| 686 | scoped_refptr<SavePackage> save_package_; |
| 687 | |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 688 | // Data for loading state ---------------------------------------------------- |
| 689 | |
| 690 | // Indicates whether we're currently loading a resource. |
| 691 | bool is_loading_; |
| 692 | |
| 693 | // Indicates if the tab is considered crashed. |
| 694 | base::TerminationStatus crashed_status_; |
| 695 | int crashed_error_code_; |
| 696 | |
[email protected] | ca13a44 | 2012-04-17 14:00:12 | [diff] [blame] | 697 | // Whether this WebContents is waiting for a first-response for the |
[email protected] | be1f56ab | 2011-12-22 06:55:31 | [diff] [blame] | 698 | // main resource of the page. This controls whether the throbber state is |
| 699 | // "waiting" or "loading." |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 700 | bool waiting_for_response_; |
| 701 | |
[email protected] | 74ce1ad | 2011-12-16 21:51:46 | [diff] [blame] | 702 | // Map of SiteInstance ID to max page ID for this tab. A page ID is specific |
| 703 | // to a given tab and SiteInstance, and must be valid for the lifetime of the |
[email protected] | b172aee | 2012-04-10 17:05:26 | [diff] [blame] | 704 | // WebContentsImpl. |
[email protected] | 74ce1ad | 2011-12-16 21:51:46 | [diff] [blame] | 705 | std::map<int32, int32> max_page_ids_; |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 706 | |
| 707 | // System time at which the current load was started. |
| 708 | base::TimeTicks current_load_start_; |
| 709 | |
| 710 | // The current load state and the URL associated with it. |
[email protected] | 9c235f04 | 2011-08-10 22:28:21 | [diff] [blame] | 711 | net::LoadStateWithParam load_state_; |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 712 | string16 load_state_host_; |
| 713 | // Upload progress, for displaying in the status bar. |
| 714 | // Set to zero when there is no significant upload happening. |
| 715 | uint64 upload_size_; |
| 716 | uint64 upload_position_; |
| 717 | |
| 718 | // Data for current page ----------------------------------------------------- |
| 719 | |
[email protected] | 987fc3a | 2011-05-26 14:18:09 | [diff] [blame] | 720 | // When a title cannot be taken from any entry, this title will be used. |
| 721 | string16 page_title_when_no_navigation_entry_; |
| 722 | |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 723 | // When a navigation occurs, we record its contents MIME type. It can be |
| 724 | // used to check whether we can do something for some special contents. |
| 725 | std::string contents_mime_type_; |
| 726 | |
| 727 | // Character encoding. |
| 728 | std::string encoding_; |
| 729 | |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 730 | // True if this is a secure page which displayed insecure content. |
| 731 | bool displayed_insecure_content_; |
| 732 | |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 733 | // Data for misc internal state ---------------------------------------------- |
| 734 | |
[email protected] | ca13a44 | 2012-04-17 14:00:12 | [diff] [blame] | 735 | // Whether the WebContents is currently being screenshotted. |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 736 | bool capturing_contents_; |
| 737 | |
| 738 | // See getter above. |
| 739 | bool is_being_destroyed_; |
| 740 | |
| 741 | // Indicates whether we should notify about disconnection of this |
[email protected] | b172aee | 2012-04-10 17:05:26 | [diff] [blame] | 742 | // WebContentsImpl. This is used to ensure disconnection notifications only |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 743 | // happen if a connection notification has happened and that they happen only |
| 744 | // once. |
| 745 | bool notify_disconnection_; |
| 746 | |
[email protected] | 2e5b90c | 2011-08-16 21:11:55 | [diff] [blame] | 747 | // Pointer to the JavaScript dialog creator, lazily assigned. Used because the |
[email protected] | b172aee | 2012-04-10 17:05:26 | [diff] [blame] | 748 | // delegate of this WebContentsImpl is nulled before its destructor is called. |
[email protected] | 2e5b90c | 2011-08-16 21:11:55 | [diff] [blame] | 749 | content::JavaScriptDialogCreator* dialog_creator_; |
| 750 | |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 751 | #if defined(OS_WIN) |
| 752 | // Handle to an event that's set when the page is showing a message box (or |
| 753 | // equivalent constrained window). Plugin processes check this to know if |
| 754 | // they should pump messages then. |
| 755 | base::win::ScopedHandle message_box_active_; |
| 756 | #endif |
| 757 | |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 758 | // Set to true when there is an active "before unload" dialog. When true, |
| 759 | // we've forced the throbber to start in Navigate, and we need to remember to |
| 760 | // turn it off in OnJavaScriptMessageBoxClosed if the navigation is canceled. |
| 761 | bool is_showing_before_unload_dialog_; |
| 762 | |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 763 | // Settings that get passed to the renderer process. |
[email protected] | daf82f8 | 2011-10-31 22:35:31 | [diff] [blame] | 764 | content::RendererPreferences renderer_preferences_; |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 765 | |
| 766 | // If this tab was created from a renderer using window.open, this will be |
| 767 | // non-NULL and represent the WebUI of the opening renderer. |
[email protected] | 01ec4ec | 2012-01-18 04:13:47 | [diff] [blame] | 768 | content::WebUI::TypeID opener_web_ui_type_; |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 769 | |
| 770 | // The time that we started to create the new tab page. |
| 771 | base::TimeTicks new_tab_start_time_; |
| 772 | |
[email protected] | 3bbacc5b | 2012-04-17 17:46:15 | [diff] [blame] | 773 | // The time that we started to close this WebContents. |
| 774 | base::TimeTicks close_start_time_; |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 775 | |
| 776 | // The time that this tab was last selected. |
| 777 | base::TimeTicks last_selected_time_; |
| 778 | |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 779 | // See description above setter. |
| 780 | bool closed_by_user_gesture_; |
| 781 | |
| 782 | // Minimum/maximum zoom percent. |
| 783 | int minimum_zoom_percent_; |
| 784 | int maximum_zoom_percent_; |
| 785 | // If true, the default zoom limits have been overriden for this tab, in which |
| 786 | // case we don't want saved settings to apply to it and we don't want to |
| 787 | // remember it. |
| 788 | bool temporary_zoom_settings_; |
| 789 | |
[email protected] | bcd281560 | 2012-01-14 18:17:23 | [diff] [blame] | 790 | // The intrinsic size of the page. |
| 791 | gfx::Size preferred_size_; |
| 792 | |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 793 | // Content restrictions, used to disable print/copy etc based on content's |
| 794 | // (full-page plugins for now only) permissions. |
| 795 | int content_restrictions_; |
| 796 | |
[email protected] | da854376 | 2012-03-20 08:52:20 | [diff] [blame] | 797 | // Color chooser that was opened by this tab. |
| 798 | content::ColorChooser* color_chooser_; |
| 799 | |
[email protected] | f53a9f87 | 2012-05-24 02:07:06 | [diff] [blame] | 800 | // This must be at the end, or else we might get notifications and use other |
| 801 | // member variables that are gone. |
| 802 | content::NotificationRegistrar registrar_; |
| 803 | |
[email protected] | b172aee | 2012-04-10 17:05:26 | [diff] [blame] | 804 | DISALLOW_COPY_AND_ASSIGN(WebContentsImpl); |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 805 | }; |
| 806 | |
[email protected] | 93ddb3c | 2012-04-11 21:44:29 | [diff] [blame] | 807 | #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |