Chromium Code Reviews| Index: chrome/browser/tab_contents/spelling_menu_observer.cc |
| diff --git a/chrome/browser/tab_contents/spelling_menu_observer.cc b/chrome/browser/tab_contents/spelling_menu_observer.cc |
| index 8170d0009be4dd84fb5c368b3a8e08a47b895f7c..46222fc7d59d0459c336771864ea350179b5b0f8 100644 |
| --- a/chrome/browser/tab_contents/spelling_menu_observer.cc |
| +++ b/chrome/browser/tab_contents/spelling_menu_observer.cc |
| @@ -86,9 +86,10 @@ void SpellingMenuObserver::InitMenu(const content::ContextMenuParams& params) { |
| // item now since Chrome will call IsCommandIdEnabled() and disable it.) |
| loading_message_ = |
| l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_SPELLING_CHECKING); |
| - proxy_->AddMenuItem(IDC_CONTENT_CONTEXT_SPELLING_SUGGESTION, |
| - loading_message_); |
| - |
| + if (!useSpellingService) { |
|
groby-ooo-7-16
2012/12/21 22:18:13
Can you add a browsertest?
rpetterson
2013/01/04 00:05:34
Done.
|
| + proxy_->AddMenuItem(IDC_CONTENT_CONTEXT_SPELLING_SUGGESTION, |
| + loading_message_); |
| + } |
| // Invoke a JSON-RPC call to the Spelling service in the background so we |
| // can update the placeholder item when we receive its response. It also |
| // starts the animation timer so we can show animation until we receive |
| @@ -261,6 +262,7 @@ void SpellingMenuObserver::ExecuteCommand(int command_id) { |
| void SpellingMenuObserver::OnTextCheckComplete( |
| int tag, |
| bool success, |
| + SpellingServiceClient::ServiceType type, |
| const string16& text, |
| const std::vector<SpellCheckResult>& results) { |
| animation_timer_.Stop(); |
| @@ -287,15 +289,17 @@ void SpellingMenuObserver::OnTextCheckComplete( |
| } |
| } |
| } |
| - if (!succeeded_) { |
| - result_ = l10n_util::GetStringUTF16( |
| - IDS_CONTENT_CONTEXT_SPELLING_NO_SUGGESTIONS_FROM_GOOGLE); |
| - } |
| + if (type != SpellingServiceClient::SPELLCHECK) { |
|
groby-ooo-7-16
2012/12/21 22:18:13
Can you add a browsertest?
rpetterson
2013/01/04 00:05:34
I think this and the one above both cover the same
|
| + if (!succeeded_) { |
| + result_ = l10n_util::GetStringUTF16( |
| + IDS_CONTENT_CONTEXT_SPELLING_NO_SUGGESTIONS_FROM_GOOGLE); |
| + } |
| - // Update the menu item with the result text. We disable this item and hide it |
| - // when the spelling service does not provide valid suggestions. |
| - proxy_->UpdateMenuItem(IDC_CONTENT_CONTEXT_SPELLING_SUGGESTION, succeeded_, |
| - false, result_); |
| + // Update the menu item with the result text. We disable this item and hide |
| + // it when the spelling service does not provide valid suggestions. |
| + proxy_->UpdateMenuItem(IDC_CONTENT_CONTEXT_SPELLING_SUGGESTION, succeeded_, |
| + false, result_); |
| + } |
| } |
| void SpellingMenuObserver::OnAnimationTimerExpired() { |