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

Unified Diff: chrome/browser/ui/browser_command_controller.cc

Issue 1992003002: Re-add backspace-goes-back as a default disabled finch trial (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address revieww comments Created 4 years, 7 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
Index: chrome/browser/ui/browser_command_controller.cc
diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc
index 7f16d96dedcb1bc010bbc4dda67f732d17f2d209..87f1fe6275bcae838258c55855a4f0be5d2d10a0 100644
--- a/chrome/browser/ui/browser_command_controller.cc
+++ b/chrome/browser/ui/browser_command_controller.cc
@@ -11,6 +11,7 @@
#include "base/command_line.h"
#include "base/debug/debugging_flags.h"
#include "base/debug/profiler.h"
+#include "base/feature_list.h"
#include "base/macros.h"
#include "build/build_config.h"
#include "chrome/app/chrome_command_ids.h"
@@ -117,6 +118,10 @@ bool HasInternalURL(const NavigationEntry* entry) {
namespace chrome {
+const base::Feature kBackspaceGoesBackFeature {
+ "BackspaceGoesBack", base::FEATURE_DISABLED_BY_DEFAULT
+};
+
///////////////////////////////////////////////////////////////////////////////
// BrowserCommandController, public:
@@ -315,9 +320,15 @@ void BrowserCommandController::ExecuteCommandWithDisposition(
// declaration order in browser.h!
switch (id) {
// Navigation commands
+ case IDC_BACKSPACE_BACK:
+ if (!base::FeatureList::IsEnabled(kBackspaceGoesBackFeature))
+ break;
case IDC_BACK:
GoBack(browser_, disposition);
break;
+ case IDC_BACKSPACE_FORWARD:
+ if (!base::FeatureList::IsEnabled(kBackspaceGoesBackFeature))
+ break;
case IDC_FORWARD:
GoForward(browser_, disposition);
break;
@@ -978,7 +989,11 @@ void BrowserCommandController::UpdateCommandsForTabState() {
return;
// Navigation commands
+ command_updater_.UpdateCommandEnabled(IDC_BACKSPACE_BACK,
+ CanGoBack(browser_));
command_updater_.UpdateCommandEnabled(IDC_BACK, CanGoBack(browser_));
+ command_updater_.UpdateCommandEnabled(IDC_BACKSPACE_FORWARD,
+ CanGoForward(browser_));
command_updater_.UpdateCommandEnabled(IDC_FORWARD, CanGoForward(browser_));
command_updater_.UpdateCommandEnabled(IDC_RELOAD, CanReload(browser_));
command_updater_.UpdateCommandEnabled(IDC_RELOAD_BYPASSING_CACHE,
« no previous file with comments | « chrome/browser/global_keyboard_shortcuts_mac_unittest.mm ('k') | chrome/browser/ui/views/accelerator_table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698