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

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: fix assert in test 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..9320f5a20243b05f67795d50987f1ebb5c30554d 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,6 +320,14 @@ void BrowserCommandController::ExecuteCommandWithDisposition(
// declaration order in browser.h!
switch (id) {
// Navigation commands
+ case IDC_BACKSPACE_BACK:
+ if (base::FeatureList::IsEnabled(kBackspaceGoesBackFeature))
+ GoBack(browser_, disposition);
+ break;
+ case IDC_BACKSPACE_FORWARD:
+ if (base::FeatureList::IsEnabled(kBackspaceGoesBackFeature))
+ GoForward(browser_, disposition);
+ break;
case IDC_BACK:
GoBack(browser_, disposition);
break;
Peter Kasting 2016/05/19 09:28:30 Nit: Slightly shorter, and abides by the comment a
ojan 2016/05/20 16:33:48 done
Matt Giuca 2016/05/23 01:12:01 Um, this is kind of gross and I'm going to have to
Matt Giuca 2016/05/23 01:15:40 Sorry, actually I can keep the conditional fall-th
@@ -978,6 +991,10 @@ void BrowserCommandController::UpdateCommandsForTabState() {
return;
// Navigation commands
+ command_updater_.UpdateCommandEnabled(IDC_BACKSPACE_BACK,
+ CanGoBack(browser_));
+ command_updater_.UpdateCommandEnabled(IDC_BACKSPACE_FORWARD,
Peter Kasting 2016/05/19 09:28:30 Nit: Swap this with next line to keep the backs/fo
ojan 2016/05/20 16:33:48 done
+ CanGoForward(browser_));
command_updater_.UpdateCommandEnabled(IDC_BACK, CanGoBack(browser_));
command_updater_.UpdateCommandEnabled(IDC_FORWARD, CanGoForward(browser_));
command_updater_.UpdateCommandEnabled(IDC_RELOAD, CanReload(browser_));

Powered by Google App Engine
This is Rietveld 408576698