| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <set> | 6 #include <set> |
| 7 | 7 |
| 8 #include "chrome/browser/tab_contents/render_view_context_menu.h" | 8 #include "chrome/browser/tab_contents/render_view_context_menu.h" |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 734 } | 734 } |
| 735 | 735 |
| 736 void RenderViewContextMenu::AppendEditableItems() { | 736 void RenderViewContextMenu::AppendEditableItems() { |
| 737 // Append Dictionary spell check suggestions. | 737 // Append Dictionary spell check suggestions. |
| 738 for (size_t i = 0; i < params_.dictionary_suggestions.size() && | 738 for (size_t i = 0; i < params_.dictionary_suggestions.size() && |
| 739 IDC_SPELLCHECK_SUGGESTION_0 + i <= IDC_SPELLCHECK_SUGGESTION_LAST; | 739 IDC_SPELLCHECK_SUGGESTION_0 + i <= IDC_SPELLCHECK_SUGGESTION_LAST; |
| 740 ++i) { | 740 ++i) { |
| 741 menu_model_.AddItem(IDC_SPELLCHECK_SUGGESTION_0 + static_cast<int>(i), | 741 menu_model_.AddItem(IDC_SPELLCHECK_SUGGESTION_0 + static_cast<int>(i), |
| 742 params_.dictionary_suggestions[i]); | 742 params_.dictionary_suggestions[i]); |
| 743 } | 743 } |
| 744 if (!params_.dictionary_suggestions.empty()) | 744 if (!params_.dictionary_suggestions.empty()) { |
| 745 menu_model_.AddSeparator(); | 745 menu_model_.AddSeparator(); |
| 746 | 746 |
| 747 SpellCheckHost* spellcheck_host = profile_->GetSpellCheckHost(); |
| 748 DCHECK(spellcheck_host); |
| 749 if (spellcheck_host) |
| 750 spellcheck_host->RecordSuggestionStats(1); |
| 751 } |
| 752 |
| 747 // If word is misspelled, give option for "Add to dictionary" | 753 // If word is misspelled, give option for "Add to dictionary" |
| 748 if (!params_.misspelled_word.empty()) { | 754 if (!params_.misspelled_word.empty()) { |
| 749 if (params_.dictionary_suggestions.empty()) { | 755 if (params_.dictionary_suggestions.empty()) { |
| 750 menu_model_.AddItem(0, | 756 menu_model_.AddItem(0, |
| 751 l10n_util::GetStringUTF16( | 757 l10n_util::GetStringUTF16( |
| 752 IDS_CONTENT_CONTEXT_NO_SPELLING_SUGGESTIONS)); | 758 IDS_CONTENT_CONTEXT_NO_SPELLING_SUGGESTIONS)); |
| 753 } | 759 } |
| 754 menu_model_.AddItemWithStringId(IDC_SPELLCHECK_ADD_TO_DICTIONARY, | 760 menu_model_.AddItemWithStringId(IDC_SPELLCHECK_ADD_TO_DICTIONARY, |
| 755 IDS_CONTENT_CONTEXT_ADD_TO_DICTIONARY); | 761 IDS_CONTENT_CONTEXT_ADD_TO_DICTIONARY); |
| 756 menu_model_.AddSeparator(); | 762 menu_model_.AddSeparator(); |
| (...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1634 g_browser_process->clipboard()); | 1640 g_browser_process->clipboard()); |
| 1635 } | 1641 } |
| 1636 | 1642 |
| 1637 void RenderViewContextMenu::MediaPlayerActionAt( | 1643 void RenderViewContextMenu::MediaPlayerActionAt( |
| 1638 const gfx::Point& location, | 1644 const gfx::Point& location, |
| 1639 const WebMediaPlayerAction& action) { | 1645 const WebMediaPlayerAction& action) { |
| 1640 RenderViewHost* rvh = source_tab_contents_->render_view_host(); | 1646 RenderViewHost* rvh = source_tab_contents_->render_view_host(); |
| 1641 rvh->Send(new ViewMsg_MediaPlayerActionAt( | 1647 rvh->Send(new ViewMsg_MediaPlayerActionAt( |
| 1642 rvh->routing_id(), location, action)); | 1648 rvh->routing_id(), location, action)); |
| 1643 } | 1649 } |
| OLD | NEW |