blob: 969623fdcc81142aeb2134b9edd79d5ef8ab5741 [file] [log] [blame]
[email protected]91854cd2012-01-10 19:43:571// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]0dd3a0ab2011-02-18 08:17:442// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]93ddb3c2012-04-11 21:44:295#ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
6#define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
[email protected]0dd3a0ab2011-02-18 08:17:447#pragma once
8
[email protected]0dd3a0ab2011-02-18 08:17:449#include <map>
10#include <string>
[email protected]0dd3a0ab2011-02-18 08:17:4411
[email protected]01d65172011-12-25 04:39:3012#include "base/compiler_specific.h"
[email protected]0dd3a0ab2011-02-18 08:17:4413#include "base/gtest_prod_util.h"
[email protected]3b63f8f42011-03-28 01:54:1514#include "base/memory/scoped_ptr.h"
[email protected]6eac57a2011-07-12 21:15:0915#include "base/observer_list.h"
[email protected]45644f62011-11-23 00:58:2316#include "base/property_bag.h"
[email protected]8dd709fb2012-04-06 00:49:0617#include "content/browser/browser_plugin/browser_plugin_web_contents_observer.h"
[email protected]07161902011-11-11 09:57:4218#include "content/browser/renderer_host/java/java_bridge_dispatcher_host_manager.h"
[email protected]f9e4dae2012-04-10 21:26:3719#include "content/browser/web_contents/navigation_controller_impl.h"
[email protected]0c4e92e62012-04-11 15:19:0020#include "content/browser/web_contents/render_view_host_manager.h"
[email protected]8d128d62011-09-13 22:11:5721#include "content/common/content_export.h"
[email protected]14392a52012-05-02 20:28:4422#include "content/public/browser/notification_observer.h"
23#include "content/public/browser/notification_registrar.h"
[email protected]b0b67cf2012-01-18 21:59:5724#include "content/public/browser/render_view_host_delegate.h"
[email protected]58f5d562011-12-20 17:13:0325#include "content/public/browser/web_contents.h"
[email protected]daf82f82011-10-31 22:35:3126#include "content/public/common/renderer_preferences.h"
[email protected]0dd3a0ab2011-02-18 08:17:4427#include "net/base/load_states.h"
[email protected]bcd2815602012-01-14 18:17:2328#include "ui/gfx/size.h"
[email protected]70435962011-08-02 20:13:2829#include "webkit/glue/resource_type.h"
[email protected]0dd3a0ab2011-02-18 08:17:4430
31#if defined(OS_WIN)
32#include "base/win/scoped_handle.h"
33#endif
34
[email protected]cadaec52012-02-08 21:53:1335class InterstitialPageImpl;
[email protected]a53209b2012-01-20 16:48:1636class SavePackage;
[email protected]adbfb8df2012-02-24 01:19:4337class SessionStorageNamespaceImpl;
[email protected]f546640b2012-05-15 00:03:4938struct ViewMsg_PostMessage_Params;
[email protected]daf82f82011-10-31 22:35:3139
[email protected]e582fdd2011-12-20 16:48:1740namespace content {
[email protected]da8543762012-03-20 08:52:2041class ColorChooser;
[email protected]e582fdd2011-12-20 16:48:1742class DownloadItem;
[email protected]51da7e32012-01-30 19:24:5243class JavaScriptDialogCreator;
[email protected]eaabba22012-03-07 15:02:1144class RenderViewHost;
45class RenderViewHostImpl;
[email protected]09d31d52012-03-11 22:30:2746class SiteInstance;
[email protected]80e776ae2012-03-23 16:17:2047class TestWebContents;
[email protected]674bc592011-12-20 23:00:4248class WebContentsDelegate;
[email protected]51da7e32012-01-30 19:24:5249class WebContentsObserver;
[email protected]8643e6d2012-01-18 20:26:1050class WebContentsView;
[email protected]09d31d52012-03-11 22:30:2751struct LoadNotificationDetails;
[email protected]e582fdd2011-12-20 16:48:1752}
53
[email protected]daf82f82011-10-31 22:35:3154namespace webkit_glue {
55struct WebIntentData;
56}
[email protected]0dd3a0ab2011-02-18 08:17:4457
[email protected]b172aee2012-04-10 17:05:2658class CONTENT_EXPORT WebContentsImpl
[email protected]01d65172011-12-25 04:39:3059 : public NON_EXPORTED_BASE(content::WebContents),
[email protected]b0b67cf2012-01-18 21:59:5760 public content::RenderViewHostDelegate,
[email protected]14392a52012-05-02 20:28:4461 public RenderViewHostManager::Delegate,
62 public content::NotificationObserver {
[email protected]0dd3a0ab2011-02-18 08:17:4463 public:
[email protected]a81343d232011-12-27 07:39:2064 // See WebContents::Create for a description of these parameters.
[email protected]b172aee2012-04-10 17:05:2665 WebContentsImpl(content::BrowserContext* browser_context,
66 content::SiteInstance* site_instance,
67 int routing_id,
68 const WebContentsImpl* base_web_contents,
[email protected]14392a52012-05-02 20:28:4469 WebContentsImpl* opener,
[email protected]b172aee2012-04-10 17:05:2670 SessionStorageNamespaceImpl* session_storage_namespace);
71 virtual ~WebContentsImpl();
[email protected]0dd3a0ab2011-02-18 08:17:4472
[email protected]64d69de42012-02-06 00:19:5473 // Returns the content specific prefs for the given RVH.
[email protected]6717bf272012-05-11 23:31:2574 static webkit_glue::WebPreferences GetWebkitPrefs(
[email protected]eaabba22012-03-07 15:02:1175 content::RenderViewHost* rvh, const GURL& url);
[email protected]64d69de42012-02-06 00:19:5476
[email protected]c7dd2f62011-07-18 15:57:5977 // Returns the SavePackage which manages the page saving job. May be NULL.
78 SavePackage* save_package() const { return save_package_.get(); }
79
[email protected]b172aee2012-04-10 17:05:2680 // Updates the max page ID for the current SiteInstance in this
81 // WebContentsImpl to be at least |page_id|.
[email protected]0dd3a0ab2011-02-18 08:17:4482 void UpdateMaxPageID(int32 page_id);
83
[email protected]b172aee2012-04-10 17:05:2684 // Updates the max page ID for the given SiteInstance in this WebContentsImpl
[email protected]74ce1ad2011-12-16 21:51:4685 // to be at least |page_id|.
[email protected]b6583592012-01-25 19:52:3386 void UpdateMaxPageIDForSiteInstance(content::SiteInstance* site_instance,
[email protected]74ce1ad2011-12-16 21:51:4687 int32 page_id);
88
[email protected]91854cd2012-01-10 19:43:5789 // Copy the current map of SiteInstance ID to max page ID from another tab.
90 // This is necessary when this tab adopts the NavigationEntries from
[email protected]b172aee2012-04-10 17:05:2691 // |web_contents|.
92 void CopyMaxPageIDsFrom(WebContentsImpl* web_contents);
[email protected]91854cd2012-01-10 19:43:5793
[email protected]b172aee2012-04-10 17:05:2694 // Called by the NavigationController to cause the WebContentsImpl to navigate
95 // to the current pending entry. The NavigationController should be called
96 // back with RendererDidNavigate on success or DiscardPendingEntry on failure.
[email protected]9a7e68c2011-05-26 17:35:5097 // The callbacks can be inside of this function, or at some future time.
[email protected]0dd3a0ab2011-02-18 08:17:4498 //
99 // The entry has a PageID of -1 if newly created (corresponding to navigation
100 // to a new URL).
101 //
102 // If this method returns false, then the navigation is discarded (equivalent
103 // to calling DiscardPendingEntry on the NavigationController).
[email protected]0bfbf882011-12-22 18:19:27104 bool NavigateToPendingEntry(
[email protected]71fde352011-12-29 03:29:56105 content::NavigationController::ReloadType reload_type);
[email protected]0dd3a0ab2011-02-18 08:17:44106
[email protected]0dd3a0ab2011-02-18 08:17:44107 // Sets the passed passed interstitial as the currently showing interstitial.
108 // |interstitial_page| should be non NULL (use the remove_interstitial_page
109 // method to unset the interstitial) and no interstitial page should be set
110 // when there is already a non NULL interstitial page set.
[email protected]cadaec52012-02-08 21:53:13111 void set_interstitial_page(InterstitialPageImpl* interstitial_page) {
[email protected]0dd3a0ab2011-02-18 08:17:44112 render_manager_.set_interstitial_page(interstitial_page);
113 }
114
115 // Unsets the currently showing interstitial.
116 void remove_interstitial_page() {
117 render_manager_.remove_interstitial_page();
118 }
119
[email protected]01ec4ec2012-01-18 04:13:47120 void set_opener_web_ui_type(content::WebUI::TypeID opener_web_ui_type) {
[email protected]0dd3a0ab2011-02-18 08:17:44121 opener_web_ui_type_ = opener_web_ui_type;
122 }
123
[email protected]276b37a22011-11-08 20:45:46124 JavaBridgeDispatcherHostManager* java_bridge_dispatcher_host_manager() const {
125 return java_bridge_dispatcher_host_manager_.get();
126 }
127
[email protected]8dd709fb2012-04-06 00:49:06128 content::BrowserPluginWebContentsObserver*
129 browser_plugin_web_contents_observer() const {
130 return browser_plugin_web_contents_observer_.get();
131 }
132
[email protected]cdcb1dee2012-01-04 00:46:20133 // Like GetController from WebContents, but returns the concrete object.
[email protected]d202a7c2012-01-04 07:53:47134 NavigationControllerImpl& GetControllerImpl();
[email protected]cdcb1dee2012-01-04 00:46:20135
[email protected]765187182012-01-11 23:59:28136 // Expose the render manager for testing.
137 RenderViewHostManager* GetRenderManagerForTesting();
138
[email protected]58f5d562011-12-20 17:13:03139 // content::WebContents ------------------------------------------------------
[email protected]6934a702011-12-20 00:04:51140 virtual const base::PropertyBag* GetPropertyBag() const OVERRIDE;
141 virtual base::PropertyBag* GetPropertyBag() OVERRIDE;
[email protected]674bc592011-12-20 23:00:42142 virtual content::WebContentsDelegate* GetDelegate() OVERRIDE;
143 virtual void SetDelegate(content::WebContentsDelegate* delegate) OVERRIDE;
[email protected]cdcb1dee2012-01-04 00:46:20144 virtual content::NavigationController& GetController() OVERRIDE;
145 virtual const content::NavigationController& GetController() const OVERRIDE;
[email protected]627e0512011-12-21 22:55:30146 virtual content::BrowserContext* GetBrowserContext() const OVERRIDE;
[email protected]f5fa20e2011-12-21 22:35:56147 virtual void SetViewType(content::ViewType type) OVERRIDE;
[email protected]ea049a02011-12-25 21:37:09148 virtual content::ViewType GetViewType() const OVERRIDE;
[email protected]f5fa20e2011-12-21 22:35:56149 virtual content::RenderProcessHost* GetRenderProcessHost() const OVERRIDE;
[email protected]eaabba22012-03-07 15:02:11150 virtual content::RenderViewHost* GetRenderViewHost() const OVERRIDE;
[email protected]5626b0892012-02-20 14:46:58151 virtual content::RenderWidgetHostView*
152 GetRenderWidgetHostView() const OVERRIDE;
[email protected]8643e6d2012-01-18 20:26:10153 virtual content::WebContentsView* GetView() const OVERRIDE;
[email protected]01ec4ec2012-01-18 04:13:47154 virtual content::WebUI* CreateWebUI(const GURL& url) OVERRIDE;
155 virtual content::WebUI* GetWebUI() const OVERRIDE;
156 virtual content::WebUI* GetCommittedWebUI() const OVERRIDE;
[email protected]86ef6a392012-05-11 22:03:11157 virtual void SetUserAgentOverride(const std::string& override) OVERRIDE;
158 virtual const std::string& GetUserAgentOverride() const OVERRIDE;
[email protected]be1f56ab2011-12-22 06:55:31159 virtual const string16& GetTitle() const OVERRIDE;
160 virtual int32 GetMaxPageID() OVERRIDE;
161 virtual int32 GetMaxPageIDForSiteInstance(
[email protected]b6583592012-01-25 19:52:33162 content::SiteInstance* site_instance) OVERRIDE;
163 virtual content::SiteInstance* GetSiteInstance() const OVERRIDE;
164 virtual content::SiteInstance* GetPendingSiteInstance() const OVERRIDE;
[email protected]be1f56ab2011-12-22 06:55:31165 virtual bool IsLoading() const OVERRIDE;
166 virtual bool IsWaitingForResponse() const OVERRIDE;
167 virtual const net::LoadStateWithParam& GetLoadState() const OVERRIDE;
168 virtual const string16& GetLoadStateHost() const OVERRIDE;
169 virtual uint64 GetUploadSize() const OVERRIDE;
170 virtual uint64 GetUploadPosition() const OVERRIDE;
171 virtual const std::string& GetEncoding() const OVERRIDE;
172 virtual bool DisplayedInsecureContent() const OVERRIDE;
173 virtual void SetCapturingContents(bool cap) OVERRIDE;
174 virtual bool IsCrashed() const OVERRIDE;
175 virtual void SetIsCrashed(base::TerminationStatus status,
176 int error_code) OVERRIDE;
177 virtual base::TerminationStatus GetCrashedStatus() const OVERRIDE;
178 virtual bool IsBeingDestroyed() const OVERRIDE;
179 virtual void NotifyNavigationStateChanged(unsigned changed_flags) OVERRIDE;
180 virtual void DidBecomeSelected() OVERRIDE;
181 virtual base::TimeTicks GetLastSelectedTime() const OVERRIDE;
182 virtual void WasHidden() OVERRIDE;
183 virtual void ShowContents() OVERRIDE;
184 virtual void HideContents() OVERRIDE;
185 virtual bool NeedToFireBeforeUnload() OVERRIDE;
[email protected]0bfbf882011-12-22 18:19:27186 virtual void Stop() OVERRIDE;
[email protected]d9083482012-01-06 00:38:46187 virtual content::WebContents* Clone() OVERRIDE;
[email protected]2a6bc3e2011-12-28 23:51:33188 virtual void AddNewContents(content::WebContents* new_contents,
[email protected]0bfbf882011-12-22 18:19:27189 WindowOpenDisposition disposition,
190 const gfx::Rect& initial_pos,
191 bool user_gesture) OVERRIDE;
192 virtual gfx::NativeView GetContentNativeView() const OVERRIDE;
193 virtual gfx::NativeView GetNativeView() const OVERRIDE;
194 virtual void GetContainerBounds(gfx::Rect* out) const OVERRIDE;
195 virtual void Focus() OVERRIDE;
196 virtual void FocusThroughTabTraversal(bool reverse) OVERRIDE;
197 virtual bool ShowingInterstitialPage() const OVERRIDE;
[email protected]cadaec52012-02-08 21:53:13198 virtual content::InterstitialPage* GetInterstitialPage() const OVERRIDE;
[email protected]a53209b2012-01-20 16:48:16199 virtual bool IsSavable() OVERRIDE;
[email protected]0bfbf882011-12-22 18:19:27200 virtual void OnSavePage() OVERRIDE;
201 virtual bool SavePage(const FilePath& main_file,
202 const FilePath& dir_path,
[email protected]a53209b2012-01-20 16:48:16203 content::SavePageType save_type) OVERRIDE;
[email protected]aa4f3972012-03-01 18:12:12204 virtual void GenerateMHTML(
205 const FilePath& file,
206 const base::Callback<void(const FilePath&, int64)>& callback) OVERRIDE;
[email protected]0bfbf882011-12-22 18:19:27207 virtual bool IsActiveEntry(int32 page_id) OVERRIDE;
208
209 virtual const std::string& GetContentsMimeType() const OVERRIDE;
210 virtual bool WillNotifyDisconnection() const OVERRIDE;
211 virtual void SetOverrideEncoding(const std::string& encoding) OVERRIDE;
212 virtual void ResetOverrideEncoding() OVERRIDE;
213 virtual content::RendererPreferences* GetMutableRendererPrefs() OVERRIDE;
214 virtual void SetNewTabStartTime(const base::TimeTicks& time) OVERRIDE;
215 virtual base::TimeTicks GetNewTabStartTime() const OVERRIDE;
216 virtual void OnCloseStarted() OVERRIDE;
217 virtual bool ShouldAcceptDragAndDrop() const OVERRIDE;
218 virtual void SystemDragEnded() OVERRIDE;
219 virtual void SetClosedByUserGesture(bool value) OVERRIDE;
220 virtual bool GetClosedByUserGesture() const OVERRIDE;
221 virtual double GetZoomLevel() const OVERRIDE;
222 virtual int GetZoomPercent(bool* enable_increment,
223 bool* enable_decrement) OVERRIDE;
224 virtual void ViewSource() OVERRIDE;
225 virtual void ViewFrameSource(const GURL& url,
226 const std::string& content_state) OVERRIDE;
227 virtual int GetMinimumZoomPercent() const OVERRIDE;
228 virtual int GetMaximumZoomPercent() const OVERRIDE;
[email protected]bcd2815602012-01-14 18:17:23229 virtual gfx::Size GetPreferredSize() const OVERRIDE;
[email protected]0bfbf882011-12-22 18:19:27230 virtual int GetContentRestrictions() const OVERRIDE;
[email protected]01ec4ec2012-01-18 04:13:47231 virtual content::WebUI::TypeID GetWebUITypeForCurrentState() OVERRIDE;
232 virtual content::WebUI* GetWebUIForCurrentState() OVERRIDE;
[email protected]0bfbf882011-12-22 18:19:27233 virtual bool GotResponseToLockMouseRequest(bool allowed) OVERRIDE;
[email protected]a0358d72012-03-09 14:06:50234 virtual bool HasOpener() const OVERRIDE;
[email protected]da8543762012-03-20 08:52:20235 virtual void DidChooseColorInColorChooser(int color_chooser_id,
[email protected]55578b0a2012-04-18 14:31:32236 SkColor color) OVERRIDE;
[email protected]da8543762012-03-20 08:52:20237 virtual void DidEndColorChooser(int color_chooser_id) OVERRIDE;
[email protected]0bfbf882011-12-22 18:19:27238
239 // Implementation of PageNavigator.
[email protected]e5d549d2011-12-28 01:29:20240 virtual content::WebContents* OpenURL(
241 const content::OpenURLParams& params) OVERRIDE;
[email protected]151a63d2011-12-20 22:32:52242
[email protected]952a68e2011-11-17 00:36:10243 // RenderViewHostDelegate ----------------------------------------------------
244
[email protected]b0b67cf2012-01-18 21:59:57245 virtual content::RenderViewHostDelegate::View* GetViewDelegate() OVERRIDE;
246 virtual content::RenderViewHostDelegate::RendererManagement*
[email protected]952a68e2011-11-17 00:36:10247 GetRendererManagementDelegate() OVERRIDE;
[email protected]be1f56ab2011-12-22 06:55:31248 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
249 virtual const GURL& GetURL() const OVERRIDE;
[email protected]768c5472011-12-26 19:06:17250 virtual WebContents* GetAsWebContents() OVERRIDE;
[email protected]952a68e2011-11-17 00:36:10251 virtual content::ViewType GetRenderViewType() const OVERRIDE;
[email protected]b7a756d42012-01-23 18:08:17252 virtual gfx::Rect GetRootWindowResizerRect() const OVERRIDE;
[email protected]eaabba22012-03-07 15:02:11253 virtual void RenderViewCreated(
254 content::RenderViewHost* render_view_host) OVERRIDE;
255 virtual void RenderViewReady(
256 content::RenderViewHost* render_view_host) OVERRIDE;
257 virtual void RenderViewGone(content::RenderViewHost* render_view_host,
[email protected]952a68e2011-11-17 00:36:10258 base::TerminationStatus status,
259 int error_code) OVERRIDE;
[email protected]eaabba22012-03-07 15:02:11260 virtual void RenderViewDeleted(
261 content::RenderViewHost* render_view_host) OVERRIDE;
[email protected]54047eb52012-05-08 21:45:57262 virtual void DidStartProvisionalLoadForFrame(
263 content::RenderViewHost* render_view_host,
264 int64 frame_id,
265 bool main_frame,
266 const GURL& opener_url,
267 const GURL& url) OVERRIDE;
268 virtual void DidRedirectProvisionalLoad(
269 content::RenderViewHost* render_view_host,
270 int32 page_id,
271 const GURL& opener_url,
272 const GURL& source_url,
273 const GURL& target_url) OVERRIDE;
274 virtual void DidFailProvisionalLoadWithError(
275 content::RenderViewHost* render_view_host,
276 const ViewHostMsg_DidFailProvisionalLoadWithError_Params& params)
277 OVERRIDE;
[email protected]952a68e2011-11-17 00:36:10278 virtual void DidNavigate(
[email protected]eaabba22012-03-07 15:02:11279 content::RenderViewHost* render_view_host,
[email protected]952a68e2011-11-17 00:36:10280 const ViewHostMsg_FrameNavigate_Params& params) OVERRIDE;
[email protected]eaabba22012-03-07 15:02:11281 virtual void UpdateState(content::RenderViewHost* render_view_host,
[email protected]952a68e2011-11-17 00:36:10282 int32 page_id,
283 const std::string& state) OVERRIDE;
[email protected]eaabba22012-03-07 15:02:11284 virtual void UpdateTitle(content::RenderViewHost* render_view_host,
[email protected]952a68e2011-11-17 00:36:10285 int32 page_id,
286 const string16& title,
287 base::i18n::TextDirection title_direction) OVERRIDE;
[email protected]eaabba22012-03-07 15:02:11288 virtual void UpdateEncoding(content::RenderViewHost* render_view_host,
[email protected]952a68e2011-11-17 00:36:10289 const std::string& encoding) OVERRIDE;
290 virtual void UpdateTargetURL(int32 page_id, const GURL& url) OVERRIDE;
[email protected]eaabba22012-03-07 15:02:11291 virtual void Close(content::RenderViewHost* render_view_host) OVERRIDE;
[email protected]952a68e2011-11-17 00:36:10292 virtual void RequestMove(const gfx::Rect& new_bounds) OVERRIDE;
[email protected]eaabba22012-03-07 15:02:11293 virtual void SwappedOut(content::RenderViewHost* render_view_host) OVERRIDE;
[email protected]952a68e2011-11-17 00:36:10294 virtual void DidStartLoading() OVERRIDE;
295 virtual void DidStopLoading() OVERRIDE;
296 virtual void DidCancelLoading() OVERRIDE;
297 virtual void DidChangeLoadProgress(double progress) OVERRIDE;
[email protected]87717d0e2012-04-26 02:58:43298 virtual void DocumentAvailableInMainFrame(
299 content::RenderViewHost* render_view_host) OVERRIDE;
[email protected]952a68e2011-11-17 00:36:10300 virtual void DocumentOnLoadCompletedInMainFrame(
[email protected]eaabba22012-03-07 15:02:11301 content::RenderViewHost* render_view_host,
[email protected]952a68e2011-11-17 00:36:10302 int32 page_id) OVERRIDE;
[email protected]196159d2012-05-04 17:26:54303 virtual void RequestOpenURL(content::RenderViewHost* rvh,
304 const GURL& url,
[email protected]445e1042011-12-03 21:03:15305 const content::Referrer& referrer,
[email protected]952a68e2011-11-17 00:36:10306 WindowOpenDisposition disposition,
307 int64 source_frame_id) OVERRIDE;
[email protected]4ad5d77d2011-12-03 02:00:48308 virtual void RequestTransferURL(
309 const GURL& url,
[email protected]bce1f1c2011-12-05 15:11:58310 const content::Referrer& referrer,
[email protected]4ad5d77d2011-12-03 02:00:48311 WindowOpenDisposition disposition,
312 int64 source_frame_id,
[email protected]e5d549d2011-12-28 01:29:20313 const content::GlobalRequestID& transferred_global_request_id) OVERRIDE;
[email protected]e1c3a552012-05-04 20:51:32314 virtual void RouteCloseEvent(content::RenderViewHost* rvh) OVERRIDE;
[email protected]f546640b2012-05-15 00:03:49315 virtual void RouteMessageEvent(
316 content::RenderViewHost* rvh,
317 const ViewMsg_PostMessage_Params& params) OVERRIDE;
[email protected]eaabba22012-03-07 15:02:11318 virtual void RunJavaScriptMessage(content::RenderViewHost* rvh,
[email protected]952a68e2011-11-17 00:36:10319 const string16& message,
320 const string16& default_prompt,
321 const GURL& frame_url,
[email protected]269f86d2011-12-07 02:43:47322 ui::JavascriptMessageType type,
[email protected]952a68e2011-11-17 00:36:10323 IPC::Message* reply_msg,
324 bool* did_suppress_message) OVERRIDE;
[email protected]eaabba22012-03-07 15:02:11325 virtual void RunBeforeUnloadConfirm(content::RenderViewHost* rvh,
[email protected]952a68e2011-11-17 00:36:10326 const string16& message,
[email protected]3b3301f62012-02-29 04:32:32327 bool is_reload,
[email protected]952a68e2011-11-17 00:36:10328 IPC::Message* reply_msg) OVERRIDE;
329 virtual content::RendererPreferences GetRendererPrefs(
330 content::BrowserContext* browser_context) const OVERRIDE;
[email protected]6717bf272012-05-11 23:31:25331 virtual webkit_glue::WebPreferences GetWebkitPrefs() OVERRIDE;
[email protected]952a68e2011-11-17 00:36:10332 virtual void OnUserGesture() OVERRIDE;
333 virtual void OnIgnoredUIEvent() OVERRIDE;
[email protected]eaabba22012-03-07 15:02:11334 virtual void RendererUnresponsive(content::RenderViewHost* render_view_host,
[email protected]952a68e2011-11-17 00:36:10335 bool is_during_unload) OVERRIDE;
[email protected]eaabba22012-03-07 15:02:11336 virtual void RendererResponsive(
337 content::RenderViewHost* render_view_host) OVERRIDE;
[email protected]952a68e2011-11-17 00:36:10338 virtual void LoadStateChanged(const GURL& url,
339 const net::LoadStateWithParam& load_state,
340 uint64 upload_position,
341 uint64 upload_size) OVERRIDE;
342 virtual void WorkerCrashed() OVERRIDE;
343 virtual void Activate() OVERRIDE;
344 virtual void Deactivate() OVERRIDE;
345 virtual void LostCapture() OVERRIDE;
346 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event,
347 bool* is_keyboard_shortcut) OVERRIDE;
348 virtual void HandleKeyboardEvent(
349 const NativeWebKeyboardEvent& event) OVERRIDE;
350 virtual void HandleMouseDown() OVERRIDE;
351 virtual void HandleMouseUp() OVERRIDE;
352 virtual void HandleMouseActivate() OVERRIDE;
[email protected]edc64de2011-11-17 20:07:38353 virtual void RunFileChooser(
[email protected]eaabba22012-03-07 15:02:11354 content::RenderViewHost* render_view_host,
[email protected]8caadeb2011-11-22 02:45:23355 const content::FileChooserParams& params) OVERRIDE;
[email protected]952a68e2011-11-17 00:36:10356 virtual void ToggleFullscreenMode(bool enter_fullscreen) OVERRIDE;
357 virtual bool IsFullscreenForCurrentTab() const OVERRIDE;
358 virtual void UpdatePreferredSize(const gfx::Size& pref_size) OVERRIDE;
[email protected]61e2b3cc2012-03-02 16:13:34359 virtual void ResizeDueToAutoResize(const gfx::Size& new_size) OVERRIDE;
[email protected]42252e02012-04-26 16:29:39360 virtual void RequestToLockMouse(bool user_gesture) OVERRIDE;
[email protected]952a68e2011-11-17 00:36:10361 virtual void LostMouseLock() OVERRIDE;
362
[email protected]0bfbf882011-12-22 18:19:27363 // RenderViewHostManager::Delegate -------------------------------------------
364
365 virtual bool CreateRenderViewForRenderManager(
[email protected]14392a52012-05-02 20:28:44366 content::RenderViewHost* render_view_host, int opener_route_id) OVERRIDE;
[email protected]0bfbf882011-12-22 18:19:27367 virtual void BeforeUnloadFiredFromRenderManager(
368 bool proceed,
369 bool* proceed_to_fire_unload) OVERRIDE;
370 virtual void DidStartLoadingFromRenderManager(
[email protected]eaabba22012-03-07 15:02:11371 content::RenderViewHost* render_view_host) OVERRIDE;
[email protected]0bfbf882011-12-22 18:19:27372 virtual void RenderViewGoneFromRenderManager(
[email protected]eaabba22012-03-07 15:02:11373 content::RenderViewHost* render_view_host) OVERRIDE;
[email protected]0bfbf882011-12-22 18:19:27374 virtual void UpdateRenderViewSizeForRenderManager() OVERRIDE;
375 virtual void NotifySwappedFromRenderManager() OVERRIDE;
[email protected]14392a52012-05-02 20:28:44376 virtual int CreateOpenerRenderViewsForRenderManager(
377 content::SiteInstance* instance) OVERRIDE;
[email protected]d202a7c2012-01-04 07:53:47378 virtual NavigationControllerImpl& GetControllerForRenderManager() OVERRIDE;
[email protected]d2353452012-01-19 19:53:56379 virtual WebUIImpl* CreateWebUIForRenderManager(const GURL& url) OVERRIDE;
[email protected]ad23a092011-12-28 07:02:04380 virtual content::NavigationEntry*
[email protected]0bfbf882011-12-22 18:19:27381 GetLastCommittedNavigationEntryForRenderManager() OVERRIDE;
382 virtual bool FocusLocationBarByDefault() OVERRIDE;
383 virtual void SetFocusToLocationBar(bool select_all) OVERRIDE;
[email protected]eaabba22012-03-07 15:02:11384 virtual void CreateViewAndSetSizeForRVH(
385 content::RenderViewHost* rvh) OVERRIDE;
[email protected]0bfbf882011-12-22 18:19:27386
[email protected]14392a52012-05-02 20:28:44387 // content::NotificationObserver ---------------------------------------------
388
389 virtual void Observe(int type,
390 const content::NotificationSource& source,
391 const content::NotificationDetails& details) OVERRIDE;
392
[email protected]0dd3a0ab2011-02-18 08:17:44393 protected:
[email protected]d8c660432011-12-22 20:51:25394 friend class content::WebContentsObserver;
[email protected]553602e12011-04-05 17:01:18395
396 // Add and remove observers for page navigation notifications. Adding or
397 // removing multiple times has no effect. The order in which notifications
398 // are sent to observers is undefined. Clients must be sure to remove the
399 // observer before they go away.
[email protected]d8c660432011-12-22 20:51:25400 void AddObserver(content::WebContentsObserver* observer);
401 void RemoveObserver(content::WebContentsObserver* observer);
[email protected]553602e12011-04-05 17:01:18402
[email protected]0dd3a0ab2011-02-18 08:17:44403 private:
[email protected]d202a7c2012-01-04 07:53:47404 friend class NavigationControllerImpl;
[email protected]0dd3a0ab2011-02-18 08:17:44405
[email protected]2db9bd72012-04-13 20:20:56406 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, NoJSMessageOnInterstitials);
407 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, UpdateTitle);
408 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest,
409 CrossSiteCantPreemptAfterUnload);
[email protected]0dd3a0ab2011-02-18 08:17:44410 FRIEND_TEST_ALL_PREFIXES(FormStructureBrowserTest, HTMLFiles);
411 FRIEND_TEST_ALL_PREFIXES(NavigationControllerTest, HistoryNavigate);
412 FRIEND_TEST_ALL_PREFIXES(RenderViewHostManagerTest, PageDoesBackAndReload);
413
[email protected]cadaec52012-02-08 21:53:13414 // So InterstitialPageImpl can access SetIsLoading.
415 friend class InterstitialPageImpl;
[email protected]0dd3a0ab2011-02-18 08:17:44416
[email protected]80e776ae2012-03-23 16:17:20417 // TODO(brettw) TestWebContents shouldn't exist!
418 friend class content::TestWebContents;
[email protected]0dd3a0ab2011-02-18 08:17:44419
[email protected]14392a52012-05-02 20:28:44420 // Clears this tab's opener if it has been closed.
421 void OnWebContentsDestroyed(content::WebContents* web_contents);
422
[email protected]51da7e32012-01-30 19:24:52423 // Callback function when showing JS dialogs.
[email protected]eaabba22012-03-07 15:02:11424 void OnDialogClosed(content::RenderViewHost* rvh,
[email protected]51da7e32012-01-30 19:24:52425 IPC::Message* reply_msg,
426 bool success,
427 const string16& user_input);
428
[email protected]d0759f492012-04-19 22:50:50429 // IPC message handlers.
[email protected]8b5af492011-11-28 21:50:58430 void OnRegisterIntentService(const string16& action,
[email protected]63c239322011-10-31 23:56:30431 const string16& type,
432 const string16& href,
433 const string16& title,
434 const string16& disposition);
[email protected]678105012011-12-09 04:01:21435 void OnWebIntentDispatch(const webkit_glue::WebIntentData& intent,
[email protected]63c239322011-10-31 23:56:30436 int intent_id);
[email protected]0dd3a0ab2011-02-18 08:17:44437 void OnDidLoadResourceFromMemoryCache(const GURL& url,
[email protected]70435962011-08-02 20:13:28438 const std::string& security_info,
439 const std::string& http_request,
440 ResourceType::Type resource_type);
[email protected]0dd3a0ab2011-02-18 08:17:44441 void OnDidDisplayInsecureContent();
442 void OnDidRunInsecureContent(const std::string& security_origin,
443 const GURL& target_url);
444 void OnDocumentLoadedInFrame(int64 frame_id);
[email protected]1a55c5be2011-11-29 11:36:31445 void OnDidFinishLoad(int64 frame_id,
446 const GURL& validated_url,
447 bool is_main_frame);
448 void OnDidFailLoadWithError(int64 frame_id,
449 const GURL& validated_url,
450 bool is_main_frame,
451 int error_code,
452 const string16& error_description);
[email protected]0dd3a0ab2011-02-18 08:17:44453 void OnUpdateContentRestrictions(int restrictions);
[email protected]0dd3a0ab2011-02-18 08:17:44454 void OnGoToEntryAtOffset(int offset);
[email protected]216813952011-05-19 22:21:26455 void OnUpdateZoomLimits(int minimum_percent,
456 int maximum_percent,
457 bool remember);
[email protected]20b433a2012-05-15 21:23:46458 void OnSaveURL(const GURL& url, const content::Referrer& referrer);
[email protected]3a29a6e2011-08-24 18:26:21459 void OnEnumerateDirectory(int request_id, const FilePath& path);
[email protected]7d189022011-08-25 22:54:20460 void OnJSOutOfMemory();
[email protected]b7a756d42012-01-23 18:08:17461
[email protected]7d189022011-08-25 22:54:20462 void OnRegisterProtocolHandler(const std::string& protocol,
463 const GURL& url,
464 const string16& title);
[email protected]b888919c2011-09-02 00:32:16465 void OnFindReply(int request_id, int number_of_matches,
466 const gfx::Rect& selection_rect, int active_match_ordinal,
467 bool final_update);
[email protected]d952a052011-09-06 18:42:45468 void OnCrashedPlugin(const FilePath& plugin_path);
[email protected]7fc4bbb2011-09-08 21:23:10469 void OnAppCacheAccessed(const GURL& manifest_url, bool blocked_by_policy);
[email protected]55578b0a2012-04-18 14:31:32470 void OnOpenColorChooser(int color_chooser_id, SkColor color);
[email protected]da8543762012-03-20 08:52:20471 void OnEndColorChooser(int color_chooser_id);
[email protected]55578b0a2012-04-18 14:31:32472 void OnSetSelectedColorInColorChooser(int color_chooser_id, SkColor color);
[email protected]8be45842012-04-13 19:49:29473 void OnPepperPluginHung(int plugin_child_id,
474 const FilePath& path,
475 bool is_hung);
[email protected]d0759f492012-04-19 22:50:50476 void OnWebUISend(const GURL& source_url,
477 const std::string& name,
478 const base::ListValue& args);
[email protected]0dd3a0ab2011-02-18 08:17:44479
480 // Changes the IsLoading state and notifies delegate as needed
481 // |details| is used to provide details on the load that just finished
482 // (but can be null if not applicable). Can be overridden.
483 void SetIsLoading(bool is_loading,
[email protected]09d31d52012-03-11 22:30:27484 content::LoadNotificationDetails* details);
[email protected]0dd3a0ab2011-02-18 08:17:44485
[email protected]0dd3a0ab2011-02-18 08:17:44486 // Called by derived classes to indicate that we're no longer waiting for a
487 // response. This won't actually update the throbber, but it will get picked
488 // up at the next animation step if the throbber is going.
489 void SetNotWaitingForResponse() { waiting_for_response_ = false; }
490
[email protected]0dd3a0ab2011-02-18 08:17:44491 // Navigation helpers --------------------------------------------------------
492 //
493 // These functions are helpers for Navigate() and DidNavigate().
494
495 // Handles post-navigation tasks in DidNavigate AFTER the entry has been
496 // committed to the navigation controller. Note that the navigation entry is
497 // not provided since it may be invalid/changed after being committed. The
498 // current navigation entry is in the NavigationController at this point.
499 void DidNavigateMainFramePostCommit(
[email protected]8286f51a2011-05-31 17:39:13500 const content::LoadCommittedDetails& details,
[email protected]0dd3a0ab2011-02-18 08:17:44501 const ViewHostMsg_FrameNavigate_Params& params);
502 void DidNavigateAnyFramePostCommit(
[email protected]eaabba22012-03-07 15:02:11503 content::RenderViewHost* render_view_host,
[email protected]8286f51a2011-05-31 17:39:13504 const content::LoadCommittedDetails& details,
[email protected]0dd3a0ab2011-02-18 08:17:44505 const ViewHostMsg_FrameNavigate_Params& params);
506
[email protected]74ce1ad2011-12-16 21:51:46507 // If our controller was restored, update the max page ID associated with the
508 // given RenderViewHost to be larger than the number of restored entries.
509 // This is called in CreateRenderView before any navigations in the RenderView
510 // have begun, to prevent any races in updating RenderView::next_page_id.
[email protected]eaabba22012-03-07 15:02:11511 void UpdateMaxPageIDIfNecessary(content::RenderViewHost* rvh);
[email protected]0dd3a0ab2011-02-18 08:17:44512
[email protected]0dd3a0ab2011-02-18 08:17:44513 // Saves the given title to the navigation entry and does associated work. It
514 // will update history and the view for the new title, and also synthesize
515 // titles for file URLs that have none (so we require that the URL of the
516 // entry already be set).
517 //
518 // This is used as the backend for state updates, which include a new title,
519 // or the dedicated set title message. It returns true if the new title is
520 // different and was therefore updated.
[email protected]10f417c52011-12-28 21:04:23521 bool UpdateTitleForEntry(content::NavigationEntryImpl* entry,
522 const string16& title);
[email protected]0dd3a0ab2011-02-18 08:17:44523
[email protected]b172aee2012-04-10 17:05:26524 // Causes the WebContentsImpl to navigate in the right renderer to |entry|,
525 // which must be already part of the entries in the navigation controller.
[email protected]0dd3a0ab2011-02-18 08:17:44526 // This does not change the NavigationController state.
[email protected]10f417c52011-12-28 21:04:23527 bool NavigateToEntry(const content::NavigationEntryImpl& entry,
[email protected]71fde352011-12-29 03:29:56528 content::NavigationController::ReloadType reload_type);
[email protected]0dd3a0ab2011-02-18 08:17:44529
[email protected]b172aee2012-04-10 17:05:26530 // Sets the history for this WebContentsImpl to |history_length| entries, and
[email protected]796931a92011-08-10 01:32:14531 // moves the current page_id to the last entry in the list if it's valid.
532 // This is mainly used when a prerendered page is swapped into the current
[email protected]9e1ad4b2011-08-14 16:49:19533 // tab. The method is virtual for testing.
[email protected]b6583592012-01-25 19:52:33534 virtual void SetHistoryLengthAndPrune(
535 const content::SiteInstance* site_instance,
536 int merge_history_length,
537 int32 minimum_page_id);
[email protected]796931a92011-08-10 01:32:14538
[email protected]14392a52012-05-02 20:28:44539 // Recursively creates swapped out RenderViews for this tab's opener chain
540 // (including this tab) in the given SiteInstance, allowing other tabs to send
541 // cross-process JavaScript calls to their opener(s). Returns the route ID of
542 // this tab's RenderView for |instance|.
543 int CreateOpenerRenderViews(content::SiteInstance* instance);
544
[email protected]0dd3a0ab2011-02-18 08:17:44545 // Misc non-view stuff -------------------------------------------------------
546
547 // Helper functions for sending notifications.
548 void NotifySwapped();
549 void NotifyConnected();
550 void NotifyDisconnected();
551
[email protected]be1f56ab2011-12-22 06:55:31552 void SetEncoding(const std::string& encoding);
553
[email protected]27678b2a2012-02-04 22:09:14554 // Save a URL to the local filesystem.
[email protected]20b433a2012-05-15 21:23:46555 void SaveURL(const GURL& url,
556 const content::Referrer& referrer,
557 bool is_main_frame);
[email protected]27678b2a2012-02-04 22:09:14558
[email protected]eaabba22012-03-07 15:02:11559 content::RenderViewHostImpl* GetRenderViewHostImpl();
[email protected]9f76c1e2012-03-05 15:15:58560
[email protected]81898992011-06-14 22:15:00561 // Stores random bits of data for others to associate with this object.
562 // WARNING: this needs to be deleted after NavigationController.
[email protected]45644f62011-11-23 00:58:23563 base::PropertyBag property_bag_;
[email protected]81898992011-06-14 22:15:00564
[email protected]14392a52012-05-02 20:28:44565 // Listen for notifications as well.
566 content::NotificationRegistrar registrar_;
567
[email protected]0dd3a0ab2011-02-18 08:17:44568 // Data for core operation ---------------------------------------------------
569
570 // Delegate for notifying our owner about stuff. Not owned by us.
[email protected]674bc592011-12-20 23:00:42571 content::WebContentsDelegate* delegate_;
[email protected]0dd3a0ab2011-02-18 08:17:44572
573 // Handles the back/forward list and loading.
[email protected]d202a7c2012-01-04 07:53:47574 NavigationControllerImpl controller_;
[email protected]0dd3a0ab2011-02-18 08:17:44575
576 // The corresponding view.
[email protected]8643e6d2012-01-18 20:26:10577 scoped_ptr<content::WebContentsView> view_;
[email protected]0dd3a0ab2011-02-18 08:17:44578
[email protected]996042972011-11-08 22:43:59579 // A list of observers notified when page state changes. Weak references.
580 // This MUST be listed above render_manager_ since at destruction time the
581 // latter might cause RenderViewHost's destructor to call us and we might use
582 // the observer list then.
[email protected]d8c660432011-12-22 20:51:25583 ObserverList<content::WebContentsObserver> observers_;
[email protected]996042972011-11-08 22:43:59584
[email protected]14392a52012-05-02 20:28:44585 // The tab that opened this tab, if any. Will be set to null if the opener
586 // is closed.
587 WebContentsImpl* opener_;
588
[email protected]86ef6a392012-05-11 22:03:11589 // User agent to use if a NavigationEntry requires that the default user agent
590 // is overridden.
591 std::string user_agent_override_;
592
[email protected]0dd3a0ab2011-02-18 08:17:44593 // Helper classes ------------------------------------------------------------
594
595 // Manages creation and swapping of render views.
596 RenderViewHostManager render_manager_;
597
[email protected]483623eb2011-10-25 09:30:00598 // Manages injecting Java objects into all RenderViewHosts associated with
[email protected]b172aee2012-04-10 17:05:26599 // this WebContentsImpl.
[email protected]483623eb2011-10-25 09:30:00600 scoped_ptr<JavaBridgeDispatcherHostManager>
601 java_bridge_dispatcher_host_manager_;
602
[email protected]8dd709fb2012-04-06 00:49:06603 scoped_ptr<content::BrowserPluginWebContentsObserver>
604 browser_plugin_web_contents_observer_;
[email protected]c7dd2f62011-07-18 15:57:59605 // SavePackage, lazily created.
606 scoped_refptr<SavePackage> save_package_;
607
[email protected]0dd3a0ab2011-02-18 08:17:44608 // Data for loading state ----------------------------------------------------
609
610 // Indicates whether we're currently loading a resource.
611 bool is_loading_;
612
613 // Indicates if the tab is considered crashed.
614 base::TerminationStatus crashed_status_;
615 int crashed_error_code_;
616
[email protected]ca13a442012-04-17 14:00:12617 // Whether this WebContents is waiting for a first-response for the
[email protected]be1f56ab2011-12-22 06:55:31618 // main resource of the page. This controls whether the throbber state is
619 // "waiting" or "loading."
[email protected]0dd3a0ab2011-02-18 08:17:44620 bool waiting_for_response_;
621
[email protected]74ce1ad2011-12-16 21:51:46622 // Map of SiteInstance ID to max page ID for this tab. A page ID is specific
623 // to a given tab and SiteInstance, and must be valid for the lifetime of the
[email protected]b172aee2012-04-10 17:05:26624 // WebContentsImpl.
[email protected]74ce1ad2011-12-16 21:51:46625 std::map<int32, int32> max_page_ids_;
[email protected]0dd3a0ab2011-02-18 08:17:44626
627 // System time at which the current load was started.
628 base::TimeTicks current_load_start_;
629
630 // The current load state and the URL associated with it.
[email protected]9c235f042011-08-10 22:28:21631 net::LoadStateWithParam load_state_;
[email protected]0dd3a0ab2011-02-18 08:17:44632 string16 load_state_host_;
633 // Upload progress, for displaying in the status bar.
634 // Set to zero when there is no significant upload happening.
635 uint64 upload_size_;
636 uint64 upload_position_;
637
638 // Data for current page -----------------------------------------------------
639
[email protected]987fc3a2011-05-26 14:18:09640 // When a title cannot be taken from any entry, this title will be used.
641 string16 page_title_when_no_navigation_entry_;
642
[email protected]0dd3a0ab2011-02-18 08:17:44643 // When a navigation occurs, we record its contents MIME type. It can be
644 // used to check whether we can do something for some special contents.
645 std::string contents_mime_type_;
646
647 // Character encoding.
648 std::string encoding_;
649
[email protected]0dd3a0ab2011-02-18 08:17:44650 // True if this is a secure page which displayed insecure content.
651 bool displayed_insecure_content_;
652
[email protected]0dd3a0ab2011-02-18 08:17:44653 // Data for misc internal state ----------------------------------------------
654
[email protected]ca13a442012-04-17 14:00:12655 // Whether the WebContents is currently being screenshotted.
[email protected]0dd3a0ab2011-02-18 08:17:44656 bool capturing_contents_;
657
658 // See getter above.
659 bool is_being_destroyed_;
660
661 // Indicates whether we should notify about disconnection of this
[email protected]b172aee2012-04-10 17:05:26662 // WebContentsImpl. This is used to ensure disconnection notifications only
[email protected]0dd3a0ab2011-02-18 08:17:44663 // happen if a connection notification has happened and that they happen only
664 // once.
665 bool notify_disconnection_;
666
[email protected]2e5b90c2011-08-16 21:11:55667 // Pointer to the JavaScript dialog creator, lazily assigned. Used because the
[email protected]b172aee2012-04-10 17:05:26668 // delegate of this WebContentsImpl is nulled before its destructor is called.
[email protected]2e5b90c2011-08-16 21:11:55669 content::JavaScriptDialogCreator* dialog_creator_;
670
[email protected]0dd3a0ab2011-02-18 08:17:44671#if defined(OS_WIN)
672 // Handle to an event that's set when the page is showing a message box (or
673 // equivalent constrained window). Plugin processes check this to know if
674 // they should pump messages then.
675 base::win::ScopedHandle message_box_active_;
676#endif
677
[email protected]0dd3a0ab2011-02-18 08:17:44678 // Set to true when there is an active "before unload" dialog. When true,
679 // we've forced the throbber to start in Navigate, and we need to remember to
680 // turn it off in OnJavaScriptMessageBoxClosed if the navigation is canceled.
681 bool is_showing_before_unload_dialog_;
682
[email protected]0dd3a0ab2011-02-18 08:17:44683 // Settings that get passed to the renderer process.
[email protected]daf82f82011-10-31 22:35:31684 content::RendererPreferences renderer_preferences_;
[email protected]0dd3a0ab2011-02-18 08:17:44685
686 // If this tab was created from a renderer using window.open, this will be
687 // non-NULL and represent the WebUI of the opening renderer.
[email protected]01ec4ec2012-01-18 04:13:47688 content::WebUI::TypeID opener_web_ui_type_;
[email protected]0dd3a0ab2011-02-18 08:17:44689
690 // The time that we started to create the new tab page.
691 base::TimeTicks new_tab_start_time_;
692
[email protected]3bbacc5b2012-04-17 17:46:15693 // The time that we started to close this WebContents.
694 base::TimeTicks close_start_time_;
[email protected]0dd3a0ab2011-02-18 08:17:44695
696 // The time that this tab was last selected.
697 base::TimeTicks last_selected_time_;
698
[email protected]0dd3a0ab2011-02-18 08:17:44699 // See description above setter.
700 bool closed_by_user_gesture_;
701
702 // Minimum/maximum zoom percent.
703 int minimum_zoom_percent_;
704 int maximum_zoom_percent_;
705 // If true, the default zoom limits have been overriden for this tab, in which
706 // case we don't want saved settings to apply to it and we don't want to
707 // remember it.
708 bool temporary_zoom_settings_;
709
[email protected]bcd2815602012-01-14 18:17:23710 // The intrinsic size of the page.
711 gfx::Size preferred_size_;
712
[email protected]0dd3a0ab2011-02-18 08:17:44713 // Content restrictions, used to disable print/copy etc based on content's
714 // (full-page plugins for now only) permissions.
715 int content_restrictions_;
716
[email protected]c8160f22012-05-14 06:44:03717 // Type of view this WebContents is displaying.
[email protected]32ded2212011-11-10 18:51:43718 content::ViewType view_type_;
719
[email protected]da8543762012-03-20 08:52:20720 // Color chooser that was opened by this tab.
721 content::ColorChooser* color_chooser_;
722
[email protected]b172aee2012-04-10 17:05:26723 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl);
[email protected]0dd3a0ab2011-02-18 08:17:44724};
725
[email protected]93ddb3c2012-04-11 21:44:29726#endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_