OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/browser_plugin/browser_plugin.h" | 5 #include "content/renderer/browser_plugin/browser_plugin.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_ImeSetComposition( | 547 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_ImeSetComposition( |
548 browser_plugin_instance_id_, | 548 browser_plugin_instance_id_, |
549 text.utf8(), | 549 text.utf8(), |
550 std_underlines, | 550 std_underlines, |
551 selectionStart, | 551 selectionStart, |
552 selectionEnd)); | 552 selectionEnd)); |
553 // TODO(kochi): This assumes the IPC handling always succeeds. | 553 // TODO(kochi): This assumes the IPC handling always succeeds. |
554 return true; | 554 return true; |
555 } | 555 } |
556 | 556 |
557 bool BrowserPlugin::confirmComposition( | 557 bool BrowserPlugin::commitText(const blink::WebString& text, |
558 const blink::WebString& text, | 558 int relative_cursor_pos) { |
559 blink::WebWidget::ConfirmCompositionBehavior selectionBehavior) { | |
560 if (!attached()) | 559 if (!attached()) |
561 return false; | 560 return false; |
562 bool keep_selection = (selectionBehavior == blink::WebWidget::KeepSelection); | 561 |
563 BrowserPluginManager::Get()->Send( | 562 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_ImeCommitText( |
564 new BrowserPluginHostMsg_ImeConfirmComposition( | 563 browser_plugin_instance_id_, text.utf8(), relative_cursor_pos)); |
565 browser_plugin_instance_id_, | |
566 text.utf8(), | |
567 keep_selection)); | |
568 // TODO(kochi): This assumes the IPC handling always succeeds. | 564 // TODO(kochi): This assumes the IPC handling always succeeds. |
569 return true; | 565 return true; |
570 } | 566 } |
| 567 |
| 568 bool BrowserPlugin::finishComposingText( |
| 569 blink::WebWidget::ConfirmCompositionBehavior selection_behavior) { |
| 570 if (!attached()) |
| 571 return false; |
| 572 bool keep_selection = (selection_behavior == blink::WebWidget::KeepSelection); |
| 573 BrowserPluginManager::Get()->Send( |
| 574 new BrowserPluginHostMsg_ImeFinishComposingText(keep_selection)); |
| 575 // TODO(kochi): This assumes the IPC handling always succeeds. |
| 576 return true; |
| 577 } |
571 | 578 |
572 void BrowserPlugin::extendSelectionAndDelete(int before, int after) { | 579 void BrowserPlugin::extendSelectionAndDelete(int before, int after) { |
573 if (!attached()) | 580 if (!attached()) |
574 return; | 581 return; |
575 BrowserPluginManager::Get()->Send( | 582 BrowserPluginManager::Get()->Send( |
576 new BrowserPluginHostMsg_ExtendSelectionAndDelete( | 583 new BrowserPluginHostMsg_ExtendSelectionAndDelete( |
577 browser_plugin_instance_id_, | 584 browser_plugin_instance_id_, |
578 before, | 585 before, |
579 after)); | 586 after)); |
580 } | 587 } |
(...skipping 13 matching lines...) Expand all Loading... |
594 | 601 |
595 bool BrowserPlugin::HandleMouseLockedInputEvent( | 602 bool BrowserPlugin::HandleMouseLockedInputEvent( |
596 const blink::WebMouseEvent& event) { | 603 const blink::WebMouseEvent& event) { |
597 BrowserPluginManager::Get()->Send( | 604 BrowserPluginManager::Get()->Send( |
598 new BrowserPluginHostMsg_HandleInputEvent(browser_plugin_instance_id_, | 605 new BrowserPluginHostMsg_HandleInputEvent(browser_plugin_instance_id_, |
599 &event)); | 606 &event)); |
600 return true; | 607 return true; |
601 } | 608 } |
602 | 609 |
603 } // namespace content | 610 } // namespace content |
OLD | NEW |