summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorjcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-16 21:03:40 +0000
committerjcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-16 21:03:40 +0000
commit1a3c3cb74aa206b355a68f12370160b2b2ce7b88 (patch)
tree40ae9e26119811c888681137ccafde5421b592ac /chrome/browser
parent3a5c31700cfbdc14c241536a11c416da3c2add58 (diff)
downloadchromium_src-1a3c3cb74aa206b355a68f12370160b2b2ce7b88.zip
chromium_src-1a3c3cb74aa206b355a68f12370160b2b2ce7b88.tar.gz
chromium_src-1a3c3cb74aa206b355a68f12370160b2b2ce7b88.tar.bz2
Plumbing load progress notifications to the TabContents.
Also restoring the implementation of RenderView::SetReportLoadProgressEnabled that somehow went away when I synced before committing my previous CL. BUG=None TEST=None Review URL: http://codereview.chromium.org/5925004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69461 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/renderer_host/render_view_host_delegate.h4
-rw-r--r--chrome/browser/sidebar/sidebar_container.h1
-rw-r--r--chrome/browser/tab_contents/tab_contents.cc5
-rw-r--r--chrome/browser/tab_contents/tab_contents.h1
-rw-r--r--chrome/browser/tab_contents/tab_contents_delegate.cc3
-rw-r--r--chrome/browser/tab_contents/tab_contents_delegate.h7
6 files changed, 18 insertions, 3 deletions
diff --git a/chrome/browser/renderer_host/render_view_host_delegate.h b/chrome/browser/renderer_host/render_view_host_delegate.h
index d1b3197..d769d05 100644
--- a/chrome/browser/renderer_host/render_view_host_delegate.h
+++ b/chrome/browser/renderer_host/render_view_host_delegate.h
@@ -770,9 +770,9 @@ class RenderViewHostDelegate {
virtual void DidStopLoading() {}
// The RenderView made progress loading a page's top frame.
- // |progress_load| is a value between 0 (nothing loaded) to 1.0 (top frame
+ // |progress| is a value between 0 (nothing loaded) to 1.0 (top frame
// entirely loaded).
- virtual void DidChangeLoadProgress(double load_progress) {}
+ virtual void DidChangeLoadProgress(double progress) {}
// The RenderView's main frame document element is ready. This happens when
// the document has finished parsing.
diff --git a/chrome/browser/sidebar/sidebar_container.h b/chrome/browser/sidebar/sidebar_container.h
index 3f2d19d..b519de8 100644
--- a/chrome/browser/sidebar/sidebar_container.h
+++ b/chrome/browser/sidebar/sidebar_container.h
@@ -136,4 +136,3 @@ class SidebarContainer
};
#endif // CHROME_BROWSER_SIDEBAR_SIDEBAR_CONTAINER_H_
-
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index 35de913..46498e3 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -2765,6 +2765,11 @@ void TabContents::DidStopLoading() {
DidStopLoading());
}
+void TabContents::DidChangeLoadProgress(double progress) {
+ if (delegate())
+ delegate()->LoadProgressChanged(progress);
+}
+
void TabContents::DocumentOnLoadCompletedInMainFrame(
RenderViewHost* render_view_host,
int32 page_id) {
diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h
index 629acf4..3352200 100644
--- a/chrome/browser/tab_contents/tab_contents.h
+++ b/chrome/browser/tab_contents/tab_contents.h
@@ -996,6 +996,7 @@ class TabContents : public PageNavigator,
virtual void RequestMove(const gfx::Rect& new_bounds);
virtual void DidStartLoading();
virtual void DidStopLoading();
+ virtual void DidChangeLoadProgress(double progress);
virtual void DocumentOnLoadCompletedInMainFrame(
RenderViewHost* render_view_host,
int32 page_id);
diff --git a/chrome/browser/tab_contents/tab_contents_delegate.cc b/chrome/browser/tab_contents/tab_contents_delegate.cc
index 3b16cf9..987e620 100644
--- a/chrome/browser/tab_contents/tab_contents_delegate.cc
+++ b/chrome/browser/tab_contents/tab_contents_delegate.cc
@@ -12,6 +12,9 @@ std::string TabContentsDelegate::GetNavigationHeaders(const GURL& url) {
return std::string();
}
+void TabContentsDelegate::LoadProgressChanged(double progress) {
+}
+
void TabContentsDelegate::DetachContents(TabContents* source) {
}
diff --git a/chrome/browser/tab_contents/tab_contents_delegate.h b/chrome/browser/tab_contents/tab_contents_delegate.h
index 09c560d..9b52e32 100644
--- a/chrome/browser/tab_contents/tab_contents_delegate.h
+++ b/chrome/browser/tab_contents/tab_contents_delegate.h
@@ -88,6 +88,13 @@ class TabContentsDelegate : public AutomationResourceRoutingDelegate {
// loading feedback. See TabContents::is_loading()
virtual void LoadingStateChanged(TabContents* source) = 0;
+ // Notifies the delegate that the page has made some progress loading.
+ // |progress| is a value between 0.0 (nothing loaded) to 1.0 (page fully
+ // loaded).
+ // Note that to receive this notification, you must have called
+ // SetReportLoadProgressEnabled(true) in the render view.
+ virtual void LoadProgressChanged(double progress);
+
// Request the delegate to close this tab contents, and do whatever cleanup
// it needs to do.
virtual void CloseContents(TabContents* source) = 0;