1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
--- ui/views/controls/textfield/textfield.cc.orig 2021-05-12 22:06:47 UTC
+++ ui/views/controls/textfield/textfield.cc
@@ -72,7 +72,7 @@
// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
// of lacros-chrome is complete.
-#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
+#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_BSD)
#include "ui/base/ime/linux/text_edit_command_auralinux.h"
#include "ui/base/ime/linux/text_edit_key_bindings_delegate_auralinux.h"
#endif
@@ -169,7 +169,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) || defined(OS_CHROMEOS)
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
return flags & ui::EF_CONTROL_DOWN;
#else
return false;
@@ -675,7 +675,7 @@ bool Textfield::OnMousePressed(const ui::MouseEvent& e
// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
// of lacros-chrome is complete.
-#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
+#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_BSD)
if (!handled && !had_focus && event.IsOnlyMiddleMouseButton())
RequestFocusWithPointer(ui::EventPointerType::kMouse);
#endif
@@ -727,7 +727,7 @@ bool Textfield::OnKeyPressed(const ui::KeyEvent& event
// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
// of lacros-chrome is complete.
-#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
+#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_BSD)
ui::TextEditKeyBindingsDelegateAuraLinux* delegate =
ui::GetTextEditKeyBindingsDelegate();
std::vector<ui::TextEditCommandAuraLinux> commands;
@@ -883,7 +883,7 @@ void Textfield::AboutToRequestFocusFromTabTraversal(bo
bool Textfield::SkipDefaultKeyEventProcessing(const ui::KeyEvent& event) {
// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
// of lacros-chrome is complete.
-#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
+#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_BSD)
// Skip any accelerator handling that conflicts with custom keybindings.
ui::TextEditKeyBindingsDelegateAuraLinux* delegate =
ui::GetTextEditKeyBindingsDelegate();
@@ -2258,14 +2258,14 @@ ui::TextEditCommand Textfield::GetCommandForKeyEvent(
#endif
return ui::TextEditCommand::DELETE_BACKWARD;
}
-#if defined(OS_LINUX) || defined(OS_CHROMEOS)
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || 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) || defined(OS_CHROMEOS)
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
// Only erase by line break on Linux and ChromeOS.
if (shift && control)
return ui::TextEditCommand::DELETE_TO_END_OF_LINE;
@@ -2357,7 +2357,7 @@ bool Textfield::PasteSelectionClipboard() {
void Textfield::UpdateSelectionClipboard() {
// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
// of lacros-chrome is complete.
-#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
+#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_BSD)
if (text_input_type_ != ui::TEXT_INPUT_TYPE_PASSWORD) {
ui::ScopedClipboardWriter(ui::ClipboardBuffer::kSelection)
.WriteText(GetSelectedText());
|