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

Side by Side Diff: chrome/browser/net/prediction_options.cc

Issue 422183002: Readd mistakenly deleted include. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/net/prediction_options.h" 5 #include "chrome/browser/net/prediction_options.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "chrome/browser/profiles/profile_io_data.h" 9 #include "chrome/browser/profiles/profile_io_data.h"
10 #include "chrome/common/pref_names.h" 10 #include "chrome/common/pref_names.h"
11 #include "components/pref_registry/pref_registry_syncable.h" 11 #include "components/pref_registry/pref_registry_syncable.h"
12 #include "content/public/browser/browser_thread.h" 12 #include "content/public/browser/browser_thread.h"
13 #include "net/base/network_change_notifier.h"
13 14
14 namespace { 15 namespace {
15 16
16 // Since looking up preferences and current network connection are presumably 17 // Since looking up preferences and current network connection are presumably
17 // both cheap, we do not cache them here. 18 // both cheap, we do not cache them here.
18 bool CanPredictNetworkActions(int NetworkPredictionOptions, 19 bool CanPredictNetworkActions(int NetworkPredictionOptions,
19 bool NetworkPredictionEnabled) { 20 bool NetworkPredictionEnabled) {
20 switch (NetworkPredictionOptions) { 21 switch (NetworkPredictionOptions) {
21 case chrome_browser_net::NETWORK_PREDICTION_ALWAYS: 22 case chrome_browser_net::NETWORK_PREDICTION_ALWAYS:
22 return true; 23 return true;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 57
57 bool CanPredictNetworkActionsUI(PrefService* prefs) { 58 bool CanPredictNetworkActionsUI(PrefService* prefs) {
58 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 59 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
59 DCHECK(prefs); 60 DCHECK(prefs);
60 return CanPredictNetworkActions( 61 return CanPredictNetworkActions(
61 prefs->GetInteger(prefs::kNetworkPredictionOptions), 62 prefs->GetInteger(prefs::kNetworkPredictionOptions),
62 prefs->GetBoolean(prefs::kNetworkPredictionEnabled)); 63 prefs->GetBoolean(prefs::kNetworkPredictionEnabled));
63 } 64 }
64 65
65 } // namespace chrome_browser_net 66 } // namespace chrome_browser_net
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698