Remove the BackspaceGoesBack flag.
This has shipped for months and won't be rolled back. We don't
need to keep this code around.
BUG=699133
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation
Review-Url: https://codereview.chromium.org/2865793002
Cr-Commit-Position: refs/heads/master@{#475637}
diff --git a/chrome/browser/resources/chromeos/keyboard_overlay.js b/chrome/browser/resources/chromeos/keyboard_overlay.js
index 86a3ab0..38cdf54e 100644
--- a/chrome/browser/resources/chromeos/keyboard_overlay.js
+++ b/chrome/browser/resources/chromeos/keyboard_overlay.js
@@ -227,14 +227,6 @@
delete shortcutDataCache['0<>CTRL<>SHIFT'];
}
- if (!loadTimeData.getBoolean('backspaceGoesBackFeatureEnabled')) {
- // If the "backspace key goes back" experiment is not enabled, then we
- // clear the shortcuts for Backspace and Shift+Backspace to go back or
- // forward respectively.
- delete shortcutDataCache['backspace'];
- delete shortcutDataCache['backspace<>SHIFT'];
- }
-
return shortcutDataCache;
}
diff --git a/chrome/browser/resources/chromeos/keyboard_overlay_data.js b/chrome/browser/resources/chromeos/keyboard_overlay_data.js
index 352b929..40095ad3 100644
--- a/chrome/browser/resources/chromeos/keyboard_overlay_data.js
+++ b/chrome/browser/resources/chromeos/keyboard_overlay_data.js
@@ -15811,12 +15811,10 @@
'b<>CTRL<>SHIFT': 'keyboardOverlayToggleBookmarkBar',
'back<>CTRL': 'keyboardOverlayFocusPreviousPane',
'back<>SEARCH': 'keyboardOverlayF1',
- 'backspace': 'keyboardOverlayGoBack',
'backspace<>ALT': 'keyboardOverlayDelete',
'backspace<>CTRL': 'keyboardOverlayDeleteWord',
'backspace<>CTRL<>SHIFT': 'keyboardOverlayClearBrowsingDataDialog',
'backspace<>SEARCH': 'keyboardOverlayDelete',
- 'backspace<>SHIFT': 'keyboardOverlayGoForward',
'bright down<>ALT': 'keyboardOverlayDecreaseKeyBrightness',
'bright down<>ALT<>CTRL': 'keyboardOverlayMagnifierDecreaseZoom',
'bright down<>SEARCH': 'keyboardOverlayF6',
diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc
index 7db71e16..7486eea 100644
--- a/chrome/browser/ui/browser_command_controller.cc
+++ b/chrome/browser/ui/browser_command_controller.cc
@@ -11,7 +11,6 @@
#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 "base/metrics/user_metrics.h"
#include "build/build_config.h"
@@ -37,7 +36,6 @@
#include "chrome/browser/ui/chrome_pages.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/webui/inspect_ui.h"
-#include "chrome/common/chrome_features.h"
#include "chrome/common/content_restriction.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/profiling.h"
@@ -308,20 +306,14 @@
switch (id) {
// Navigation commands
case IDC_BACKSPACE_BACK:
- if (base::FeatureList::IsEnabled(features::kBackspaceGoesBackFeature))
- GoBack(browser_, disposition);
- else
- window()->MaybeShowNewBackShortcutBubble(false);
+ window()->MaybeShowNewBackShortcutBubble(false);
break;
case IDC_BACK:
window()->HideNewBackShortcutBubble();
GoBack(browser_, disposition);
break;
case IDC_BACKSPACE_FORWARD:
- if (base::FeatureList::IsEnabled(features::kBackspaceGoesBackFeature))
- GoForward(browser_, disposition);
- else
- window()->MaybeShowNewBackShortcutBubble(true);
+ window()->MaybeShowNewBackShortcutBubble(true);
break;
case IDC_FORWARD:
window()->HideNewBackShortcutBubble();
diff --git a/chrome/browser/ui/views/constrained_window_views_browsertest.cc b/chrome/browser/ui/views/constrained_window_views_browsertest.cc
index 5db441f..5538e473 100644
--- a/chrome/browser/ui/views/constrained_window_views_browsertest.cc
+++ b/chrome/browser/ui/views/constrained_window_views_browsertest.cc
@@ -5,14 +5,11 @@
#include <memory>
#include "base/macros.h"
-#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/views/tab_modal_confirm_dialog_views.h"
-#include "chrome/common/chrome_features.h"
-#include "chrome/common/url_constants.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/interactive_test_utils.h"
#include "chrome/test/base/ui_test_utils.h"
@@ -170,51 +167,6 @@
EXPECT_EQ(NULL, dialog->GetWidget());
}
-// Tests that the web contents navigates when backspace is pressed.
-IN_PROC_BROWSER_TEST_F(ConstrainedWindowViewTest, NavigationOnBackspace) {
- content::WebContents* web_contents =
- browser()->tab_strip_model()->GetActiveWebContents();
- content::WaitForLoadStop(web_contents);
- const GURL original_url = web_contents->GetURL();
- EXPECT_NE(GURL(chrome::kChromeUIVersionURL), original_url);
- ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIVersionURL));
- content::WaitForLoadStop(web_contents);
- EXPECT_EQ(GURL(chrome::kChromeUIVersionURL), web_contents->GetURL());
-
- std::unique_ptr<TestDialog> dialog = ShowModalDialog(web_contents);
-
- views::Widget* widget = dialog->GetWidget();
-
- EXPECT_TRUE(widget->IsVisible());
- EXPECT_EQ(dialog->GetContentsView(),
- widget->GetFocusManager()->GetFocusedView());
-
- // Pressing backspace should not navigate back and close the dialog
- // with the Finch flag disabled.
- EXPECT_TRUE(chrome::CanGoBack(browser()));
- EXPECT_TRUE(ui_test_utils::SendKeyPressSync(browser(), ui::VKEY_BACK,
- false, false, false, false));
- content::RunAllPendingInMessageLoop();
- content::WaitForLoadStop(web_contents);
-
- EXPECT_EQ(widget, dialog->GetWidget());
- EXPECT_EQ(GURL(chrome::kChromeUIVersionURL), web_contents->GetURL());
-
- // Pressing backspace should navigate back and close the dialog with the
- // Finch flag enabled.
- base::test::ScopedFeatureList scoped_feature_list;
- scoped_feature_list.InitAndEnableFeature(features::kBackspaceGoesBackFeature);
-
- EXPECT_TRUE(chrome::CanGoBack(browser()));
- EXPECT_TRUE(ui_test_utils::SendKeyPressSync(browser(), ui::VKEY_BACK,
- false, false, false, false));
- content::RunAllPendingInMessageLoop();
- content::WaitForLoadStop(web_contents);
-
- EXPECT_EQ(nullptr, dialog->GetWidget());
- EXPECT_EQ(original_url, web_contents->GetURL());
-}
-
// Tests that the dialog closes when the escape key is pressed.
IN_PROC_BROWSER_TEST_F(ConstrainedWindowViewTest, ClosesOnEscape) {
#if defined(OS_WIN)
diff --git a/chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc b/chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc
index ae29d008..59a7300 100644
--- a/chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc
@@ -10,14 +10,12 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/command_line.h"
-#include "base/feature_list.h"
#include "base/macros.h"
#include "base/memory/ptr_util.h"
#include "base/memory/weak_ptr.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/common/chrome_features.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/browser_resources.h"
@@ -316,9 +314,6 @@
display::DisplayManager* display_manager = shell->display_manager();
source->AddBoolean("keyboardOverlayIsDisplayUIScalingEnabled",
display_manager->IsDisplayUIScalingEnabled());
- source->AddBoolean(
- "backspaceGoesBackFeatureEnabled",
- base::FeatureList::IsEnabled(features::kBackspaceGoesBackFeature));
source->SetJsonPath("strings.js");
source->AddResourcePath("keyboard_overlay.js", IDR_KEYBOARD_OVERLAY_JS);
source->SetDefaultResource(IDR_KEYBOARD_OVERLAY_HTML);
diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc
index 4181b412..7e8134d0 100644
--- a/chrome/common/chrome_features.cc
+++ b/chrome/common/chrome_features.cc
@@ -60,12 +60,6 @@
"BackgroundModeAllowRestart", base::FEATURE_DISABLED_BY_DEFAULT};
#endif // defined(OS_WIN) || defined(OS_LINUX)
-// Enables the Backspace key to navigate back in the browser, as well as
-// Shift+Backspace to navigate forward.
-const base::Feature kBackspaceGoesBackFeature {
- "BackspaceGoesBack", base::FEATURE_DISABLED_BY_DEFAULT
-};
-
// Enables or disables whether permission prompts are automatically blocked
// after the user has explicitly dismissed them too many times.
const base::Feature kBlockPromptsIfDismissedOften{
diff --git a/chrome/common/chrome_features.h b/chrome/common/chrome_features.h
index 3e6348d7..1ac4866 100644
--- a/chrome/common/chrome_features.h
+++ b/chrome/common/chrome_features.h
@@ -46,8 +46,6 @@
extern const base::Feature kBackgroundModeAllowRestart;
#endif // defined(OS_WIN) || defined(OS_LINUX)
-extern const base::Feature kBackspaceGoesBackFeature;
-
extern const base::Feature kBlockPromptsIfDismissedOften;
extern const base::Feature kBlockPromptsIfIgnoredOften;