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

Unified Diff: chrome/browser/tab_contents/render_view_context_menu.cc

Issue 8422006: Adds a bubble that asks a user whether to integrate the Spelling service. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/profiles/profile.cc ('k') | chrome/browser/tab_contents/spellchecker_submenu_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/render_view_context_menu.cc
===================================================================
--- chrome/browser/tab_contents/render_view_context_menu.cc (revision 108037)
+++ chrome/browser/tab_contents/render_view_context_menu.cc (working copy)
@@ -576,17 +576,14 @@
if (params_.is_editable) {
// Add a menu item that shows suggestions.
if (!spelling_menu_observer_.get()) {
- spelling_menu_observer_.reset(
- new SpellingMenuObserver(this));
+ spelling_menu_observer_.reset(new SpellingMenuObserver(this));
}
- if (spelling_menu_observer_.get())
+ if (spelling_menu_observer_.get()) {
observers_.AddObserver(spelling_menu_observer_.get());
+ spelling_menu_observer_->InitMenu(params_);
+ }
}
- // Ask our observers to add their menu items.
- FOR_EACH_OBSERVER(RenderViewContextMenuObserver, observers_,
- InitMenu(params_));
-
if (params_.is_editable)
AppendEditableItems();
else if (has_selection)
@@ -838,13 +835,6 @@
}
void RenderViewContextMenu::AppendEditableItems() {
- // Append Dictionary spell check suggestions.
- for (size_t i = 0; i < params_.dictionary_suggestions.size() &&
- IDC_SPELLCHECK_SUGGESTION_0 + i <= IDC_SPELLCHECK_SUGGESTION_LAST;
- ++i) {
- menu_model_.AddItem(IDC_SPELLCHECK_SUGGESTION_0 + static_cast<int>(i),
- params_.dictionary_suggestions[i]);
- }
if (!params_.dictionary_suggestions.empty()) {
menu_model_.AddSeparator();
@@ -1234,11 +1224,6 @@
case IDC_CONTENT_CONTEXT_SEARCHWEBFOR:
case IDC_CONTENT_CONTEXT_GOTOURL:
- case IDC_SPELLCHECK_SUGGESTION_0:
- case IDC_SPELLCHECK_SUGGESTION_1:
- case IDC_SPELLCHECK_SUGGESTION_2:
- case IDC_SPELLCHECK_SUGGESTION_3:
- case IDC_SPELLCHECK_SUGGESTION_4:
case IDC_SPELLPANEL_TOGGLE:
#if !defined(OS_MACOSX)
// TODO(jeremy): re-enable - http://crbug.com/34512 .
@@ -1689,20 +1674,6 @@
break;
}
- case IDC_SPELLCHECK_SUGGESTION_0:
- case IDC_SPELLCHECK_SUGGESTION_1:
- case IDC_SPELLCHECK_SUGGESTION_2:
- case IDC_SPELLCHECK_SUGGESTION_3:
- case IDC_SPELLCHECK_SUGGESTION_4: {
- rvh->Replace(
- params_.dictionary_suggestions[id - IDC_SPELLCHECK_SUGGESTION_0]);
- // GetSpellCheckHost() can return null when the suggested word is
- // provided by Web SpellCheck API.
- SpellCheckHost* spellcheck_host = profile_->GetSpellCheckHost();
- if (spellcheck_host && spellcheck_host->GetMetrics())
- spellcheck_host->GetMetrics()->RecordReplacedWordStats(1);
- break;
- }
case IDC_SPELLCHECK_ADD_TO_DICTIONARY: {
// GetSpellCheckHost() can return null when the suggested word is
// provided by Web SpellCheck API.
« no previous file with comments | « chrome/browser/profiles/profile.cc ('k') | chrome/browser/tab_contents/spellchecker_submenu_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698