summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authorpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-12 19:32:29 +0000
committerpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-12 19:32:29 +0000
commit1b855cd199ca6e350e74f0a8fc65feaebbb22402 (patch)
treebbfc45b5f4dd5abb4630f0073ee37eeebac420c6 /chrome/common
parentb7bdb958fbcbd2ad6a4ec5f19fd418e3f4de6126 (diff)
downloadchromium_src-1b855cd199ca6e350e74f0a8fc65feaebbb22402.zip
chromium_src-1b855cd199ca6e350e74f0a8fc65feaebbb22402.tar.gz
chromium_src-1b855cd199ca6e350e74f0a8fc65feaebbb22402.tar.bz2
pulling over more small bites of TabContents into scaffolding.
Review URL: http://codereview.chromium.org/20312 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9687 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/temp_scaffolding_stubs.cc29
-rw-r--r--chrome/common/temp_scaffolding_stubs.h9
2 files changed, 34 insertions, 4 deletions
diff --git a/chrome/common/temp_scaffolding_stubs.cc b/chrome/common/temp_scaffolding_stubs.cc
index 846d082..cd72777 100644
--- a/chrome/common/temp_scaffolding_stubs.cc
+++ b/chrome/common/temp_scaffolding_stubs.cc
@@ -295,6 +295,35 @@ void TabContents::SetIsLoading(bool is_loading,
is_loading_ = is_loading;
}
+bool TabContents::SupportsURL(GURL* url) {
+ GURL u(*url);
+ if (TabContents::TypeForURL(&u) == type()) {
+ *url = u;
+ return true;
+ }
+ return false;
+}
+
+int32 TabContents::GetMaxPageID() {
+ if (GetSiteInstance())
+ return GetSiteInstance()->max_page_id();
+ else
+ return max_page_id_;
+}
+
+void TabContents::UpdateMaxPageID(int32 page_id) {
+ // Ensure both the SiteInstance and RenderProcessHost update their max page
+ // IDs in sync. Only WebContents will also have site instances, except during
+ // testing.
+ if (GetSiteInstance())
+ GetSiteInstance()->UpdateMaxPageID(page_id);
+
+ if (AsWebContents())
+ AsWebContents()->process()->UpdateMaxPageID(page_id);
+ else
+ max_page_id_ = std::max(max_page_id_, page_id);
+}
+
//--------------------------------------------------------------------------
bool RLZTracker::GetAccessPointRlz(AccessPoint point, std::wstring* rlz) {
diff --git a/chrome/common/temp_scaffolding_stubs.h b/chrome/common/temp_scaffolding_stubs.h
index 1f17cc9..6a7d17e 100644
--- a/chrome/common/temp_scaffolding_stubs.h
+++ b/chrome/common/temp_scaffolding_stubs.h
@@ -651,7 +651,7 @@ class TabContents : public PageNavigator, public NotificationObserver {
};
TabContents(TabContentsType type)
: type_(type), is_active_(true), is_loading_(false), controller_(),
- delegate_() { }
+ delegate_(), max_page_id_(-1) { }
virtual ~TabContents() { }
NavigationController* controller() const { return controller_; }
void set_controller(NavigationController* c) { controller_ = c; }
@@ -712,10 +712,10 @@ class TabContents : public PageNavigator, public NotificationObserver {
const gfx::Rect& initial_pos,
bool user_gesture) { NOTIMPLEMENTED(); }
virtual void Activate() { NOTIMPLEMENTED(); }
- virtual bool SupportsURL(GURL*) { NOTIMPLEMENTED(); return false; }
+ virtual bool SupportsURL(GURL*);
virtual SiteInstance* GetSiteInstance() const { return NULL; }
- int32 GetMaxPageID() { NOTIMPLEMENTED(); return 0; }
- void UpdateMaxPageID(int32) { NOTIMPLEMENTED(); }
+ int32 GetMaxPageID();
+ void UpdateMaxPageID(int32);
virtual bool NavigateToPendingEntry(bool) { NOTIMPLEMENTED(); return true; }
virtual DOMUIHost* AsDOMUIHost() { NOTIMPLEMENTED(); return NULL; }
virtual std::wstring GetStatusText() const { return std::wstring(); }
@@ -738,6 +738,7 @@ class TabContents : public PageNavigator, public NotificationObserver {
std::wstring title_;
NavigationController* controller_;
TabContentsDelegate* delegate_;
+ int32 max_page_id_;
};
class SelectFileDialog : public base::RefCountedThreadSafe<SelectFileDialog> {