Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2507)

Unified Diff: chrome/browser/ui/tab_contents/core_tab_helper.cc

Issue 17382005: Unbreak tabs.onRemove extension API in face of fast tab closure Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Don't modify content Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/tab_contents/core_tab_helper.cc
diff --git a/chrome/browser/ui/tab_contents/core_tab_helper.cc b/chrome/browser/ui/tab_contents/core_tab_helper.cc
index f8dc42ef7ab5af1b56897424ac89ce1f000f5b12..06492b3d21d5a857e43befbc10044a1053000bb6 100644
--- a/chrome/browser/ui/tab_contents/core_tab_helper.cc
+++ b/chrome/browser/ui/tab_contents/core_tab_helper.cc
@@ -19,7 +19,8 @@ DEFINE_WEB_CONTENTS_USER_DATA_KEY(CoreTabHelper);
CoreTabHelper::CoreTabHelper(WebContents* web_contents)
: content::WebContentsObserver(web_contents),
- delegate_(NULL) {
+ delegate_(NULL),
+ detached_as_part_of_unload_(false) {
}
CoreTabHelper::~CoreTabHelper() {
@@ -85,6 +86,10 @@ string16 CoreTabHelper::GetStatusText() const {
return string16();
}
+bool CoreTabHelper::GetWebContentsDetachedToClose() const {
+ return detached_as_part_of_unload_;
+}
+
void CoreTabHelper::OnCloseStarted() {
if (close_start_time_.is_null())
close_start_time_ = base::TimeTicks::Now();
@@ -100,6 +105,10 @@ void CoreTabHelper::OnUnloadStarted() {
before_unload_end_time_ = base::TimeTicks::Now();
}
+void CoreTabHelper::OnUnloadAboutToDetach() {
+ detached_as_part_of_unload_ = true;
+}
+
void CoreTabHelper::OnUnloadDetachedStarted() {
if (unload_detached_start_time_.is_null())
unload_detached_start_time_ = base::TimeTicks::Now();

Powered by Google App Engine
This is Rietveld 408576698