Skip to content

Commit

Permalink
Disable Prediction Service - DNS prefetching
Browse files Browse the repository at this point in the history
  • Loading branch information
bbondy committed Aug 19, 2018
1 parent 1e10d6d commit c89f616
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions browser/brave_profile_prefs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "brave/browser/alternate_private_search_engine_util.h"
#include "brave/common/pref_names.h"
#include "brave/components/brave_shields/browser/brave_shields_web_contents_observer.h"
#include "chrome/browser/net/prediction_options.h"
#include "chrome/browser/prefs/session_startup_pref.h"
#include "chrome/common/pref_names.h"
#include "components/content_settings/core/common/pref_names.h"
Expand Down Expand Up @@ -45,6 +46,10 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {

// Disable search suggestion
registry->SetDefaultPrefValue(prefs::kSearchSuggestEnabled, base::Value(false));

// Disable "Use a prediction service to load pages more quickly"
registry->SetDefaultPrefValue(prefs::kNetworkPredictionOptions,
base::Value(chrome_browser_net::NETWORK_PREDICTION_NEVER));
}

} // namespace brave
5 changes: 5 additions & 0 deletions browser/brave_profile_prefs_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "brave/common/pref_names.h"
#include "chrome/browser/net/prediction_options.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/common/pref_names.h"
Expand Down Expand Up @@ -33,4 +34,8 @@ IN_PROC_BROWSER_TEST_F(BraveProfilePrefsBrowserTest, DisableGoogleServicesByDefa
browser()->profile()->GetPrefs()->GetBoolean(prefs::kSafeBrowsingExtendedReportingOptInAllowed));
EXPECT_FALSE(
browser()->profile()->GetPrefs()->GetBoolean(prefs::kSearchSuggestEnabled));
EXPECT_EQ(
browser()->profile()->GetPrefs()->GetInteger(prefs::kNetworkPredictionOptions),
chrome_browser_net::NETWORK_PREDICTION_NEVER);

}

0 comments on commit c89f616

Please sign in to comment.