Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(371)

Side by Side Diff: content/browser/tab_contents/tab_contents.h

Issue 9146028: Define the public interface for content browser SiteInstance. This interface is implemented by th... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 // Causes the TabContents to navigate in the right renderer to |entry|, which 477 // Causes the TabContents to navigate in the right renderer to |entry|, which
478 // must be already part of the entries in the navigation controller. 478 // must be already part of the entries in the navigation controller.
479 // This does not change the NavigationController state. 479 // This does not change the NavigationController state.
480 bool NavigateToEntry(const content::NavigationEntryImpl& entry, 480 bool NavigateToEntry(const content::NavigationEntryImpl& entry,
481 content::NavigationController::ReloadType reload_type); 481 content::NavigationController::ReloadType reload_type);
482 482
483 // Sets the history for this tab_contents to |history_length| entries, and 483 // Sets the history for this tab_contents to |history_length| entries, and
484 // moves the current page_id to the last entry in the list if it's valid. 484 // moves the current page_id to the last entry in the list if it's valid.
485 // This is mainly used when a prerendered page is swapped into the current 485 // This is mainly used when a prerendered page is swapped into the current
486 // tab. The method is virtual for testing. 486 // tab. The method is virtual for testing.
487 virtual void SetHistoryLengthAndPrune(const SiteInstance* site_instance, 487 virtual void SetHistoryLengthAndPrune(
488 int merge_history_length, 488 const content::SiteInstance* site_instance,
489 int32 minimum_page_id); 489 int merge_history_length,
490 int32 minimum_page_id);
490 491
491 // Misc non-view stuff ------------------------------------------------------- 492 // Misc non-view stuff -------------------------------------------------------
492 493
493 // Helper functions for sending notifications. 494 // Helper functions for sending notifications.
494 void NotifySwapped(); 495 void NotifySwapped();
495 void NotifyConnected(); 496 void NotifyConnected();
496 void NotifyDisconnected(); 497 void NotifyDisconnected();
497 498
498 void SetEncoding(const std::string& encoding); 499 void SetEncoding(const std::string& encoding);
499 500
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 // (full-page plugins for now only) permissions. 642 // (full-page plugins for now only) permissions.
642 int content_restrictions_; 643 int content_restrictions_;
643 644
644 // Our view type. Default is VIEW_TYPE_TAB_CONTENTS. 645 // Our view type. Default is VIEW_TYPE_TAB_CONTENTS.
645 content::ViewType view_type_; 646 content::ViewType view_type_;
646 647
647 DISALLOW_COPY_AND_ASSIGN(TabContents); 648 DISALLOW_COPY_AND_ASSIGN(TabContents);
648 }; 649 };
649 650
650 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ 651 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_
OLDNEW
« no previous file with comments | « content/browser/tab_contents/render_view_host_manager_unittest.cc ('k') | content/browser/tab_contents/tab_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698