Index: chrome/browser/sessions/session_restore_delegate.cc |
diff --git a/chrome/browser/sessions/session_restore_delegate.cc b/chrome/browser/sessions/session_restore_delegate.cc |
index a24167ae1f24bfbbbee5a6f895ec54570c6097ca..e1b8d823040f72235ac821546ff4aaba548c07e6 100644 |
--- a/chrome/browser/sessions/session_restore_delegate.cc |
+++ b/chrome/browser/sessions/session_restore_delegate.cc |
@@ -4,6 +4,7 @@ |
#include "chrome/browser/sessions/session_restore_delegate.h" |
+#include "base/metrics/field_trial.h" |
#include "chrome/browser/sessions/session_restore_stats_collector.h" |
#include "chrome/browser/sessions/tab_loader.h" |
@@ -11,6 +12,14 @@ |
void SessionRestoreDelegate::RestoreTabs( |
const std::vector<RestoredTab>& tabs, |
const base::TimeTicks& restore_started) { |
- SessionRestoreStatsCollector::TrackTabs(tabs, restore_started); |
- TabLoader::RestoreTabs(tabs, restore_started); |
+ // TODO(georgesak): make tests aware of that behavior so that they succeed if |
+ // tab loading is disabled. |
+ base::FieldTrial* trial = |
+ base::FieldTrialList::Find("SessionRestoreBackgroundLoading"); |
+ bool active_only = true; |
+ if (!trial || trial->group_name() != "Disabled") { |
+ TabLoader::RestoreTabs(tabs, restore_started); |
+ active_only = false; |
+ } |
+ SessionRestoreStatsCollector::TrackTabs(tabs, restore_started, active_only); |
} |