OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/prefetch/prefetch.h" | 5 #include "chrome/browser/prefetch/prefetch.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 // TODO(bnc): Remove this condition once the new | 24 // TODO(bnc): Remove this condition once the new |
25 // predictive preference is used on all platforms. See crbug.com/334602. | 25 // predictive preference is used on all platforms. See crbug.com/334602. |
26 if (io_data->network_prediction_options()->GetValue() == | 26 if (io_data->network_prediction_options()->GetValue() == |
27 chrome_browser_net::NETWORK_PREDICTION_UNSET && | 27 chrome_browser_net::NETWORK_PREDICTION_UNSET && |
28 net::NetworkChangeNotifier::IsConnectionCellular( | 28 net::NetworkChangeNotifier::IsConnectionCellular( |
29 net::NetworkChangeNotifier::GetConnectionType())) { | 29 net::NetworkChangeNotifier::GetConnectionType())) { |
30 return false; | 30 return false; |
31 } | 31 } |
32 | 32 |
33 return chrome_browser_net::CanPredictNetworkActionsIO(io_data) && | 33 return chrome_browser_net::CanPrefetchAndPrerenderIO(io_data) && |
34 !DisableForFieldTrial(); | 34 !DisableForFieldTrial(); |
35 } | 35 } |
36 | 36 |
37 } // namespace prefetch | 37 } // namespace prefetch |
OLD | NEW |