summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/ui/browser_tab_strip_model_delegate.cc4
-rw-r--r--chrome/browser/ui/browser_tab_strip_model_delegate.h3
-rw-r--r--chrome/browser/ui/tabs/tab_strip_model.cc6
-rw-r--r--chrome/browser/ui/tabs/tab_strip_model_delegate.h9
-rw-r--r--chrome/browser/ui/tabs/tab_strip_model_unittest.cc3
-rw-r--r--chrome/browser/ui/tabs/test_tab_strip_model_delegate.cc2
-rw-r--r--chrome/browser/ui/tabs/test_tab_strip_model_delegate.h3
7 files changed, 17 insertions, 13 deletions
diff --git a/chrome/browser/ui/browser_tab_strip_model_delegate.cc b/chrome/browser/ui/browser_tab_strip_model_delegate.cc
index 119172f..42f5e3f 100644
--- a/chrome/browser/ui/browser_tab_strip_model_delegate.cc
+++ b/chrome/browser/ui/browser_tab_strip_model_delegate.cc
@@ -142,8 +142,8 @@ void BrowserTabStripModelDelegate::CreateHistoricalTab(
}
bool BrowserTabStripModelDelegate::RunUnloadListenerBeforeClosing(
- TabContents* contents) {
- return Browser::RunUnloadEventsHelper(contents->web_contents());
+ content::WebContents* contents) {
+ return Browser::RunUnloadEventsHelper(contents);
}
bool BrowserTabStripModelDelegate::CanBookmarkAllTabs() const {
diff --git a/chrome/browser/ui/browser_tab_strip_model_delegate.h b/chrome/browser/ui/browser_tab_strip_model_delegate.h
index 8703a80..273c8ba 100644
--- a/chrome/browser/ui/browser_tab_strip_model_delegate.h
+++ b/chrome/browser/ui/browser_tab_strip_model_delegate.h
@@ -50,7 +50,8 @@ class BrowserTabStripModelDelegate : public TabStripModelDelegate {
virtual void DuplicateContentsAt(int index) OVERRIDE;
virtual void CloseFrameAfterDragSession() OVERRIDE;
virtual void CreateHistoricalTab(content::WebContents* contents) OVERRIDE;
- virtual bool RunUnloadListenerBeforeClosing(TabContents* contents) OVERRIDE;
+ virtual bool RunUnloadListenerBeforeClosing(
+ content::WebContents* contents) OVERRIDE;
virtual bool CanBookmarkAllTabs() const OVERRIDE;
virtual void BookmarkAllTabs() OVERRIDE;
virtual bool CanRestoreTab() OVERRIDE;
diff --git a/chrome/browser/ui/tabs/tab_strip_model.cc b/chrome/browser/ui/tabs/tab_strip_model.cc
index 4ab2cf7..00a15e9 100644
--- a/chrome/browser/ui/tabs/tab_strip_model.cc
+++ b/chrome/browser/ui/tabs/tab_strip_model.cc
@@ -1157,13 +1157,13 @@ bool TabStripModel::InternalCloseTabs(const std::vector<int>& indices,
close_types & CLOSE_USER_GESTURE);
}
- TabContents* closing_tab_contents =
- TabContents::FromWebContents(closing_contents);
- if (delegate_->RunUnloadListenerBeforeClosing(closing_tab_contents)) {
+ if (delegate_->RunUnloadListenerBeforeClosing(closing_contents)) {
retval = false;
continue;
}
+ TabContents* closing_tab_contents =
+ TabContents::FromWebContents(closing_contents);
InternalCloseTab(closing_tab_contents, index,
(close_types & CLOSE_CREATE_HISTORICAL_TAB) != 0);
}
diff --git a/chrome/browser/ui/tabs/tab_strip_model_delegate.h b/chrome/browser/ui/tabs/tab_strip_model_delegate.h
index e9cb6fd..2fcdb3d 100644
--- a/chrome/browser/ui/tabs/tab_strip_model_delegate.h
+++ b/chrome/browser/ui/tabs/tab_strip_model_delegate.h
@@ -103,12 +103,13 @@ class TabStripModelDelegate {
// WebContents.
virtual void CreateHistoricalTab(content::WebContents* contents) = 0;
- // Runs any unload listeners associated with the specified TabContents
+ // Runs any unload listeners associated with the specified WebContents
// before it is closed. If there are unload listeners that need to be run,
// this function returns true and the TabStripModel will wait before closing
- // the TabContents. If it returns false, there are no unload listeners
- // and the TabStripModel can close the TabContents immediately.
- virtual bool RunUnloadListenerBeforeClosing(TabContents* contents) = 0;
+ // the WebContents. If it returns false, there are no unload listeners
+ // and the TabStripModel will close the WebContents immediately.
+ virtual bool RunUnloadListenerBeforeClosing(
+ content::WebContents* contents) = 0;
// Returns true if a tab can be restored.
virtual bool CanRestoreTab() = 0;
diff --git a/chrome/browser/ui/tabs/tab_strip_model_unittest.cc b/chrome/browser/ui/tabs/tab_strip_model_unittest.cc
index 43ca540..6e9c56e 100644
--- a/chrome/browser/ui/tabs/tab_strip_model_unittest.cc
+++ b/chrome/browser/ui/tabs/tab_strip_model_unittest.cc
@@ -107,7 +107,8 @@ class TabStripDummyDelegate : public TestTabStripModelDelegate {
return dummy_contents_;
return NULL;
}
- virtual bool RunUnloadListenerBeforeClosing(TabContents* contents) OVERRIDE {
+ virtual bool RunUnloadListenerBeforeClosing(
+ content::WebContents* contents) OVERRIDE {
return run_unload_;
}
diff --git a/chrome/browser/ui/tabs/test_tab_strip_model_delegate.cc b/chrome/browser/ui/tabs/test_tab_strip_model_delegate.cc
index 5d389ca..afac1ff 100644
--- a/chrome/browser/ui/tabs/test_tab_strip_model_delegate.cc
+++ b/chrome/browser/ui/tabs/test_tab_strip_model_delegate.cc
@@ -57,7 +57,7 @@ void TestTabStripModelDelegate::CreateHistoricalTab(
}
bool TestTabStripModelDelegate::RunUnloadListenerBeforeClosing(
- TabContents* contents) {
+ content::WebContents* contents) {
return true;
}
diff --git a/chrome/browser/ui/tabs/test_tab_strip_model_delegate.h b/chrome/browser/ui/tabs/test_tab_strip_model_delegate.h
index 0962098..9f7d41c 100644
--- a/chrome/browser/ui/tabs/test_tab_strip_model_delegate.h
+++ b/chrome/browser/ui/tabs/test_tab_strip_model_delegate.h
@@ -34,7 +34,8 @@ class TestTabStripModelDelegate : public TabStripModelDelegate {
virtual void DuplicateContentsAt(int index) OVERRIDE;
virtual void CloseFrameAfterDragSession() OVERRIDE;
virtual void CreateHistoricalTab(content::WebContents* contents) OVERRIDE;
- virtual bool RunUnloadListenerBeforeClosing(TabContents* contents) OVERRIDE;
+ virtual bool RunUnloadListenerBeforeClosing(
+ content::WebContents* contents) OVERRIDE;
virtual bool CanRestoreTab() OVERRIDE;
virtual void RestoreTab() OVERRIDE;
virtual bool CanBookmarkAllTabs() const OVERRIDE;