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

Side by Side Diff: chrome/browser/renderer_context_menu/spelling_menu_observer.cc

Issue 892953002: Show icons for custom menuitems in contextmenu. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/browser/renderer_context_menu/spelling_menu_observer.h" 5 #include "chrome/browser/renderer_context_menu/spelling_menu_observer.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/i18n/case_conversion.h" 9 #include "base/i18n/case_conversion.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 } 373 }
374 if (type != SpellingServiceClient::SPELLCHECK) { 374 if (type != SpellingServiceClient::SPELLCHECK) {
375 if (!succeeded_) { 375 if (!succeeded_) {
376 result_ = l10n_util::GetStringUTF16( 376 result_ = l10n_util::GetStringUTF16(
377 IDS_CONTENT_CONTEXT_SPELLING_NO_SUGGESTIONS_FROM_GOOGLE); 377 IDS_CONTENT_CONTEXT_SPELLING_NO_SUGGESTIONS_FROM_GOOGLE);
378 } 378 }
379 379
380 // Update the menu item with the result text. We disable this item and hide 380 // Update the menu item with the result text. We disable this item and hide
381 // it when the spelling service does not provide valid suggestions. 381 // it when the spelling service does not provide valid suggestions.
382 proxy_->UpdateMenuItem(IDC_CONTENT_CONTEXT_SPELLING_SUGGESTION, succeeded_, 382 proxy_->UpdateMenuItem(IDC_CONTENT_CONTEXT_SPELLING_SUGGESTION, succeeded_,
383 false, result_); 383 false, result_, NULL);
384 } 384 }
385 } 385 }
386 386
387 void SpellingMenuObserver::OnAnimationTimerExpired() { 387 void SpellingMenuObserver::OnAnimationTimerExpired() {
388 // Append '.' characters to the end of "Checking". 388 // Append '.' characters to the end of "Checking".
389 loading_frame_ = (loading_frame_ + 1) & 3; 389 loading_frame_ = (loading_frame_ + 1) & 3;
390 base::string16 loading_message = 390 base::string16 loading_message =
391 loading_message_ + base::string16(loading_frame_,'.'); 391 loading_message_ + base::string16(loading_frame_,'.');
392 392
393 // Update the menu item with the text. We disable this item to prevent users 393 // Update the menu item with the text. We disable this item to prevent users
394 // from selecting it. 394 // from selecting it.
395 proxy_->UpdateMenuItem(IDC_CONTENT_CONTEXT_SPELLING_SUGGESTION, false, false, 395 proxy_->UpdateMenuItem(IDC_CONTENT_CONTEXT_SPELLING_SUGGESTION, false, false,
396 loading_message); 396 loading_message, NULL);
397 } 397 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698