| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ | 5 #ifndef CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ |
| 6 #define CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ | 6 #define CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <deque> | 9 #include <deque> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "webkit/glue/resource_type.h" | 28 #include "webkit/glue/resource_type.h" |
| 29 | 29 |
| 30 #if defined(OS_WIN) | 30 #if defined(OS_WIN) |
| 31 #include "base/win/scoped_handle.h" | 31 #include "base/win/scoped_handle.h" |
| 32 #endif | 32 #endif |
| 33 | 33 |
| 34 class LoadNotificationDetails; | 34 class LoadNotificationDetails; |
| 35 class RenderViewHost; | 35 class RenderViewHost; |
| 36 class SavePackage; | 36 class SavePackage; |
| 37 class SessionStorageNamespace; | 37 class SessionStorageNamespace; |
| 38 class SiteInstance; | |
| 39 struct ViewHostMsg_DidFailProvisionalLoadWithError_Params; | 38 struct ViewHostMsg_DidFailProvisionalLoadWithError_Params; |
| 40 | 39 |
| 41 namespace content { | 40 namespace content { |
| 42 class DownloadItem; | 41 class DownloadItem; |
| 42 class SiteInstance; |
| 43 class WebContentsObserver; | 43 class WebContentsObserver; |
| 44 class WebContentsDelegate; | 44 class WebContentsDelegate; |
| 45 class WebContentsView; | 45 class WebContentsView; |
| 46 } | 46 } |
| 47 | 47 |
| 48 namespace webkit_glue { | 48 namespace webkit_glue { |
| 49 struct WebIntentData; | 49 struct WebIntentData; |
| 50 } | 50 } |
| 51 | 51 |
| 52 class CONTENT_EXPORT TabContents | 52 class CONTENT_EXPORT TabContents |
| 53 : public NON_EXPORTED_BASE(content::WebContents), | 53 : public NON_EXPORTED_BASE(content::WebContents), |
| 54 public content::RenderViewHostDelegate, | 54 public content::RenderViewHostDelegate, |
| 55 public RenderViewHostManager::Delegate, | 55 public RenderViewHostManager::Delegate, |
| 56 public content::JavaScriptDialogDelegate { | 56 public content::JavaScriptDialogDelegate { |
| 57 public: | 57 public: |
| 58 // See WebContents::Create for a description of these parameters. | 58 // See WebContents::Create for a description of these parameters. |
| 59 TabContents(content::BrowserContext* browser_context, | 59 TabContents(content::BrowserContext* browser_context, |
| 60 SiteInstance* site_instance, | 60 content::SiteInstance* site_instance, |
| 61 int routing_id, | 61 int routing_id, |
| 62 const TabContents* base_tab_contents, | 62 const TabContents* base_tab_contents, |
| 63 SessionStorageNamespace* session_storage_namespace); | 63 SessionStorageNamespace* session_storage_namespace); |
| 64 virtual ~TabContents(); | 64 virtual ~TabContents(); |
| 65 | 65 |
| 66 // Returns the SavePackage which manages the page saving job. May be NULL. | 66 // Returns the SavePackage which manages the page saving job. May be NULL. |
| 67 SavePackage* save_package() const { return save_package_.get(); } | 67 SavePackage* save_package() const { return save_package_.get(); } |
| 68 | 68 |
| 69 // Updates the max page ID for the current SiteInstance in this TabContents | 69 // Updates the max page ID for the current SiteInstance in this TabContents |
| 70 // to be at least |page_id|. | 70 // to be at least |page_id|. |
| 71 void UpdateMaxPageID(int32 page_id); | 71 void UpdateMaxPageID(int32 page_id); |
| 72 | 72 |
| 73 // Updates the max page ID for the given SiteInstance in this TabContents | 73 // Updates the max page ID for the given SiteInstance in this TabContents |
| 74 // to be at least |page_id|. | 74 // to be at least |page_id|. |
| 75 void UpdateMaxPageIDForSiteInstance(SiteInstance* site_instance, | 75 void UpdateMaxPageIDForSiteInstance(content::SiteInstance* site_instance, |
| 76 int32 page_id); | 76 int32 page_id); |
| 77 | 77 |
| 78 // Copy the current map of SiteInstance ID to max page ID from another tab. | 78 // Copy the current map of SiteInstance ID to max page ID from another tab. |
| 79 // This is necessary when this tab adopts the NavigationEntries from | 79 // This is necessary when this tab adopts the NavigationEntries from |
| 80 // |tab_contents|. | 80 // |tab_contents|. |
| 81 void CopyMaxPageIDsFrom(TabContents* tab_contents); | 81 void CopyMaxPageIDsFrom(TabContents* tab_contents); |
| 82 | 82 |
| 83 // Called by the NavigationController to cause the TabContents to navigate to | 83 // Called by the NavigationController to cause the TabContents to navigate to |
| 84 // the current pending entry. The NavigationController should be called back | 84 // the current pending entry. The NavigationController should be called back |
| 85 // with RendererDidNavigate on success or DiscardPendingEntry on failure. | 85 // with RendererDidNavigate on success or DiscardPendingEntry on failure. |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 virtual content::RenderProcessHost* GetRenderProcessHost() const OVERRIDE; | 133 virtual content::RenderProcessHost* GetRenderProcessHost() const OVERRIDE; |
| 134 virtual RenderViewHost* GetRenderViewHost() const OVERRIDE; | 134 virtual RenderViewHost* GetRenderViewHost() const OVERRIDE; |
| 135 virtual RenderWidgetHostView* GetRenderWidgetHostView() const OVERRIDE; | 135 virtual RenderWidgetHostView* GetRenderWidgetHostView() const OVERRIDE; |
| 136 virtual content::WebContentsView* GetView() const OVERRIDE; | 136 virtual content::WebContentsView* GetView() const OVERRIDE; |
| 137 virtual content::WebUI* CreateWebUI(const GURL& url) OVERRIDE; | 137 virtual content::WebUI* CreateWebUI(const GURL& url) OVERRIDE; |
| 138 virtual content::WebUI* GetWebUI() const OVERRIDE; | 138 virtual content::WebUI* GetWebUI() const OVERRIDE; |
| 139 virtual content::WebUI* GetCommittedWebUI() const OVERRIDE; | 139 virtual content::WebUI* GetCommittedWebUI() const OVERRIDE; |
| 140 virtual const string16& GetTitle() const OVERRIDE; | 140 virtual const string16& GetTitle() const OVERRIDE; |
| 141 virtual int32 GetMaxPageID() OVERRIDE; | 141 virtual int32 GetMaxPageID() OVERRIDE; |
| 142 virtual int32 GetMaxPageIDForSiteInstance( | 142 virtual int32 GetMaxPageIDForSiteInstance( |
| 143 SiteInstance* site_instance) OVERRIDE; | 143 content::SiteInstance* site_instance) OVERRIDE; |
| 144 virtual SiteInstance* GetSiteInstance() const OVERRIDE; | 144 virtual content::SiteInstance* GetSiteInstance() const OVERRIDE; |
| 145 virtual SiteInstance* GetPendingSiteInstance() const OVERRIDE; | 145 virtual content::SiteInstance* GetPendingSiteInstance() const OVERRIDE; |
| 146 virtual bool IsLoading() const OVERRIDE; | 146 virtual bool IsLoading() const OVERRIDE; |
| 147 virtual bool IsWaitingForResponse() const OVERRIDE; | 147 virtual bool IsWaitingForResponse() const OVERRIDE; |
| 148 virtual const net::LoadStateWithParam& GetLoadState() const OVERRIDE; | 148 virtual const net::LoadStateWithParam& GetLoadState() const OVERRIDE; |
| 149 virtual const string16& GetLoadStateHost() const OVERRIDE; | 149 virtual const string16& GetLoadStateHost() const OVERRIDE; |
| 150 virtual uint64 GetUploadSize() const OVERRIDE; | 150 virtual uint64 GetUploadSize() const OVERRIDE; |
| 151 virtual uint64 GetUploadPosition() const OVERRIDE; | 151 virtual uint64 GetUploadPosition() const OVERRIDE; |
| 152 virtual const std::string& GetEncoding() const OVERRIDE; | 152 virtual const std::string& GetEncoding() const OVERRIDE; |
| 153 virtual bool DisplayedInsecureContent() const OVERRIDE; | 153 virtual bool DisplayedInsecureContent() const OVERRIDE; |
| 154 virtual void SetCapturingContents(bool cap) OVERRIDE; | 154 virtual void SetCapturingContents(bool cap) OVERRIDE; |
| 155 virtual bool IsCrashed() const OVERRIDE; | 155 virtual bool IsCrashed() const OVERRIDE; |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 // Causes the TabContents to navigate in the right renderer to |entry|, which | 478 // Causes the TabContents to navigate in the right renderer to |entry|, which |
| 479 // must be already part of the entries in the navigation controller. | 479 // must be already part of the entries in the navigation controller. |
| 480 // This does not change the NavigationController state. | 480 // This does not change the NavigationController state. |
| 481 bool NavigateToEntry(const content::NavigationEntryImpl& entry, | 481 bool NavigateToEntry(const content::NavigationEntryImpl& entry, |
| 482 content::NavigationController::ReloadType reload_type); | 482 content::NavigationController::ReloadType reload_type); |
| 483 | 483 |
| 484 // Sets the history for this tab_contents to |history_length| entries, and | 484 // Sets the history for this tab_contents to |history_length| entries, and |
| 485 // moves the current page_id to the last entry in the list if it's valid. | 485 // moves the current page_id to the last entry in the list if it's valid. |
| 486 // This is mainly used when a prerendered page is swapped into the current | 486 // This is mainly used when a prerendered page is swapped into the current |
| 487 // tab. The method is virtual for testing. | 487 // tab. The method is virtual for testing. |
| 488 virtual void SetHistoryLengthAndPrune(const SiteInstance* site_instance, | 488 virtual void SetHistoryLengthAndPrune( |
| 489 int merge_history_length, | 489 const content::SiteInstance* site_instance, |
| 490 int32 minimum_page_id); | 490 int merge_history_length, |
| 491 int32 minimum_page_id); |
| 491 | 492 |
| 492 // Misc non-view stuff ------------------------------------------------------- | 493 // Misc non-view stuff ------------------------------------------------------- |
| 493 | 494 |
| 494 // Helper functions for sending notifications. | 495 // Helper functions for sending notifications. |
| 495 void NotifySwapped(); | 496 void NotifySwapped(); |
| 496 void NotifyConnected(); | 497 void NotifyConnected(); |
| 497 void NotifyDisconnected(); | 498 void NotifyDisconnected(); |
| 498 | 499 |
| 499 void SetEncoding(const std::string& encoding); | 500 void SetEncoding(const std::string& encoding); |
| 500 | 501 |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 // (full-page plugins for now only) permissions. | 643 // (full-page plugins for now only) permissions. |
| 643 int content_restrictions_; | 644 int content_restrictions_; |
| 644 | 645 |
| 645 // Our view type. Default is VIEW_TYPE_TAB_CONTENTS. | 646 // Our view type. Default is VIEW_TYPE_TAB_CONTENTS. |
| 646 content::ViewType view_type_; | 647 content::ViewType view_type_; |
| 647 | 648 |
| 648 DISALLOW_COPY_AND_ASSIGN(TabContents); | 649 DISALLOW_COPY_AND_ASSIGN(TabContents); |
| 649 }; | 650 }; |
| 650 | 651 |
| 651 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ | 652 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ |
| OLD | NEW |