Index: chrome/browser/ui/tab_contents/core_tab_helper.h |
diff --git a/chrome/browser/ui/tab_contents/core_tab_helper.h b/chrome/browser/ui/tab_contents/core_tab_helper.h |
index 834613e5b93a22a8106a89ee591de989f73e688a..66244b266966e6a1018afa2eceb04660be2fc635 100644 |
--- a/chrome/browser/ui/tab_contents/core_tab_helper.h |
+++ b/chrome/browser/ui/tab_contents/core_tab_helper.h |
@@ -5,6 +5,7 @@ |
#ifndef CHROME_BROWSER_UI_TAB_CONTENTS_CORE_TAB_HELPER_H_ |
#define CHROME_BROWSER_UI_TAB_CONTENTS_CORE_TAB_HELPER_H_ |
+#include "base/time.h" |
#include "content/public/browser/web_contents_observer.h" |
#include "content/public/browser/web_contents_user_data.h" |
@@ -16,25 +17,53 @@ class CoreTabHelper : public content::WebContentsObserver, |
public: |
virtual ~CoreTabHelper(); |
- CoreTabHelperDelegate* delegate() const { return delegate_; } |
- void set_delegate(CoreTabHelperDelegate* d) { delegate_ = d; } |
- |
// Initial title assigned to NavigationEntries from Navigate. |
static string16 GetDefaultTitle(); |
// Returns a human-readable description the tab's loading state. |
string16 GetStatusText() const; |
+ // Notification that tab closing has started. This can be called multiple |
+ // times, subsequent calls are ignored. |
+ void OnCloseStarted(); |
+ |
+ // Notification that tab closing was cancelled. This can happen when a user |
+ // cancels a window close via another tab's beforeunload dialog. |
+ void OnCloseCanceled(); |
+ |
+ CoreTabHelperDelegate* delegate() const { return delegate_; } |
+ void set_delegate(CoreTabHelperDelegate* d) { delegate_ = d; } |
+ |
+ void set_new_tab_start_time(const base::TimeTicks& time) { |
+ new_tab_start_time_ = time; |
+ } |
+ |
+ base::TimeTicks new_tab_start_time() const { return new_tab_start_time_; } |
+ |
private: |
explicit CoreTabHelper(content::WebContents* web_contents); |
friend class content::WebContentsUserData<CoreTabHelper>; |
// content::WebContentsObserver overrides: |
virtual void WasShown() OVERRIDE; |
+ virtual void WebContentsDestroyed( |
+ content::WebContents* web_contents) OVERRIDE; |
+ virtual void BeforeUnloadFired(const base::TimeTicks& proceed_time) OVERRIDE; |
+ virtual void BeforeUnloadDialogCancelled() OVERRIDE; |
// Delegate for notifying our owner about stuff. Not owned by us. |
CoreTabHelperDelegate* delegate_; |
+ // The time when we started to create the new tab page. This time is from |
+ // before we created this WebContents. |
+ base::TimeTicks new_tab_start_time_; |
+ |
+ // The time that we started to close this WebContents. |
+ base::TimeTicks close_start_time_; |
+ |
+ // The time when onbeforeunload ended. |
+ base::TimeTicks before_unload_end_time_; |
+ |
DISALLOW_COPY_AND_ASSIGN(CoreTabHelper); |
}; |