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

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

Issue 2751323002: Converts ui::Accelerator::type to an enum (Closed)
Patch Set: remove dcheck Created 3 years, 9 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 8414521dd258ccc1ec46ef855a242c5fc03b3fa8..253068589a8ce04fc0aee2f4f6aad202a8f8fc8e 100644
--- a/ui/views/controls/textfield/textfield.cc
+++ b/ui/views/controls/textfield/textfield.cc
@@ -771,8 +771,11 @@ void Textfield::OnGestureEvent(ui::GestureEvent* event) {
// This function is called by BrowserView to execute clipboard commands.
bool Textfield::AcceleratorPressed(const ui::Accelerator& accelerator) {
- ui::KeyEvent event(accelerator.type(), accelerator.key_code(),
- accelerator.modifiers());
+ ui::KeyEvent event(
+ accelerator.key_state() == ui::Accelerator::KeyState::PRESSED
+ ? ui::ET_KEY_PRESSED
+ : ui::ET_KEY_RELEASED,
+ accelerator.key_code(), accelerator.modifiers());
ExecuteTextEditCommand(GetCommandForKeyEvent(event));
return true;
}
« ui/base/accelerators/accelerator.h ('K') | « ui/content_accelerators/accelerator_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698