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 DCHECK(!handling_ime_event_); |
| 1454 handling_ime_event_ = true; |
1453 webview()->setEditableSelectionOffsets(start, end); | 1455 webview()->setEditableSelectionOffsets(start, end); |
| 1456 handling_ime_event_ = false; |
| 1457 UpdateTextInputState(DO_NOT_SHOW_IME); |
1454 } | 1458 } |
1455 | 1459 |
1456 void RenderViewImpl::OnSetCompositionFromExistingText( | 1460 void RenderViewImpl::OnSetCompositionFromExistingText( |
1457 int start, int end, | 1461 int start, int end, |
1458 const std::vector<WebKit::WebCompositionUnderline>& underlines) { | 1462 const std::vector<WebKit::WebCompositionUnderline>& underlines) { |
1459 if (!webview()) | 1463 if (!webview()) |
1460 return; | 1464 return; |
| 1465 DCHECK(!handling_ime_event_); |
| 1466 handling_ime_event_ = true; |
1461 webview()->setCompositionFromExistingText(start, end, underlines); | 1467 webview()->setCompositionFromExistingText(start, end, underlines); |
| 1468 handling_ime_event_ = false; |
| 1469 UpdateTextInputState(DO_NOT_SHOW_IME); |
1462 } | 1470 } |
1463 | 1471 |
1464 void RenderViewImpl::OnExtendSelectionAndDelete(int before, int after) { | 1472 void RenderViewImpl::OnExtendSelectionAndDelete(int before, int after) { |
1465 if (!webview()) | 1473 if (!webview()) |
1466 return; | 1474 return; |
| 1475 DCHECK(!handling_ime_event_); |
| 1476 handling_ime_event_ = true; |
1467 webview()->extendSelectionAndDelete(before, after); | 1477 webview()->extendSelectionAndDelete(before, after); |
| 1478 handling_ime_event_ = false; |
| 1479 UpdateTextInputState(DO_NOT_SHOW_IME); |
1468 } | 1480 } |
1469 | 1481 |
1470 void RenderViewImpl::OnSelectRange(const gfx::Point& start, | 1482 void RenderViewImpl::OnSelectRange(const gfx::Point& start, |
1471 const gfx::Point& end) { | 1483 const gfx::Point& end) { |
1472 if (!webview()) | 1484 if (!webview()) |
1473 return; | 1485 return; |
1474 | 1486 |
1475 Send(new ViewHostMsg_SelectRange_ACK(routing_id_)); | 1487 Send(new ViewHostMsg_SelectRange_ACK(routing_id_)); |
1476 | 1488 |
1477 handling_select_range_ = true; | 1489 handling_select_range_ = true; |
(...skipping 5140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6618 } | 6630 } |
6619 #endif | 6631 #endif |
6620 | 6632 |
6621 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( | 6633 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( |
6622 TransportDIB::Handle dib_handle) { | 6634 TransportDIB::Handle dib_handle) { |
6623 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); | 6635 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); |
6624 RenderProcess::current()->ReleaseTransportDIB(dib); | 6636 RenderProcess::current()->ReleaseTransportDIB(dib); |
6625 } | 6637 } |
6626 | 6638 |
6627 } // namespace content | 6639 } // namespace content |
OLD | NEW |