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

Side by Side Diff: chrome/browser/ui/input_method/input_method_engine_base.cc

Issue 2256283003: Refuse to show Alt+Tab UI concurrently with virtual keyboard. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mark ime events as synthesized Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/input_method/input_method_engine_base.h" 5 #include "chrome/browser/ui/input_method/input_method_engine_base.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #undef FocusIn 9 #undef FocusIn
10 #undef FocusOut 10 #undef FocusOut
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 if (!IsActive() || 435 if (!IsActive() ||
436 (context_id != 0 && (context_id != context_id_ || context_id_ == -1))) 436 (context_id != 0 && (context_id != context_id_ || context_id_ == -1)))
437 return false; 437 return false;
438 438
439 for (size_t i = 0; i < events.size(); ++i) { 439 for (size_t i = 0; i < events.size(); ++i) {
440 const KeyboardEvent& event = events[i]; 440 const KeyboardEvent& event = events[i];
441 const ui::EventType type = 441 const ui::EventType type =
442 (event.type == "keyup") ? ui::ET_KEY_RELEASED : ui::ET_KEY_PRESSED; 442 (event.type == "keyup") ? ui::ET_KEY_RELEASED : ui::ET_KEY_PRESSED;
443 ui::KeyboardCode key_code = static_cast<ui::KeyboardCode>(event.key_code); 443 ui::KeyboardCode key_code = static_cast<ui::KeyboardCode>(event.key_code);
444 444
445 int flags = ui::EF_NONE; 445 int flags = ui::EF_IS_SYNTHESIZED;
446 flags |= event.alt_key ? ui::EF_ALT_DOWN : ui::EF_NONE; 446 flags |= event.alt_key ? ui::EF_ALT_DOWN : ui::EF_NONE;
447 flags |= event.ctrl_key ? ui::EF_CONTROL_DOWN : ui::EF_NONE; 447 flags |= event.ctrl_key ? ui::EF_CONTROL_DOWN : ui::EF_NONE;
448 flags |= event.shift_key ? ui::EF_SHIFT_DOWN : ui::EF_NONE; 448 flags |= event.shift_key ? ui::EF_SHIFT_DOWN : ui::EF_NONE;
449 flags |= event.caps_lock ? ui::EF_CAPS_LOCK_ON : ui::EF_NONE; 449 flags |= event.caps_lock ? ui::EF_CAPS_LOCK_ON : ui::EF_NONE;
450 450
451 ui::KeyEvent ui_event( 451 ui::KeyEvent ui_event(
452 type, key_code, ui::KeycodeConverter::CodeStringToDomCode(event.code), 452 type, key_code, ui::KeycodeConverter::CodeStringToDomCode(event.code),
453 flags, ui::KeycodeConverter::KeyStringToDomKey(event.key), 453 flags, ui::KeycodeConverter::KeyStringToDomKey(event.key),
454 ui::EventTimeForNow()); 454 ui::EventTimeForNow());
455 base::AutoReset<const ui::KeyEvent*> reset_sent_key(&sent_key_event_, 455 base::AutoReset<const ui::KeyEvent*> reset_sent_key(&sent_key_event_,
456 &ui_event); 456 &ui_event);
457 if (!SendKeyEvent(&ui_event, event.code)) 457 if (!SendKeyEvent(&ui_event, event.code))
458 return false; 458 return false;
459 } 459 }
460 return true; 460 return true;
461 } 461 }
462 462
463 } // namespace input_method 463 } // namespace input_method
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698