| OLD | NEW |
| 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 "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| (...skipping 1821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1832 } else { | 1832 } else { |
| 1833 if (event->key_code() == ui::VKEY_RETURN) { | 1833 if (event->key_code() == ui::VKEY_RETURN) { |
| 1834 // Do not forward return key release events if no press event was handled. | 1834 // Do not forward return key release events if no press event was handled. |
| 1835 if (event->type() == ui::ET_KEY_RELEASED && !accept_return_character_) | 1835 if (event->type() == ui::ET_KEY_RELEASED && !accept_return_character_) |
| 1836 return; | 1836 return; |
| 1837 // Accept return key character events between press and release events. | 1837 // Accept return key character events between press and release events. |
| 1838 accept_return_character_ = event->type() == ui::ET_KEY_PRESSED; | 1838 accept_return_character_ = event->type() == ui::ET_KEY_PRESSED; |
| 1839 } | 1839 } |
| 1840 | 1840 |
| 1841 // We don't have to communicate with an input method here. | 1841 // We don't have to communicate with an input method here. |
| 1842 if (!event->HasNativeEvent()) { | 1842 NativeWebKeyboardEvent webkit_event(*event); |
| 1843 NativeWebKeyboardEvent webkit_event( | 1843 ForwardKeyboardEvent(webkit_event); |
| 1844 event->type(), | |
| 1845 event->is_char(), | |
| 1846 event->is_char() ? event->GetCharacter() : event->key_code(), | |
| 1847 event->flags(), | |
| 1848 ui::EventTimeForNow().InSecondsF()); | |
| 1849 ForwardKeyboardEvent(webkit_event); | |
| 1850 } else { | |
| 1851 NativeWebKeyboardEvent webkit_event(*event); | |
| 1852 ForwardKeyboardEvent(webkit_event); | |
| 1853 } | |
| 1854 } | 1844 } |
| 1855 event->SetHandled(); | 1845 event->SetHandled(); |
| 1856 } | 1846 } |
| 1857 | 1847 |
| 1858 void RenderWidgetHostViewAura::OnMouseEvent(ui::MouseEvent* event) { | 1848 void RenderWidgetHostViewAura::OnMouseEvent(ui::MouseEvent* event) { |
| 1859 TRACE_EVENT0("input", "RenderWidgetHostViewAura::OnMouseEvent"); | 1849 TRACE_EVENT0("input", "RenderWidgetHostViewAura::OnMouseEvent"); |
| 1860 | 1850 |
| 1861 if (touch_editing_client_ && touch_editing_client_->HandleInputEvent(event)) | 1851 if (touch_editing_client_ && touch_editing_client_->HandleInputEvent(event)) |
| 1862 return; | 1852 return; |
| 1863 | 1853 |
| (...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2578 | 2568 |
| 2579 //////////////////////////////////////////////////////////////////////////////// | 2569 //////////////////////////////////////////////////////////////////////////////// |
| 2580 // RenderWidgetHostViewBase, public: | 2570 // RenderWidgetHostViewBase, public: |
| 2581 | 2571 |
| 2582 // static | 2572 // static |
| 2583 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { | 2573 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { |
| 2584 GetScreenInfoForWindow(results, NULL); | 2574 GetScreenInfoForWindow(results, NULL); |
| 2585 } | 2575 } |
| 2586 | 2576 |
| 2587 } // namespace content | 2577 } // namespace content |
| OLD | NEW |