1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/prefetch/prefetch.h"
9 #include "base/metrics/field_trial.h"
10 #include "base/strings/string_util.h"
11 #include "chrome/browser/prefetch/prefetch_field_trial.h"
12 #include "chrome/browser/profiles/profile_io_data.h"
16 bool IsPrefetchEnabled(content::ResourceContext* resource_context) {
17 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
19 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context);
20 if (io_data != NULL && io_data->network_prediction_enabled()->GetValue())
21 return IsPrefetchFieldTrialEnabled();
25 } // namespace prefetch