Skip to content

Commit

Permalink
Remove redundant Dapp detection pref
Browse files Browse the repository at this point in the history
  • Loading branch information
bbondy committed Jul 9, 2019
1 parent e6c34eb commit e492cc2
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 16 deletions.
4 changes: 0 additions & 4 deletions browser/brave_profile_prefs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "brave/common/pref_names.h"
#include "brave/components/brave_rewards/browser/rewards_service.h"
#include "brave/components/brave_shields/browser/brave_shields_web_contents_observer.h"
#include "brave/components/brave_wallet/browser/buildflags/buildflags.h"
#include "chrome/browser/net/prediction_options.h"
#include "chrome/browser/prefs/session_startup_pref.h"
#include "chrome/common/pref_names.h"
Expand Down Expand Up @@ -130,9 +129,6 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(kNewTabPageShowClock, true);
registry->RegisterBooleanPref(kNewTabPageShowTopSites, true);
registry->RegisterBooleanPref(kNewTabPageShowStats, true);

// Dapp detection
registry->RegisterBooleanPref(kDappDetectionEnabled, true);
}

} // namespace brave
5 changes: 0 additions & 5 deletions browser/dapp/dapp_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ namespace {
base::Closure g_quit_closure_for_test;
} // namespace

bool DappDetectionEnabled(content::BrowserContext* browser_context) {
Profile* profile = Profile::FromBrowserContext(browser_context);
return profile->GetPrefs()->GetBoolean(kDappDetectionEnabled);
}

void RequestWalletInstallationPermission(content::WebContents* web_contents) {
DCHECK(web_contents);

Expand Down
1 change: 0 additions & 1 deletion browser/dapp/dapp_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class BrowserContext;
class WebContents;
} // content

bool DappDetectionEnabled(content::BrowserContext* browser_context);
void RequestWalletInstallationPermission(content::WebContents* web_contents);

void SetQuitClosureForDappDetectionTest(const base::Closure& quit_closure);
Expand Down
3 changes: 0 additions & 3 deletions browser/extensions/api/brave_shields_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,6 @@ BraveShieldsDappAvailableFunction::Run() {
brave_shields::DappAvailable::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get());

if (!DappDetectionEnabled(browser_context()))
return RespondNow(NoArguments());

#if BUILDFLAG(BRAVE_WALLET_ENABLED)
// Get web contents for this tab
content::WebContents* contents = nullptr;
Expand Down
1 change: 0 additions & 1 deletion browser/extensions/api/brave_shields_api_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,6 @@ IN_PROC_BROWSER_TEST_F(BraveShieldsAPIBrowserTest,

#if BUILDFLAG(BRAVE_WALLET_ENABLED)
IN_PROC_BROWSER_TEST_F(BraveShieldsAPIBrowserTest, DappDetectionTest) {
browser()->profile()->GetPrefs()->SetBoolean(kDappDetectionEnabled, true);
EXPECT_TRUE(
NavigateToURLUntilLoadStop("a.com", "/dapp.html"));

Expand Down
1 change: 0 additions & 1 deletion common/pref_names.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,3 @@ const char kNewTabPageShowBackgroundImage[] =
const char kNewTabPageShowClock[] = "brave.new_tab_page.show_clock";
const char kNewTabPageShowTopSites[] = "brave.new_tab_page.show_top_sites";
const char kNewTabPageShowStats[] = "brave.new_tab_page.show_stats";
const char kDappDetectionEnabled[] = "brave.dapp_detection_enabled";
1 change: 0 additions & 1 deletion common/pref_names.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,5 @@ extern const char kNewTabPageShowBackgroundImage[];
extern const char kNewTabPageShowClock[];
extern const char kNewTabPageShowTopSites[];
extern const char kNewTabPageShowStats[];
extern const char kDappDetectionEnabled[];

#endif // BRAVE_COMMON_PREF_NAMES_H_

0 comments on commit e492cc2

Please sign in to comment.