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 1713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1724 | 1724 |
1725 void RenderViewImpl::OnSetName(const std::string& name) { | 1725 void RenderViewImpl::OnSetName(const std::string& name) { |
1726 if (!webview()) | 1726 if (!webview()) |
1727 return; | 1727 return; |
1728 | 1728 |
1729 webview()->mainFrame()->setName(WebString::fromUTF8(name)); | 1729 webview()->mainFrame()->setName(WebString::fromUTF8(name)); |
1730 } | 1730 } |
1731 | 1731 |
1732 void RenderViewImpl::OnSetEditableSelectionOffsets(int start, int end) { | 1732 void RenderViewImpl::OnSetEditableSelectionOffsets(int start, int end) { |
1733 base::AutoReset<bool> handling_select_range(&handling_select_range_, true); | 1733 base::AutoReset<bool> handling_select_range(&handling_select_range_, true); |
| 1734 if (!ShouldHandleImeEvent()) |
| 1735 return; |
1734 ImeEventGuard guard(this); | 1736 ImeEventGuard guard(this); |
1735 webview()->setEditableSelectionOffsets(start, end); | 1737 webview()->setEditableSelectionOffsets(start, end); |
1736 } | 1738 } |
1737 | 1739 |
1738 void RenderViewImpl::OnSetCompositionFromExistingText( | 1740 void RenderViewImpl::OnSetCompositionFromExistingText( |
1739 int start, int end, | 1741 int start, int end, |
1740 const std::vector<WebKit::WebCompositionUnderline>& underlines) { | 1742 const std::vector<WebKit::WebCompositionUnderline>& underlines) { |
1741 if (!webview()) | 1743 if (!ShouldHandleImeEvent()) |
1742 return; | 1744 return; |
1743 ImeEventGuard guard(this); | 1745 ImeEventGuard guard(this); |
1744 webview()->setCompositionFromExistingText(start, end, underlines); | 1746 webview()->setCompositionFromExistingText(start, end, underlines); |
1745 } | 1747 } |
1746 | 1748 |
1747 void RenderViewImpl::OnExtendSelectionAndDelete(int before, int after) { | 1749 void RenderViewImpl::OnExtendSelectionAndDelete(int before, int after) { |
1748 if (!webview()) | 1750 if (!ShouldHandleImeEvent()) |
1749 return; | 1751 return; |
1750 ImeEventGuard guard(this); | 1752 ImeEventGuard guard(this); |
1751 webview()->extendSelectionAndDelete(before, after); | 1753 webview()->extendSelectionAndDelete(before, after); |
1752 } | 1754 } |
1753 | 1755 |
1754 void RenderViewImpl::OnSetHistoryLengthAndPrune(int history_length, | 1756 void RenderViewImpl::OnSetHistoryLengthAndPrune(int history_length, |
1755 int32 minimum_page_id) { | 1757 int32 minimum_page_id) { |
1756 DCHECK_GE(history_length, 0); | 1758 DCHECK_GE(history_length, 0); |
1757 DCHECK(history_list_offset_ == history_list_length_ - 1); | 1759 DCHECK(history_list_offset_ == history_list_length_ - 1); |
1758 DCHECK_GE(minimum_page_id, -1); | 1760 DCHECK_GE(minimum_page_id, -1); |
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2358 void RenderViewImpl::didChangeSelection(bool is_empty_selection) { | 2360 void RenderViewImpl::didChangeSelection(bool is_empty_selection) { |
2359 if (!handling_input_event_ && !handling_select_range_) | 2361 if (!handling_input_event_ && !handling_select_range_) |
2360 return; | 2362 return; |
2361 | 2363 |
2362 if (is_empty_selection) | 2364 if (is_empty_selection) |
2363 selection_text_.clear(); | 2365 selection_text_.clear(); |
2364 | 2366 |
2365 SyncSelectionIfRequired(); | 2367 SyncSelectionIfRequired(); |
2366 UpdateTextInputType(); | 2368 UpdateTextInputType(); |
2367 #if defined(OS_ANDROID) | 2369 #if defined(OS_ANDROID) |
2368 UpdateTextInputState(DO_NOT_SHOW_IME); | 2370 UpdateTextInputState(DO_NOT_SHOW_IME, SEND_IME_ACK); |
2369 #endif | 2371 #endif |
2370 } | 2372 } |
2371 | 2373 |
2372 void RenderViewImpl::didExecuteCommand(const WebString& command_name) { | 2374 void RenderViewImpl::didExecuteCommand(const WebString& command_name) { |
2373 const std::string& name = UTF16ToUTF8(command_name); | 2375 const std::string& name = UTF16ToUTF8(command_name); |
2374 if (StartsWithASCII(name, "Move", true) || | 2376 if (StartsWithASCII(name, "Move", true) || |
2375 StartsWithASCII(name, "Insert", true) || | 2377 StartsWithASCII(name, "Insert", true) || |
2376 StartsWithASCII(name, "Delete", true)) | 2378 StartsWithASCII(name, "Delete", true)) |
2377 return; | 2379 return; |
2378 RenderThreadImpl::current()->RecordUserMetrics(name); | 2380 RenderThreadImpl::current()->RecordUserMetrics(name); |
(...skipping 4024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6403 WebURL url = icon_urls[i].iconURL(); | 6405 WebURL url = icon_urls[i].iconURL(); |
6404 if (!url.isEmpty()) | 6406 if (!url.isEmpty()) |
6405 urls.push_back(FaviconURL(url, | 6407 urls.push_back(FaviconURL(url, |
6406 ToFaviconType(icon_urls[i].iconType()))); | 6408 ToFaviconType(icon_urls[i].iconType()))); |
6407 } | 6409 } |
6408 SendUpdateFaviconURL(urls); | 6410 SendUpdateFaviconURL(urls); |
6409 } | 6411 } |
6410 | 6412 |
6411 | 6413 |
6412 } // namespace content | 6414 } // namespace content |
OLD | NEW |