Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(355)

Side by Side Diff: chrome/browser/tab_contents/render_view_context_menu.cc

Issue 7121006: Introduced additional spellcheck related histogram. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moved code from render_view_host.cc to to rneder_view_context_menu.cc Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 882 matching lines...) Expand 10 before | Expand all | Expand 10 after
1639 g_browser_process->clipboard()); 1645 g_browser_process->clipboard());
1640 } 1646 }
1641 1647
1642 void RenderViewContextMenu::MediaPlayerActionAt( 1648 void RenderViewContextMenu::MediaPlayerActionAt(
1643 const gfx::Point& location, 1649 const gfx::Point& location,
1644 const WebMediaPlayerAction& action) { 1650 const WebMediaPlayerAction& action) {
1645 RenderViewHost* rvh = source_tab_contents_->render_view_host(); 1651 RenderViewHost* rvh = source_tab_contents_->render_view_host();
1646 rvh->Send(new ViewMsg_MediaPlayerActionAt( 1652 rvh->Send(new ViewMsg_MediaPlayerActionAt(
1647 rvh->routing_id(), location, action)); 1653 rvh->routing_id(), location, action));
1648 } 1654 }
OLDNEW
« chrome/browser/spellcheck_host_impl.h ('K') | « chrome/browser/spellcheck_host_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698