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

Unified Diff: ui/views/controls/textfield/textfield.cc

Issue 2013293002: NOT FOR COMMIT: Make altgr+left and altgr+right navigate back/forward on views. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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: ui/views/controls/textfield/textfield.cc
diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc
index b31dd2d0737218a3d623dd54b9eb3ba9f2be0594..edc247de498c140efb0051003b22a6726cbd9cd4 100644
--- a/ui/views/controls/textfield/textfield.cc
+++ b/ui/views/controls/textfield/textfield.cc
@@ -844,11 +844,18 @@ void Textfield::AboutToRequestFocusFromTabTraversal(bool reverse) {
bool Textfield::SkipDefaultKeyEventProcessing(const ui::KeyEvent& event) {
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
+ // TODO: This bool needs to be set if the key corresponds to altgr+left.
+ // Linux doesn't have a built-in shortcut for alt+left, so alt doesn't
+ // need special handling here, but altgr does even thought it doesn't do
+ // anything with the left arrow as best I can tell.
+ bool isAltGrLeftBackNavigation = true;
ojan 2016/05/27 00:53:54 This is the bit of code that needs to be finished
Peter Kasting 2016/05/27 01:11:01 Let me see if I understand. This code needs to re
+
// Skip any accelerator handling that conflicts with custom keybindings.
ui::TextEditKeyBindingsDelegateAuraLinux* delegate =
ui::GetTextEditKeyBindingsDelegate();
std::vector<ui::TextEditCommandAuraLinux> commands;
- if (delegate && delegate->MatchEvent(event, &commands)) {
+ if (!isAltGrLeftBackNavigation &&
+ (delegate && delegate->MatchEvent(event, &commands))) {
const bool rtl = GetTextDirection() == base::i18n::RIGHT_TO_LEFT;
for (size_t i = 0; i < commands.size(); ++i)
if (IsCommandIdEnabled(GetViewsCommand(commands[i], rtl)))

Powered by Google App Engine
This is Rietveld 408576698