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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 1221083008: [NOT FOR COMMIT] Ignore inserting characters of Keys with modifiers on CrOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix the double keydowns. Created 5 years, 3 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
« no previous file with comments | « no previous file | ui/views/controls/textfield/textfield.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 1594 matching lines...) Expand 10 before | Expand all | Expand 10 after
1605 void RenderWidgetHostViewAura::InsertChar(base::char16 ch, int flags) { 1605 void RenderWidgetHostViewAura::InsertChar(base::char16 ch, int flags) {
1606 if (popup_child_host_view_ && popup_child_host_view_->NeedsInputGrab()) { 1606 if (popup_child_host_view_ && popup_child_host_view_->NeedsInputGrab()) {
1607 popup_child_host_view_->InsertChar(ch, flags); 1607 popup_child_host_view_->InsertChar(ch, flags);
1608 return; 1608 return;
1609 } 1609 }
1610 1610
1611 // Ignore character messages for VKEY_RETURN sent on CTRL+M. crbug.com/315547 1611 // Ignore character messages for VKEY_RETURN sent on CTRL+M. crbug.com/315547
1612 if (host_ && (accept_return_character_ || ch != ui::VKEY_RETURN)) { 1612 if (host_ && (accept_return_character_ || ch != ui::VKEY_RETURN)) {
1613 double now = ui::EventTimeForNow().InSecondsF(); 1613 double now = ui::EventTimeForNow().InSecondsF();
1614 // Send a blink::WebInputEvent::Char event to |host_|. 1614 // Send a blink::WebInputEvent::Char event to |host_|.
1615 NativeWebKeyboardEvent webkit_event(ui::ET_KEY_PRESSED, 1615 // On ChromeOS we send a blink::WebInputEvent::Char event only if no
1616 true /* is_char */, 1616 // modifiers are currently pressed. Otherwise |is_char| will be false and we
1617 ch, 1617 // will end up sending a blink::WebInputEvent::RawKeyDown event.
1618 flags, 1618 #if defined(OS_CHROMEOS)
1619 now); 1619 const int kControlModifierMask = ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN |
1620 ForwardKeyboardEvent(webkit_event); 1620 ui::EF_COMMAND_DOWN;
1621 #else
1622 const int kControlModifierMask = ui::EF_NONE;
1623 #endif // defined(OS_CHROMEOS)
1624 const bool is_char = (flags & kControlModifierMask) == 0;
1625
1626 if (is_char) {
1627 NativeWebKeyboardEvent webkit_event(ui::ET_KEY_PRESSED,
1628 is_char,
1629 ch,
1630 flags,
1631 now);
1632 ForwardKeyboardEvent(webkit_event);
1633 }
1621 } 1634 }
1622 } 1635 }
1623 1636
1624 ui::TextInputType RenderWidgetHostViewAura::GetTextInputType() const { 1637 ui::TextInputType RenderWidgetHostViewAura::GetTextInputType() const {
1625 return text_input_type_; 1638 return text_input_type_;
1626 } 1639 }
1627 1640
1628 ui::TextInputMode RenderWidgetHostViewAura::GetTextInputMode() const { 1641 ui::TextInputMode RenderWidgetHostViewAura::GetTextInputMode() const {
1629 return text_input_mode_; 1642 return text_input_mode_;
1630 } 1643 }
(...skipping 1250 matching lines...) Expand 10 before | Expand all | Expand 10 after
2881 2894
2882 //////////////////////////////////////////////////////////////////////////////// 2895 ////////////////////////////////////////////////////////////////////////////////
2883 // RenderWidgetHostViewBase, public: 2896 // RenderWidgetHostViewBase, public:
2884 2897
2885 // static 2898 // static
2886 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { 2899 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) {
2887 GetScreenInfoForWindow(results, NULL); 2900 GetScreenInfoForWindow(results, NULL);
2888 } 2901 }
2889 2902
2890 } // namespace content 2903 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | ui/views/controls/textfield/textfield.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698