Skip to content

Commit

Permalink
Merge pull request #390 from brave/dont-hold-to-quit2
Browse files Browse the repository at this point in the history
Disable super annoying 'Hold to quit' dialog. This completely non-sta…
  • Loading branch information
bbondy authored Sep 4, 2018
2 parents 44f3cb6 + f8860fb commit 0c509c1
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
2 changes: 2 additions & 0 deletions browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,13 @@ source_set("browser_process") {

deps = [
":version_info",
"//base",
"//brave/components/brave_rewards/browser",
"//brave/components/brave_shields/browser:brave_shields",
"//brave/components/content_settings/core/browser",
"//brave/common",
"//components/component_updater",
"//components/prefs",
"//components/safe_browsing/common:safe_browsing_prefs",
"//components/search_engines",
"//components/spellcheck/browser",
Expand Down
6 changes: 6 additions & 0 deletions browser/brave_local_state_prefs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@

#include "brave/browser/brave_local_state_prefs.h"

#include "base/values.h"
#include "brave/browser/brave_stats_updater.h"
#include "chrome/common/pref_names.h"
#include "components/prefs/pref_registry_simple.h"

namespace brave {

void RegisterLocalStatePrefs(PrefRegistrySimple* registry) {
RegisterPrefsForBraveStatsUpdater(registry);
// Turn off super annoying 'Hold to quit'
registry->SetDefaultPrefValue(prefs::kConfirmToQuitEnabled,
base::Value(false));
}

} // namespace brave
2 changes: 2 additions & 0 deletions chromium_src/chrome/browser/prefs/browser_prefs.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#include "brave/browser/brave_local_state_prefs.h"
#include "../../../../chrome/browser/prefs/browser_prefs.cc"
24 changes: 8 additions & 16 deletions patches/chrome-browser-prefs-browser_prefs.cc.patch
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index b8232737dbf4dabada561044e522e44c906c53c8..cb55e2b38a40ae9141d30c5dfc27bc27a7bcc497 100644
index b8232737dbf4dabada561044e522e44c906c53c8..8bef715a4e713238d814f45e9563f2dc81638e69 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -8,6 +8,7 @@

#include "base/metrics/histogram_macros.h"
#include "base/trace_event/trace_event.h"
+#include "brave/browser/brave_local_state_prefs.h"
#include "build/build_config.h"
#include "chrome/browser/about_flags.h"
#include "chrome/browser/accessibility/accessibility_ui.h"
@@ -378,6 +379,7 @@ void RegisterProfilePrefsForMigration(

void RegisterLocalState(PrefRegistrySimple* registry) {
// Please keep this list alphabetized.
@@ -513,6 +513,7 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
#if defined(TOOLKIT_VIEWS)
RegisterBrowserViewLocalPrefs(registry);
#endif
+ brave::RegisterLocalStatePrefs(registry);
browser_shutdown::RegisterPrefs(registry);
BrowserProcessImpl::RegisterPrefs(registry);
ChromeContentBrowserClient::RegisterLocalStatePrefs(registry);
}

// Register prefs applicable to all profiles.

0 comments on commit 0c509c1

Please sign in to comment.