| 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/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 2600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2611 event->SetHandled(); | 2611 event->SetHandled(); |
| 2612 return; | 2612 return; |
| 2613 } | 2613 } |
| 2614 } | 2614 } |
| 2615 } | 2615 } |
| 2616 if (!in_shutdown_) { | 2616 if (!in_shutdown_) { |
| 2617 in_shutdown_ = true; | 2617 in_shutdown_ = true; |
| 2618 host_->Shutdown(); | 2618 host_->Shutdown(); |
| 2619 } | 2619 } |
| 2620 } else { | 2620 } else { |
| 2621 // Accept return key character events between its press and release events. |
| 2622 if (event->key_code() == ui::VKEY_RETURN) |
| 2623 accept_return_character_ = event->type() == ui::ET_KEY_PRESSED; |
| 2624 |
| 2621 // We don't have to communicate with an input method here. | 2625 // We don't have to communicate with an input method here. |
| 2622 if (!event->HasNativeEvent()) { | 2626 if (!event->HasNativeEvent()) { |
| 2623 NativeWebKeyboardEvent webkit_event( | 2627 NativeWebKeyboardEvent webkit_event( |
| 2624 event->type(), | 2628 event->type(), |
| 2625 event->is_char(), | 2629 event->is_char(), |
| 2626 event->is_char() ? event->GetCharacter() : event->key_code(), | 2630 event->is_char() ? event->GetCharacter() : event->key_code(), |
| 2627 event->flags(), | 2631 event->flags(), |
| 2628 ui::EventTimeForNow().InSecondsF()); | 2632 ui::EventTimeForNow().InSecondsF()); |
| 2629 host_->ForwardKeyboardEvent(webkit_event); | 2633 host_->ForwardKeyboardEvent(webkit_event); |
| 2630 } else { | 2634 } else { |
| 2631 if (event->key_code() == ui::VKEY_RETURN) | |
| 2632 accept_return_character_ = event->type() == ui::ET_KEY_PRESSED; | |
| 2633 NativeWebKeyboardEvent webkit_event(event); | 2635 NativeWebKeyboardEvent webkit_event(event); |
| 2634 host_->ForwardKeyboardEvent(webkit_event); | 2636 host_->ForwardKeyboardEvent(webkit_event); |
| 2635 } | 2637 } |
| 2636 } | 2638 } |
| 2637 event->SetHandled(); | 2639 event->SetHandled(); |
| 2638 } | 2640 } |
| 2639 | 2641 |
| 2640 void RenderWidgetHostViewAura::OnMouseEvent(ui::MouseEvent* event) { | 2642 void RenderWidgetHostViewAura::OnMouseEvent(ui::MouseEvent* event) { |
| 2641 TRACE_EVENT0("input", "RenderWidgetHostViewAura::OnMouseEvent"); | 2643 TRACE_EVENT0("input", "RenderWidgetHostViewAura::OnMouseEvent"); |
| 2642 | 2644 |
| (...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3364 RenderWidgetHost* widget) { | 3366 RenderWidgetHost* widget) { |
| 3365 return new RenderWidgetHostViewAura(widget); | 3367 return new RenderWidgetHostViewAura(widget); |
| 3366 } | 3368 } |
| 3367 | 3369 |
| 3368 // static | 3370 // static |
| 3369 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { | 3371 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { |
| 3370 GetScreenInfoForWindow(results, NULL); | 3372 GetScreenInfoForWindow(results, NULL); |
| 3371 } | 3373 } |
| 3372 | 3374 |
| 3373 } // namespace content | 3375 } // namespace content |
| OLD | NEW |