summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-23 16:22:47 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-23 16:22:47 +0000
commite35ccd5520fa2315d9a78c8cfaeccc9c225824c3 (patch)
treeadf9c27f05a81c04f1a39eb450b10c11d7899e64 /content
parent99d884e1ea1ca0fd6402e18980b7706b433b6f44 (diff)
downloadchromium_src-e35ccd5520fa2315d9a78c8cfaeccc9c225824c3.zip
chromium_src-e35ccd5520fa2315d9a78c8cfaeccc9c225824c3.tar.gz
chromium_src-e35ccd5520fa2315d9a78c8cfaeccc9c225824c3.tar.bz2
Get rid of the last RenderViewHostDelegate usage in chrome.
BUG=98716 Review URL: https://chromiumcodereview.appspot.com/10407122 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138491 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/browser/web_contents/web_contents_impl.cc8
-rw-r--r--content/browser/web_contents/web_contents_impl.h2
-rw-r--r--content/public/browser/web_contents.h9
3 files changed, 19 insertions, 0 deletions
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 2facf47..14f3b27 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -1314,6 +1314,10 @@ base::TimeTicks WebContentsImpl::GetNewTabStartTime() const {
return new_tab_start_time_;
}
+void WebContentsImpl::Close() {
+ Close(GetRenderViewHost());
+}
+
void WebContentsImpl::OnCloseStarted() {
if (close_start_time_.is_null())
close_start_time_ = base::TimeTicks::Now();
@@ -1338,6 +1342,10 @@ void WebContentsImpl::SystemDragEnded() {
delegate_->DragEnded();
}
+void WebContentsImpl::UserGestureDone() {
+ OnUserGesture();
+}
+
void WebContentsImpl::SetClosedByUserGesture(bool value) {
closed_by_user_gesture_ = value;
}
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
index 6029591..c92899b 100644
--- a/content/browser/web_contents/web_contents_impl.h
+++ b/content/browser/web_contents/web_contents_impl.h
@@ -224,9 +224,11 @@ class CONTENT_EXPORT WebContentsImpl
virtual content::RendererPreferences* GetMutableRendererPrefs() OVERRIDE;
virtual void SetNewTabStartTime(const base::TimeTicks& time) OVERRIDE;
virtual base::TimeTicks GetNewTabStartTime() const OVERRIDE;
+ virtual void Close() OVERRIDE;
virtual void OnCloseStarted() OVERRIDE;
virtual bool ShouldAcceptDragAndDrop() const OVERRIDE;
virtual void SystemDragEnded() OVERRIDE;
+ virtual void UserGestureDone() OVERRIDE;
virtual void SetClosedByUserGesture(bool value) OVERRIDE;
virtual bool GetClosedByUserGesture() const OVERRIDE;
virtual double GetZoomLevel() const OVERRIDE;
diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h
index 7df9139..0136e6a 100644
--- a/content/public/browser/web_contents.h
+++ b/content/public/browser/web_contents.h
@@ -310,6 +310,10 @@ class WebContents : public PageNavigator {
virtual void SetNewTabStartTime(const base::TimeTicks& time) = 0;
virtual base::TimeTicks GetNewTabStartTime() const = 0;
+ // Tells the tab to close now. The tab will take care not to close until it's
+ // out of nested message loops.
+ virtual void Close() = 0;
+
// Notification that tab closing has started. This can be called multiple
// times, subsequent calls are ignored.
virtual void OnCloseStarted() = 0;
@@ -321,6 +325,11 @@ class WebContents : public PageNavigator {
// WebContentsDelegate.
virtual void SystemDragEnded() = 0;
+ // Notification the user has made a gesture while focus was on the
+ // page. This is used to avoid uninitiated user downloads (aka carpet
+ // bombing), see DownloadRequestLimiter for details.
+ virtual void UserGestureDone() = 0;
+
// Indicates if this tab was explicitly closed by the user (control-w, close
// tab menu item...). This is false for actions that indirectly close the tab,
// such as closing the window. The setter is maintained by TabStripModel, and