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

Unified Diff: chrome/browser/prerender/prerender_manager.cc

Issue 362013002: Poll CanPredictNetworkActionsUI in PrerenderManager::IsEnabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prerender/prerender_manager.cc
diff --git a/chrome/browser/prerender/prerender_manager.cc b/chrome/browser/prerender/prerender_manager.cc
index 18dda00fa099efec1520d641306c6dba4989b9ef..683d8602e2beea62a64dd1c84fe674c52e92d23e 100644
--- a/chrome/browser/prerender/prerender_manager.cc
+++ b/chrome/browser/prerender/prerender_manager.cc
@@ -25,6 +25,7 @@
#include "chrome/browser/common/cancelable_request.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/net/chrome_cookie_notification_details.h"
+#include "chrome/browser/net/prediction_options.h"
#include "chrome/browser/predictors/predictor_database.h"
#include "chrome/browser/predictors/predictor_database_factory.h"
#include "chrome/browser/prerender/prerender_condition.h"
@@ -1867,6 +1868,14 @@ void PrerenderManager::RecordNetworkBytes(Origin origin,
bool PrerenderManager::IsEnabled() const {
DCHECK(CalledOnValidThread());
+
+ // TODO(bnc): remove conditional as per crbug.com/334602.
+ if (profile_ && profile_->GetPrefs() &&
+ profile_->GetPrefs()->GetInteger(prefs::kNetworkPredictionOptions) !=
+ chrome_browser_net::NETWORK_PREDICTION_UNSET) {
+ return chrome_browser_net::CanPredictNetworkActionsUI(profile_->GetPrefs());
+ }
+ // TODO(bnc): remove rest of method as per crbug.com/334602.
if (!enabled_)
return false;
for (std::list<const PrerenderCondition*>::const_iterator it =
« 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