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

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

Issue 2650113004: [WIP] Add support for Android SuggestionSpans when editing text (Closed)
Patch Set: Remove logging statements, fix copyright years in new files Created 3 years, 10 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 (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_impl.h" 5 #include "content/browser/renderer_host/render_widget_host_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <set> 9 #include <set>
10 #include <tuple> 10 #include <tuple>
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 return true; 516 return true;
517 517
518 bool handled = true; 518 bool handled = true;
519 IPC_BEGIN_MESSAGE_MAP(RenderWidgetHostImpl, msg) 519 IPC_BEGIN_MESSAGE_MAP(RenderWidgetHostImpl, msg)
520 IPC_MESSAGE_HANDLER(FrameHostMsg_RenderProcessGone, OnRenderProcessGone) 520 IPC_MESSAGE_HANDLER(FrameHostMsg_RenderProcessGone, OnRenderProcessGone)
521 IPC_MESSAGE_HANDLER(FrameHostMsg_HittestData, OnHittestData) 521 IPC_MESSAGE_HANDLER(FrameHostMsg_HittestData, OnHittestData)
522 IPC_MESSAGE_HANDLER(InputHostMsg_QueueSyntheticGesture, 522 IPC_MESSAGE_HANDLER(InputHostMsg_QueueSyntheticGesture,
523 OnQueueSyntheticGesture) 523 OnQueueSyntheticGesture)
524 IPC_MESSAGE_HANDLER(InputHostMsg_ImeCancelComposition, 524 IPC_MESSAGE_HANDLER(InputHostMsg_ImeCancelComposition,
525 OnImeCancelComposition) 525 OnImeCancelComposition)
526 IPC_MESSAGE_HANDLER(InputHostMsg_ImeCompositionRangeChanged,
527 OnImeCompositionRangeChanged)
528 IPC_MESSAGE_HANDLER(InputHostMsg_ShowTextSuggestionMenu,
529 OnShowTextSuggestionMenu)
526 IPC_MESSAGE_HANDLER(ViewHostMsg_Close, OnClose) 530 IPC_MESSAGE_HANDLER(ViewHostMsg_Close, OnClose)
527 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateScreenRects_ACK, 531 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateScreenRects_ACK,
528 OnUpdateScreenRectsAck) 532 OnUpdateScreenRectsAck)
529 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestMove, OnRequestMove) 533 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestMove, OnRequestMove)
530 IPC_MESSAGE_HANDLER(ViewHostMsg_SetTooltipText, OnSetTooltipText) 534 IPC_MESSAGE_HANDLER(ViewHostMsg_SetTooltipText, OnSetTooltipText)
531 IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_SwapCompositorFrame, 535 IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_SwapCompositorFrame,
532 OnSwapCompositorFrame(msg)) 536 OnSwapCompositorFrame(msg))
533 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect) 537 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect)
534 IPC_MESSAGE_HANDLER(ViewHostMsg_SetCursor, OnSetCursor) 538 IPC_MESSAGE_HANDLER(ViewHostMsg_SetCursor, OnSetCursor)
535 IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputStateChanged, 539 IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputStateChanged,
536 OnTextInputStateChanged) 540 OnTextInputStateChanged)
537 IPC_MESSAGE_HANDLER(ViewHostMsg_LockMouse, OnLockMouse) 541 IPC_MESSAGE_HANDLER(ViewHostMsg_LockMouse, OnLockMouse)
538 IPC_MESSAGE_HANDLER(ViewHostMsg_UnlockMouse, OnUnlockMouse) 542 IPC_MESSAGE_HANDLER(ViewHostMsg_UnlockMouse, OnUnlockMouse)
539 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowDisambiguationPopup, 543 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowDisambiguationPopup,
540 OnShowDisambiguationPopup) 544 OnShowDisambiguationPopup)
541 IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionBoundsChanged, 545 IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionBoundsChanged,
542 OnSelectionBoundsChanged) 546 OnSelectionBoundsChanged)
543 IPC_MESSAGE_HANDLER(InputHostMsg_ImeCompositionRangeChanged,
544 OnImeCompositionRangeChanged)
545 IPC_MESSAGE_HANDLER(ViewHostMsg_DidFirstPaintAfterLoad, 547 IPC_MESSAGE_HANDLER(ViewHostMsg_DidFirstPaintAfterLoad,
546 OnFirstPaintAfterLoad) 548 OnFirstPaintAfterLoad)
547 IPC_MESSAGE_HANDLER(ViewHostMsg_SetNeedsBeginFrames, OnSetNeedsBeginFrames) 549 IPC_MESSAGE_HANDLER(ViewHostMsg_SetNeedsBeginFrames, OnSetNeedsBeginFrames)
548 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeTouched, OnFocusedNodeTouched) 550 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeTouched, OnFocusedNodeTouched)
549 IPC_MESSAGE_HANDLER(DragHostMsg_StartDragging, OnStartDragging) 551 IPC_MESSAGE_HANDLER(DragHostMsg_StartDragging, OnStartDragging)
550 IPC_MESSAGE_HANDLER(DragHostMsg_UpdateDragCursor, OnUpdateDragCursor) 552 IPC_MESSAGE_HANDLER(DragHostMsg_UpdateDragCursor, OnUpdateDragCursor)
551 IPC_MESSAGE_UNHANDLED(handled = false) 553 IPC_MESSAGE_UNHANDLED(handled = false)
552 IPC_END_MESSAGE_MAP() 554 IPC_END_MESSAGE_MAP()
553 555
554 if (!handled && input_router_ && input_router_->OnMessageReceived(msg)) 556 if (!handled && input_router_ && input_router_->OnMessageReceived(msg))
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after
1647 void RenderWidgetHostImpl::ImeFinishComposingText(bool keep_selection) { 1649 void RenderWidgetHostImpl::ImeFinishComposingText(bool keep_selection) {
1648 Send(new InputMsg_ImeFinishComposingText(GetRoutingID(), keep_selection)); 1650 Send(new InputMsg_ImeFinishComposingText(GetRoutingID(), keep_selection));
1649 } 1651 }
1650 1652
1651 void RenderWidgetHostImpl::ImeCancelComposition() { 1653 void RenderWidgetHostImpl::ImeCancelComposition() {
1652 Send(new InputMsg_ImeSetComposition(GetRoutingID(), base::string16(), 1654 Send(new InputMsg_ImeSetComposition(GetRoutingID(), base::string16(),
1653 std::vector<blink::WebCompositionUnderline>(), 1655 std::vector<blink::WebCompositionUnderline>(),
1654 gfx::Range::InvalidRange(), 0, 0)); 1656 gfx::Range::InvalidRange(), 0, 0));
1655 } 1657 }
1656 1658
1659 void RenderWidgetHostImpl::ApplySuggestionReplacement(int documentMarkerID,
1660 int suggestionIndex) {
1661 Send(new InputMsg_ApplySuggestionReplacement(GetRoutingID(), documentMarkerID,
1662 suggestionIndex));
1663 }
1664
1665 void RenderWidgetHostImpl::DeleteSuggestionHighlight() {
1666 Send(new InputMsg_DeleteSuggestionHighlight(GetRoutingID()));
1667 }
1668
1669 void RenderWidgetHostImpl::SuggestionMenuClosed() {
1670 Send(new InputMsg_SuggestionMenuClosed(GetRoutingID()));
1671 }
1672
1657 void RenderWidgetHostImpl::RejectMouseLockOrUnlockIfNecessary() { 1673 void RenderWidgetHostImpl::RejectMouseLockOrUnlockIfNecessary() {
1658 DCHECK(!pending_mouse_lock_request_ || !IsMouseLocked()); 1674 DCHECK(!pending_mouse_lock_request_ || !IsMouseLocked());
1659 if (pending_mouse_lock_request_) { 1675 if (pending_mouse_lock_request_) {
1660 pending_mouse_lock_request_ = false; 1676 pending_mouse_lock_request_ = false;
1661 Send(new ViewMsg_LockMouse_ACK(routing_id_, false)); 1677 Send(new ViewMsg_LockMouse_ACK(routing_id_, false));
1662 } else if (IsMouseLocked()) { 1678 } else if (IsMouseLocked()) {
1663 view_->UnlockMouse(); 1679 view_->UnlockMouse();
1664 } 1680 }
1665 } 1681 }
1666 1682
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
1990 const std::vector<gfx::Rect>& character_bounds) { 2006 const std::vector<gfx::Rect>& character_bounds) {
1991 if (view_) 2007 if (view_)
1992 view_->ImeCompositionRangeChanged(range, character_bounds); 2008 view_->ImeCompositionRangeChanged(range, character_bounds);
1993 } 2009 }
1994 2010
1995 void RenderWidgetHostImpl::OnImeCancelComposition() { 2011 void RenderWidgetHostImpl::OnImeCancelComposition() {
1996 if (view_) 2012 if (view_)
1997 view_->ImeCancelComposition(); 2013 view_->ImeCancelComposition();
1998 } 2014 }
1999 2015
2016 void RenderWidgetHostImpl::OnShowTextSuggestionMenu(
2017 const std::vector<blink::WebTextSuggestionInfo>& suggestionInfos) {
2018 if (view_)
2019 view_->ShowTextSuggestionMenu(suggestionInfos);
2020 }
2021
2000 void RenderWidgetHostImpl::OnLockMouse(bool user_gesture, 2022 void RenderWidgetHostImpl::OnLockMouse(bool user_gesture,
2001 bool last_unlocked_by_target, 2023 bool last_unlocked_by_target,
2002 bool privileged) { 2024 bool privileged) {
2003 if (pending_mouse_lock_request_) { 2025 if (pending_mouse_lock_request_) {
2004 Send(new ViewMsg_LockMouse_ACK(routing_id_, false)); 2026 Send(new ViewMsg_LockMouse_ACK(routing_id_, false));
2005 return; 2027 return;
2006 } 2028 }
2007 2029
2008 pending_mouse_lock_request_ = true; 2030 pending_mouse_lock_request_ = true;
2009 if (delegate_) { 2031 if (delegate_) {
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
2516 // different from the receiver's. 2538 // different from the receiver's.
2517 file_system_file.url = 2539 file_system_file.url =
2518 GURL(storage::GetIsolatedFileSystemRootURIString( 2540 GURL(storage::GetIsolatedFileSystemRootURIString(
2519 file_system_url.origin(), filesystem_id, std::string()) 2541 file_system_url.origin(), filesystem_id, std::string())
2520 .append(register_name)); 2542 .append(register_name));
2521 file_system_file.filesystem_id = filesystem_id; 2543 file_system_file.filesystem_id = filesystem_id;
2522 } 2544 }
2523 } 2545 }
2524 2546
2525 } // namespace content 2547 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698