ports/www/iridium/files/patch-ui_views_controls_textfield_textfield.cc
Carlos J. Puga Medina 66d46c9897 www/iridium: Update to 2019.04.73
Submitted by:	Matthias Wolf <matthias@rheinwolf.de>
2019-06-18 19:24:43 +00:00

73 lines
3 KiB
C++

--- ui/views/controls/textfield/textfield.cc.orig 2019-03-11 22:01:19 UTC
+++ ui/views/controls/textfield/textfield.cc
@@ -59,7 +59,7 @@
#include "base/win/win_util.h"
#endif
-#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
+#if (defined(OS_LINUX) || defined(OS_BSD)) && !defined(OS_CHROMEOS)
#include "base/strings/utf_string_conversions.h"
#include "ui/base/ime/linux/text_edit_command_auralinux.h"
#include "ui/base/ime/linux/text_edit_key_bindings_delegate_auralinux.h"
@@ -162,14 +162,14 @@ ui::TextEditCommand GetCommandForKeyEvent(const ui::Ke
case ui::VKEY_BACK:
if (!control)
return ui::TextEditCommand::DELETE_BACKWARD;
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_BSD)
// Only erase by line break on Linux and ChromeOS.
if (shift)
return ui::TextEditCommand::DELETE_TO_BEGINNING_OF_LINE;
#endif
return ui::TextEditCommand::DELETE_WORD_BACKWARD;
case ui::VKEY_DELETE:
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_BSD)
// Only erase by line break on Linux and ChromeOS.
if (shift && control)
return ui::TextEditCommand::DELETE_TO_END_OF_LINE;
@@ -228,7 +228,7 @@ bool IsControlKeyModifier(int flags) {
// Control-modified key combination, but we cannot extend it to other platforms
// as Control has different meanings and behaviors.
// https://crrev.com/2580483002/#msg46
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_BSD)
return flags & ui::EF_CONTROL_DOWN;
#else
return false;
@@ -682,7 +682,7 @@ bool Textfield::OnMousePressed(const ui::MouseEvent& e
#endif
}
-#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
+#if (defined(OS_LINUX) || defined(OS_BSD)) && !defined(OS_CHROMEOS)
if (!handled && !had_focus && event.IsOnlyMiddleMouseButton())
RequestFocusWithPointer(ui::EventPointerType::POINTER_TYPE_MOUSE);
#endif
@@ -726,7 +726,7 @@ bool Textfield::OnKeyPressed(const ui::KeyEvent& event
if (!textfield)
return handled;
-#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
+#if (defined(OS_LINUX) || defined(OS_BSD)) && !defined(OS_CHROMEOS)
ui::TextEditKeyBindingsDelegateAuraLinux* delegate =
ui::GetTextEditKeyBindingsDelegate();
std::vector<ui::TextEditCommandAuraLinux> commands;
@@ -894,7 +894,7 @@ void Textfield::AboutToRequestFocusFromTabTraversal(bo
}
bool Textfield::SkipDefaultKeyEventProcessing(const ui::KeyEvent& event) {
-#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
+#if (defined(OS_LINUX) || defined(OS_BSD)) && !defined(OS_CHROMEOS)
// Skip any accelerator handling that conflicts with custom keybindings.
ui::TextEditKeyBindingsDelegateAuraLinux* delegate =
ui::GetTextEditKeyBindingsDelegate();
@@ -2076,7 +2076,7 @@ bool Textfield::PasteSelectionClipboard() {
}
void Textfield::UpdateSelectionClipboard() {
-#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
+#if (defined(OS_LINUX) || defined(OS_BSD)) && !defined(OS_CHROMEOS)
if (text_input_type_ != ui::TEXT_INPUT_TYPE_PASSWORD) {
ui::ScopedClipboardWriter(ui::CLIPBOARD_TYPE_SELECTION)
.WriteText(GetSelectedText());