| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/renderer/render_view.h" | 5 #include "chrome/renderer/render_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 1695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1706 routing_id_, frame->url(), UTF16ToWideHack(message), &success, | 1706 routing_id_, frame->url(), UTF16ToWideHack(message), &success, |
| 1707 &ignored_result)); | 1707 &ignored_result)); |
| 1708 return success; | 1708 return success; |
| 1709 } | 1709 } |
| 1710 | 1710 |
| 1711 void RenderView::showContextMenu( | 1711 void RenderView::showContextMenu( |
| 1712 WebFrame* frame, const WebContextMenuData& data) { | 1712 WebFrame* frame, const WebContextMenuData& data) { |
| 1713 ContextMenuParams params = ContextMenuParams(data); | 1713 ContextMenuParams params = ContextMenuParams(data); |
| 1714 if (!params.misspelled_word.empty() && RenderThread::current()) { | 1714 if (!params.misspelled_word.empty() && RenderThread::current()) { |
| 1715 int misspelled_offset, misspelled_length; | 1715 int misspelled_offset, misspelled_length; |
| 1716 bool misspelled = RenderThread::current()->spellchecker()->SpellCheckWord( | 1716 bool spelled_right = RenderThread::current()->spellchecker()-> |
| 1717 params.misspelled_word.c_str(), params.misspelled_word.size(), | 1717 SpellCheckWord( |
| 1718 document_tag_, | 1718 params.misspelled_word.c_str(), params.misspelled_word.size(), |
| 1719 &misspelled_offset, &misspelled_length, | 1719 document_tag_, |
| 1720 ¶ms.dictionary_suggestions); | 1720 &misspelled_offset, &misspelled_length, |
| 1721 if (!misspelled) | 1721 ¶ms.dictionary_suggestions); |
| 1722 if (spelled_right) |
| 1722 params.misspelled_word.clear(); | 1723 params.misspelled_word.clear(); |
| 1723 } | 1724 } |
| 1724 | 1725 |
| 1725 Send(new ViewHostMsg_ContextMenu(routing_id_, params)); | 1726 Send(new ViewHostMsg_ContextMenu(routing_id_, params)); |
| 1726 } | 1727 } |
| 1727 | 1728 |
| 1728 void RenderView::setStatusText(const WebString& text) { | 1729 void RenderView::setStatusText(const WebString& text) { |
| 1729 } | 1730 } |
| 1730 | 1731 |
| 1731 void RenderView::UpdateTargetURL(const GURL& url, const GURL& fallback_url) { | 1732 void RenderView::UpdateTargetURL(const GURL& url, const GURL& fallback_url) { |
| (...skipping 2312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4044 new PluginMsg_SignalModalDialogEvent(host_window_)); | 4045 new PluginMsg_SignalModalDialogEvent(host_window_)); |
| 4045 | 4046 |
| 4046 message->EnableMessagePumping(); // Runs a nested message loop. | 4047 message->EnableMessagePumping(); // Runs a nested message loop. |
| 4047 bool rv = Send(message); | 4048 bool rv = Send(message); |
| 4048 | 4049 |
| 4049 PluginChannelHost::Broadcast( | 4050 PluginChannelHost::Broadcast( |
| 4050 new PluginMsg_ResetModalDialogEvent(host_window_)); | 4051 new PluginMsg_ResetModalDialogEvent(host_window_)); |
| 4051 | 4052 |
| 4052 return rv; | 4053 return rv; |
| 4053 } | 4054 } |
| OLD | NEW |