| 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/renderer/render_widget.h" | 5 #include "content/renderer/render_widget.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 1265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1276 if (!prevent_default) { | 1276 if (!prevent_default) { |
| 1277 if (WebInputEvent::isKeyboardEventType(input_event->type)) | 1277 if (WebInputEvent::isKeyboardEventType(input_event->type)) |
| 1278 DidHandleKeyEvent(); | 1278 DidHandleKeyEvent(); |
| 1279 if (WebInputEvent::isMouseEventType(input_event->type)) | 1279 if (WebInputEvent::isMouseEventType(input_event->type)) |
| 1280 DidHandleMouseEvent(*(static_cast<const WebMouseEvent*>(input_event))); | 1280 DidHandleMouseEvent(*(static_cast<const WebMouseEvent*>(input_event))); |
| 1281 if (WebInputEvent::isTouchEventType(input_event->type)) | 1281 if (WebInputEvent::isTouchEventType(input_event->type)) |
| 1282 DidHandleTouchEvent(*(static_cast<const WebTouchEvent*>(input_event))); | 1282 DidHandleTouchEvent(*(static_cast<const WebTouchEvent*>(input_event))); |
| 1283 } | 1283 } |
| 1284 | 1284 |
| 1285 // TODO(rouslan): Fix ChromeOS and Windows 8 behavior of autofill popup with | 1285 // TODO(rouslan): Fix ChromeOS and Windows 8 behavior of autofill popup with |
| 1286 // virtual keyboard. | 1286 // virtual keyboard (IME). |
| 1287 #if !defined(OS_ANDROID) | 1287 #if !defined(OS_ANDROID) |
| 1288 // Virtual keyboard is not supported, so react to focus change immediately. | |
| 1289 if (processed && (input_event->type == WebInputEvent::TouchEnd || | 1288 if (processed && (input_event->type == WebInputEvent::TouchEnd || |
| 1290 input_event->type == WebInputEvent::MouseUp)) { | 1289 input_event->type == WebInputEvent::MouseUp)) { |
| 1291 FocusChangeComplete(); | 1290 ImeShownAnimationsComplete(); |
| 1292 } | 1291 } |
| 1293 #endif | 1292 #endif |
| 1294 } | 1293 } |
| 1295 | 1294 |
| 1296 void RenderWidget::OnCursorVisibilityChange(bool is_visible) { | 1295 void RenderWidget::OnCursorVisibilityChange(bool is_visible) { |
| 1297 if (webwidget_) | 1296 if (webwidget_) |
| 1298 webwidget_->setCursorVisibilityState(is_visible); | 1297 webwidget_->setCursorVisibilityState(is_visible); |
| 1299 } | 1298 } |
| 1300 | 1299 |
| 1301 void RenderWidget::OnMouseCaptureLost() { | 1300 void RenderWidget::OnMouseCaptureLost() { |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1743 } | 1742 } |
| 1744 | 1743 |
| 1745 void RenderWidget::OnShowImeIfNeeded() { | 1744 void RenderWidget::OnShowImeIfNeeded() { |
| 1746 #if defined(OS_ANDROID) || defined(USE_AURA) | 1745 #if defined(OS_ANDROID) || defined(USE_AURA) |
| 1747 UpdateTextInputState(SHOW_IME_IF_NEEDED, FROM_NON_IME); | 1746 UpdateTextInputState(SHOW_IME_IF_NEEDED, FROM_NON_IME); |
| 1748 #endif | 1747 #endif |
| 1749 | 1748 |
| 1750 // TODO(rouslan): Fix ChromeOS and Windows 8 behavior of autofill popup with | 1749 // TODO(rouslan): Fix ChromeOS and Windows 8 behavior of autofill popup with |
| 1751 // virtual keyboard. | 1750 // virtual keyboard. |
| 1752 #if !defined(OS_ANDROID) | 1751 #if !defined(OS_ANDROID) |
| 1753 FocusChangeComplete(); | 1752 ImeShownAnimationsComplete(); |
| 1754 #endif | 1753 #endif |
| 1755 } | 1754 } |
| 1756 | 1755 |
| 1757 #if defined(OS_ANDROID) | 1756 #if defined(OS_ANDROID) |
| 1758 void RenderWidget::IncrementOutstandingImeEventAcks() { | 1757 void RenderWidget::IncrementOutstandingImeEventAcks() { |
| 1759 ++outstanding_ime_acks_; | 1758 ++outstanding_ime_acks_; |
| 1760 } | 1759 } |
| 1761 | 1760 |
| 1762 void RenderWidget::OnImeEventAck() { | 1761 void RenderWidget::OnImeEventAck() { |
| 1763 --outstanding_ime_acks_; | 1762 --outstanding_ime_acks_; |
| (...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2428 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { | 2427 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { |
| 2429 video_hole_frames_.AddObserver(frame); | 2428 video_hole_frames_.AddObserver(frame); |
| 2430 } | 2429 } |
| 2431 | 2430 |
| 2432 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { | 2431 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { |
| 2433 video_hole_frames_.RemoveObserver(frame); | 2432 video_hole_frames_.RemoveObserver(frame); |
| 2434 } | 2433 } |
| 2435 #endif // defined(VIDEO_HOLE) | 2434 #endif // defined(VIDEO_HOLE) |
| 2436 | 2435 |
| 2437 } // namespace content | 2436 } // namespace content |
| OLD | NEW |