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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 138913021: Avoid discarding freshly created background tabs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase (last_selected) Created 6 years, 10 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: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 02838bc8b8fdff01042036b2c6d1d1ad3a65dc9b..63aebf9cd1c2cf8540e9b5d6db3bc8fc4ec3b972 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -308,6 +308,7 @@ WebContentsImpl::WebContentsImpl(
notify_disconnection_(false),
dialog_manager_(NULL),
is_showing_before_unload_dialog_(false),
+ last_active_time_(base::TimeTicks::Now()),
closed_by_user_gesture_(false),
minimum_zoom_percent_(static_cast<int>(kMinimumZoomFactor * 100)),
maximum_zoom_percent_(static_cast<int>(kMaximumZoomFactor * 100)),
@@ -901,8 +902,8 @@ void WebContentsImpl::NotifyNavigationStateChanged(unsigned changed_flags) {
delegate_->NavigationStateChanged(this, changed_flags);
}
-base::TimeTicks WebContentsImpl::GetLastSelectedTime() const {
- return last_selected_time_;
+base::TimeTicks WebContentsImpl::GetLastActiveTime() const {
+ return last_active_time_;
}
void WebContentsImpl::WasShown() {
@@ -916,7 +917,7 @@ void WebContentsImpl::WasShown() {
#endif
}
- last_selected_time_ = base::TimeTicks::Now();
+ last_active_time_ = base::TimeTicks::Now();
// The resize rect might have changed while this was inactive -- send the new
// one to make sure it's up to date.
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/browser/web_contents/web_contents_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698