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 1708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1719 | 1719 |
1720 void RenderViewImpl::OnSetName(const std::string& name) { | 1720 void RenderViewImpl::OnSetName(const std::string& name) { |
1721 if (!webview()) | 1721 if (!webview()) |
1722 return; | 1722 return; |
1723 | 1723 |
1724 webview()->mainFrame()->setName(WebString::fromUTF8(name)); | 1724 webview()->mainFrame()->setName(WebString::fromUTF8(name)); |
1725 } | 1725 } |
1726 | 1726 |
1727 void RenderViewImpl::OnSetEditableSelectionOffsets(int start, int end) { | 1727 void RenderViewImpl::OnSetEditableSelectionOffsets(int start, int end) { |
1728 base::AutoReset<bool> handling_select_range(&handling_select_range_, true); | 1728 base::AutoReset<bool> handling_select_range(&handling_select_range_, true); |
1729 if (!RenderWidget::ShouldHandleImeEvent()) | |
1730 return; | |
1729 ImeEventGuard guard(this); | 1731 ImeEventGuard guard(this); |
1730 webview()->setEditableSelectionOffsets(start, end); | 1732 webview()->setEditableSelectionOffsets(start, end); |
1731 } | 1733 } |
1732 | 1734 |
1733 void RenderViewImpl::OnSetCompositionFromExistingText( | 1735 void RenderViewImpl::OnSetCompositionFromExistingText( |
1734 int start, int end, | 1736 int start, int end, |
1735 const std::vector<WebKit::WebCompositionUnderline>& underlines) { | 1737 const std::vector<WebKit::WebCompositionUnderline>& underlines) { |
1736 if (!webview()) | 1738 if (!RenderWidget::ShouldHandleImeEvent()) |
aurimas (slooooooooow)
2013/07/09 14:34:03
Do you need to specify RenderWidget:: even though
nyquist
2013/07/12 05:55:24
Done.
| |
1737 return; | 1739 return; |
1738 ImeEventGuard guard(this); | 1740 ImeEventGuard guard(this); |
1739 webview()->setCompositionFromExistingText(start, end, underlines); | 1741 webview()->setCompositionFromExistingText(start, end, underlines); |
1740 } | 1742 } |
1741 | 1743 |
1742 void RenderViewImpl::OnExtendSelectionAndDelete(int before, int after) { | 1744 void RenderViewImpl::OnExtendSelectionAndDelete(int before, int after) { |
1743 if (!webview()) | 1745 if (!RenderWidget::ShouldHandleImeEvent()) |
1744 return; | 1746 return; |
1745 ImeEventGuard guard(this); | 1747 ImeEventGuard guard(this); |
1746 webview()->extendSelectionAndDelete(before, after); | 1748 webview()->extendSelectionAndDelete(before, after); |
1747 } | 1749 } |
1748 | 1750 |
1749 void RenderViewImpl::OnSetHistoryLengthAndPrune(int history_length, | 1751 void RenderViewImpl::OnSetHistoryLengthAndPrune(int history_length, |
1750 int32 minimum_page_id) { | 1752 int32 minimum_page_id) { |
1751 DCHECK_GE(history_length, 0); | 1753 DCHECK_GE(history_length, 0); |
1752 DCHECK(history_list_offset_ == history_list_length_ - 1); | 1754 DCHECK(history_list_offset_ == history_list_length_ - 1); |
1753 DCHECK_GE(minimum_page_id, -1); | 1755 DCHECK_GE(minimum_page_id, -1); |
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2332 double load_progress) { | 2334 double load_progress) { |
2333 if (load_progress_tracker_ != NULL) | 2335 if (load_progress_tracker_ != NULL) |
2334 load_progress_tracker_->DidChangeLoadProgress(frame, load_progress); | 2336 load_progress_tracker_->DidChangeLoadProgress(frame, load_progress); |
2335 } | 2337 } |
2336 | 2338 |
2337 void RenderViewImpl::didCancelCompositionOnSelectionChange() { | 2339 void RenderViewImpl::didCancelCompositionOnSelectionChange() { |
2338 Send(new ViewHostMsg_ImeCancelComposition(routing_id())); | 2340 Send(new ViewHostMsg_ImeCancelComposition(routing_id())); |
2339 } | 2341 } |
2340 | 2342 |
2341 void RenderViewImpl::didChangeSelection(bool is_empty_selection) { | 2343 void RenderViewImpl::didChangeSelection(bool is_empty_selection) { |
2342 if (!handling_input_event_ && !handling_select_range_) | 2344 if (!handling_input_event_ && !handling_select_range_) { |
2345 #if defined(OS_ANDROID) | |
2346 if (!RenderWidget::has_ordered_ime_processing()) | |
2347 return; | |
2348 #else | |
2343 return; | 2349 return; |
2350 #endif | |
2351 } | |
2344 | 2352 |
2345 if (is_empty_selection) | 2353 if (is_empty_selection) |
2346 selection_text_.clear(); | 2354 selection_text_.clear(); |
2347 | 2355 |
2348 SyncSelectionIfRequired(); | 2356 SyncSelectionIfRequired(); |
2349 UpdateTextInputType(); | 2357 UpdateTextInputType(); |
2350 #if defined(OS_ANDROID) | 2358 #if defined(OS_ANDROID) |
2351 UpdateTextInputState(DO_NOT_SHOW_IME); | 2359 UpdateTextInputState(DO_NOT_SHOW_IME); |
2352 #endif | 2360 #endif |
2353 } | 2361 } |
(...skipping 4457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6811 WebURL url = icon_urls[i].iconURL(); | 6819 WebURL url = icon_urls[i].iconURL(); |
6812 if (!url.isEmpty()) | 6820 if (!url.isEmpty()) |
6813 urls.push_back(FaviconURL(url, | 6821 urls.push_back(FaviconURL(url, |
6814 ToFaviconType(icon_urls[i].iconType()))); | 6822 ToFaviconType(icon_urls[i].iconType()))); |
6815 } | 6823 } |
6816 SendUpdateFaviconURL(urls); | 6824 SendUpdateFaviconURL(urls); |
6817 } | 6825 } |
6818 | 6826 |
6819 | 6827 |
6820 } // namespace content | 6828 } // namespace content |
OLD | NEW |