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_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 1432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1443 } | 1443 } |
1444 | 1444 |
1445 void RenderViewImpl::OnUnselect() { | 1445 void RenderViewImpl::OnUnselect() { |
1446 if (!webview()) | 1446 if (!webview()) |
1447 return; | 1447 return; |
1448 | 1448 |
1449 webview()->focusedFrame()->executeCommand(WebString::fromUTF8("Unselect")); | 1449 webview()->focusedFrame()->executeCommand(WebString::fromUTF8("Unselect")); |
1450 } | 1450 } |
1451 | 1451 |
1452 void RenderViewImpl::OnSetEditableSelectionOffsets(int start, int end) { | 1452 void RenderViewImpl::OnSetEditableSelectionOffsets(int start, int end) { |
| 1453 handling_ime_event_ = true; |
1453 webview()->setEditableSelectionOffsets(start, end); | 1454 webview()->setEditableSelectionOffsets(start, end); |
| 1455 handling_ime_event_ = false; |
| 1456 UpdateTextInputState(DO_NOT_SHOW_IME); |
1454 } | 1457 } |
1455 | 1458 |
1456 void RenderViewImpl::OnSetCompositionFromExistingText( | 1459 void RenderViewImpl::OnSetCompositionFromExistingText( |
1457 int start, int end, | 1460 int start, int end, |
1458 const std::vector<WebKit::WebCompositionUnderline>& underlines) { | 1461 const std::vector<WebKit::WebCompositionUnderline>& underlines) { |
1459 if (!webview()) | 1462 if (!webview()) |
1460 return; | 1463 return; |
| 1464 handling_ime_event_ = true; |
1461 webview()->setCompositionFromExistingText(start, end, underlines); | 1465 webview()->setCompositionFromExistingText(start, end, underlines); |
| 1466 handling_ime_event_ = false; |
| 1467 UpdateTextInputState(DO_NOT_SHOW_IME); |
1462 } | 1468 } |
1463 | 1469 |
1464 void RenderViewImpl::OnExtendSelectionAndDelete(int before, int after) { | 1470 void RenderViewImpl::OnExtendSelectionAndDelete(int before, int after) { |
1465 if (!webview()) | 1471 if (!webview()) |
1466 return; | 1472 return; |
| 1473 handling_ime_event_ = true; |
1467 webview()->extendSelectionAndDelete(before, after); | 1474 webview()->extendSelectionAndDelete(before, after); |
| 1475 handling_ime_event_ = false; |
| 1476 UpdateTextInputState(DO_NOT_SHOW_IME); |
1468 } | 1477 } |
1469 | 1478 |
1470 void RenderViewImpl::OnSelectRange(const gfx::Point& start, | 1479 void RenderViewImpl::OnSelectRange(const gfx::Point& start, |
1471 const gfx::Point& end) { | 1480 const gfx::Point& end) { |
1472 if (!webview()) | 1481 if (!webview()) |
1473 return; | 1482 return; |
1474 | 1483 |
1475 Send(new ViewHostMsg_SelectRange_ACK(routing_id_)); | 1484 Send(new ViewHostMsg_SelectRange_ACK(routing_id_)); |
1476 | 1485 |
1477 handling_select_range_ = true; | 1486 handling_select_range_ = true; |
(...skipping 5183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6661 } | 6670 } |
6662 #endif | 6671 #endif |
6663 | 6672 |
6664 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( | 6673 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( |
6665 TransportDIB::Handle dib_handle) { | 6674 TransportDIB::Handle dib_handle) { |
6666 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); | 6675 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); |
6667 RenderProcess::current()->ReleaseTransportDIB(dib); | 6676 RenderProcess::current()->ReleaseTransportDIB(dib); |
6668 } | 6677 } |
6669 | 6678 |
6670 } // namespace content | 6679 } // namespace content |
OLD | NEW |