| 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 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 return true; | 539 return true; |
| 540 } | 540 } |
| 541 | 541 |
| 542 bool BrowserPlugin::setComposition( | 542 bool BrowserPlugin::setComposition( |
| 543 const blink::WebString& text, | 543 const blink::WebString& text, |
| 544 const blink::WebVector<blink::WebCompositionUnderline>& underlines, | 544 const blink::WebVector<blink::WebCompositionUnderline>& underlines, |
| 545 int selectionStart, | 545 int selectionStart, |
| 546 int selectionEnd) { | 546 int selectionEnd) { |
| 547 if (!attached()) | 547 if (!attached()) |
| 548 return false; | 548 return false; |
| 549 |
| 549 std::vector<blink::WebCompositionUnderline> std_underlines; | 550 std::vector<blink::WebCompositionUnderline> std_underlines; |
| 550 for (size_t i = 0; i < underlines.size(); ++i) { | 551 for (size_t i = 0; i < underlines.size(); ++i) { |
| 551 std_underlines.push_back(underlines[i]); | 552 std_underlines.push_back(underlines[i]); |
| 552 } | 553 } |
| 554 |
| 553 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_ImeSetComposition( | 555 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_ImeSetComposition( |
| 554 browser_plugin_instance_id_, | 556 browser_plugin_instance_id_, |
| 555 text.utf8(), | 557 text.utf8(), |
| 556 std_underlines, | 558 std_underlines, |
| 557 selectionStart, | 559 selectionStart, |
| 558 selectionEnd)); | 560 selectionEnd)); |
| 559 // TODO(kochi): This assumes the IPC handling always succeeds. | 561 // TODO(kochi): This assumes the IPC handling always succeeds. |
| 560 return true; | 562 return true; |
| 561 } | 563 } |
| 562 | 564 |
| 563 bool BrowserPlugin::commitText(const blink::WebString& text, | 565 bool BrowserPlugin::commitText( |
| 564 int relative_cursor_pos) { | 566 const blink::WebString& text, |
| 567 const blink::WebVector<blink::WebCompositionUnderline>& underlines, |
| 568 int relative_cursor_pos) { |
| 565 if (!attached()) | 569 if (!attached()) |
| 566 return false; | 570 return false; |
| 567 | 571 |
| 572 std::vector<blink::WebCompositionUnderline> std_underlines; |
| 573 for (size_t i = 0; i < underlines.size(); ++i) { |
| 574 std_underlines.push_back(std_underlines[i]); |
| 575 } |
| 576 |
| 568 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_ImeCommitText( | 577 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_ImeCommitText( |
| 569 browser_plugin_instance_id_, text.utf8(), relative_cursor_pos)); | 578 browser_plugin_instance_id_, text.utf8(), std_underlines, |
| 579 relative_cursor_pos)); |
| 570 // TODO(kochi): This assumes the IPC handling always succeeds. | 580 // TODO(kochi): This assumes the IPC handling always succeeds. |
| 571 return true; | 581 return true; |
| 572 } | 582 } |
| 573 | 583 |
| 574 bool BrowserPlugin::finishComposingText( | 584 bool BrowserPlugin::finishComposingText( |
| 575 blink::WebInputMethodController::ConfirmCompositionBehavior | 585 blink::WebInputMethodController::ConfirmCompositionBehavior |
| 576 selection_behavior) { | 586 selection_behavior) { |
| 577 if (!attached()) | 587 if (!attached()) |
| 578 return false; | 588 return false; |
| 579 bool keep_selection = | 589 bool keep_selection = |
| (...skipping 29 matching lines...) Expand all Loading... |
| 609 | 619 |
| 610 bool BrowserPlugin::HandleMouseLockedInputEvent( | 620 bool BrowserPlugin::HandleMouseLockedInputEvent( |
| 611 const blink::WebMouseEvent& event) { | 621 const blink::WebMouseEvent& event) { |
| 612 BrowserPluginManager::Get()->Send( | 622 BrowserPluginManager::Get()->Send( |
| 613 new BrowserPluginHostMsg_HandleInputEvent(browser_plugin_instance_id_, | 623 new BrowserPluginHostMsg_HandleInputEvent(browser_plugin_instance_id_, |
| 614 &event)); | 624 &event)); |
| 615 return true; | 625 return true; |
| 616 } | 626 } |
| 617 | 627 |
| 618 } // namespace content | 628 } // namespace content |
| OLD | NEW |