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/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 1692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1703 | 1703 |
1704 void RenderViewImpl::OnSetName(const std::string& name) { | 1704 void RenderViewImpl::OnSetName(const std::string& name) { |
1705 if (!webview()) | 1705 if (!webview()) |
1706 return; | 1706 return; |
1707 | 1707 |
1708 webview()->mainFrame()->setName(WebString::fromUTF8(name)); | 1708 webview()->mainFrame()->setName(WebString::fromUTF8(name)); |
1709 } | 1709 } |
1710 | 1710 |
1711 void RenderViewImpl::OnSetEditableSelectionOffsets(int start, int end) { | 1711 void RenderViewImpl::OnSetEditableSelectionOffsets(int start, int end) { |
1712 base::AutoReset<bool> handling_select_range(&handling_select_range_, true); | 1712 base::AutoReset<bool> handling_select_range(&handling_select_range_, true); |
1713 if (RenderWidget::HasOutstandingImeEventAcknowledgements()) | |
aurimas (slooooooooow)
2013/07/08 16:04:49
Maybe we should create a call shouldProcessImeEven
nyquist
2013/07/09 07:47:36
Done.
| |
1714 return; | |
1713 ImeEventGuard guard(this); | 1715 ImeEventGuard guard(this); |
1714 webview()->setEditableSelectionOffsets(start, end); | 1716 webview()->setEditableSelectionOffsets(start, end); |
1715 } | 1717 } |
1716 | 1718 |
1717 void RenderViewImpl::OnSetCompositionFromExistingText( | 1719 void RenderViewImpl::OnSetCompositionFromExistingText( |
1718 int start, int end, | 1720 int start, int end, |
1719 const std::vector<WebKit::WebCompositionUnderline>& underlines) { | 1721 const std::vector<WebKit::WebCompositionUnderline>& underlines) { |
1720 if (!webview()) | 1722 if (!webview()) |
1721 return; | 1723 return; |
1724 if (RenderWidget::HasOutstandingImeEventAcknowledgements()) | |
1725 return; | |
1722 ImeEventGuard guard(this); | 1726 ImeEventGuard guard(this); |
1723 webview()->setCompositionFromExistingText(start, end, underlines); | 1727 webview()->setCompositionFromExistingText(start, end, underlines); |
1724 } | 1728 } |
1725 | 1729 |
1726 void RenderViewImpl::OnExtendSelectionAndDelete(int before, int after) { | 1730 void RenderViewImpl::OnExtendSelectionAndDelete(int before, int after) { |
1727 if (!webview()) | 1731 if (!webview()) |
1728 return; | 1732 return; |
1733 if (RenderWidget::HasOutstandingImeEventAcknowledgements()) | |
1734 return; | |
1729 ImeEventGuard guard(this); | 1735 ImeEventGuard guard(this); |
1730 webview()->extendSelectionAndDelete(before, after); | 1736 webview()->extendSelectionAndDelete(before, after); |
1731 } | 1737 } |
1732 | 1738 |
1733 void RenderViewImpl::OnSetHistoryLengthAndPrune(int history_length, | 1739 void RenderViewImpl::OnSetHistoryLengthAndPrune(int history_length, |
1734 int32 minimum_page_id) { | 1740 int32 minimum_page_id) { |
1735 DCHECK_GE(history_length, 0); | 1741 DCHECK_GE(history_length, 0); |
1736 DCHECK(history_list_offset_ == history_list_length_ - 1); | 1742 DCHECK(history_list_offset_ == history_list_length_ - 1); |
1737 DCHECK_GE(minimum_page_id, -1); | 1743 DCHECK_GE(minimum_page_id, -1); |
1738 | 1744 |
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2313 double load_progress) { | 2319 double load_progress) { |
2314 if (load_progress_tracker_ != NULL) | 2320 if (load_progress_tracker_ != NULL) |
2315 load_progress_tracker_->DidChangeLoadProgress(frame, load_progress); | 2321 load_progress_tracker_->DidChangeLoadProgress(frame, load_progress); |
2316 } | 2322 } |
2317 | 2323 |
2318 void RenderViewImpl::didCancelCompositionOnSelectionChange() { | 2324 void RenderViewImpl::didCancelCompositionOnSelectionChange() { |
2319 Send(new ViewHostMsg_ImeCancelComposition(routing_id())); | 2325 Send(new ViewHostMsg_ImeCancelComposition(routing_id())); |
2320 } | 2326 } |
2321 | 2327 |
2322 void RenderViewImpl::didChangeSelection(bool is_empty_selection) { | 2328 void RenderViewImpl::didChangeSelection(bool is_empty_selection) { |
2323 if (!handling_input_event_ && !handling_select_range_) | 2329 if (!handling_input_event_ && !handling_select_range_ && |
2330 !RenderWidget::has_strict_ime_processing()) { | |
2324 return; | 2331 return; |
2332 } | |
2325 | 2333 |
2326 if (is_empty_selection) | 2334 if (is_empty_selection) |
2327 selection_text_.clear(); | 2335 selection_text_.clear(); |
2328 | 2336 |
2329 SyncSelectionIfRequired(); | 2337 SyncSelectionIfRequired(); |
2330 UpdateTextInputType(); | 2338 UpdateTextInputType(); |
2331 #if defined(OS_ANDROID) | 2339 #if defined(OS_ANDROID) |
2332 UpdateTextInputState(DO_NOT_SHOW_IME); | 2340 UpdateTextInputState(DO_NOT_SHOW_IME); |
2333 #endif | 2341 #endif |
2334 } | 2342 } |
(...skipping 4454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6789 WebURL url = icon_urls[i].iconURL(); | 6797 WebURL url = icon_urls[i].iconURL(); |
6790 if (!url.isEmpty()) | 6798 if (!url.isEmpty()) |
6791 urls.push_back(FaviconURL(url, | 6799 urls.push_back(FaviconURL(url, |
6792 ToFaviconType(icon_urls[i].iconType()))); | 6800 ToFaviconType(icon_urls[i].iconType()))); |
6793 } | 6801 } |
6794 SendUpdateFaviconURL(urls); | 6802 SendUpdateFaviconURL(urls); |
6795 } | 6803 } |
6796 | 6804 |
6797 | 6805 |
6798 } // namespace content | 6806 } // namespace content |
OLD | NEW |