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 1408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1419 } | 1419 } |
1420 | 1420 |
1421 void RenderViewImpl::OnUnselect() { | 1421 void RenderViewImpl::OnUnselect() { |
1422 if (!webview()) | 1422 if (!webview()) |
1423 return; | 1423 return; |
1424 | 1424 |
1425 webview()->focusedFrame()->executeCommand(WebString::fromUTF8("Unselect")); | 1425 webview()->focusedFrame()->executeCommand(WebString::fromUTF8("Unselect")); |
1426 } | 1426 } |
1427 | 1427 |
1428 void RenderViewImpl::OnSetEditableSelectionOffsets(int start, int end) { | 1428 void RenderViewImpl::OnSetEditableSelectionOffsets(int start, int end) { |
| 1429 handling_ime_event_ = true; |
1429 webview()->setEditableSelectionOffsets(start, end); | 1430 webview()->setEditableSelectionOffsets(start, end); |
| 1431 handling_ime_event_ = false; |
| 1432 UpdateTextInputState(DO_NOT_SHOW_IME); |
1430 } | 1433 } |
1431 | 1434 |
1432 void RenderViewImpl::OnSetCompositionFromExistingText( | 1435 void RenderViewImpl::OnSetCompositionFromExistingText( |
1433 int start, int end, | 1436 int start, int end, |
1434 const std::vector<WebKit::WebCompositionUnderline>& underlines) { | 1437 const std::vector<WebKit::WebCompositionUnderline>& underlines) { |
1435 if (!webview()) | 1438 if (!webview()) |
1436 return; | 1439 return; |
| 1440 handling_ime_event_ = true; |
1437 webview()->setCompositionFromExistingText(start, end, underlines); | 1441 webview()->setCompositionFromExistingText(start, end, underlines); |
| 1442 handling_ime_event_ = false; |
| 1443 UpdateTextInputState(DO_NOT_SHOW_IME); |
1438 } | 1444 } |
1439 | 1445 |
1440 void RenderViewImpl::OnExtendSelectionAndDelete(int before, int after) { | 1446 void RenderViewImpl::OnExtendSelectionAndDelete(int before, int after) { |
1441 if (!webview()) | 1447 if (!webview()) |
1442 return; | 1448 return; |
| 1449 handling_ime_event_ = true; |
1443 webview()->extendSelectionAndDelete(before, after); | 1450 webview()->extendSelectionAndDelete(before, after); |
| 1451 handling_ime_event_ = false; |
| 1452 UpdateTextInputState(DO_NOT_SHOW_IME); |
1444 } | 1453 } |
1445 | 1454 |
1446 void RenderViewImpl::OnSelectRange(const gfx::Point& start, | 1455 void RenderViewImpl::OnSelectRange(const gfx::Point& start, |
1447 const gfx::Point& end) { | 1456 const gfx::Point& end) { |
1448 if (!webview()) | 1457 if (!webview()) |
1449 return; | 1458 return; |
1450 | 1459 |
1451 Send(new ViewHostMsg_SelectRange_ACK(routing_id_)); | 1460 Send(new ViewHostMsg_SelectRange_ACK(routing_id_)); |
1452 | 1461 |
1453 handling_select_range_ = true; | 1462 handling_select_range_ = true; |
(...skipping 5168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6622 } | 6631 } |
6623 #endif | 6632 #endif |
6624 | 6633 |
6625 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( | 6634 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( |
6626 TransportDIB::Handle dib_handle) { | 6635 TransportDIB::Handle dib_handle) { |
6627 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); | 6636 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); |
6628 RenderProcess::current()->ReleaseTransportDIB(dib); | 6637 RenderProcess::current()->ReleaseTransportDIB(dib); |
6629 } | 6638 } |
6630 | 6639 |
6631 } // namespace content | 6640 } // namespace content |
OLD | NEW |