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

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

Issue 1110473002: [chrome/browser/renderer_context_menu] favor DCHECK_CURRENTLY_ON for better logs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « chrome/browser/renderer_context_menu/spellchecker_submenu_observer_mac.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 profile->GetPrefs()); 45 profile->GetPrefs());
46 autocorrect_spelling_.Init(prefs::kEnableAutoSpellCorrect, 46 autocorrect_spelling_.Init(prefs::kEnableAutoSpellCorrect,
47 profile->GetPrefs()); 47 profile->GetPrefs());
48 } 48 }
49 } 49 }
50 50
51 SpellingMenuObserver::~SpellingMenuObserver() { 51 SpellingMenuObserver::~SpellingMenuObserver() {
52 } 52 }
53 53
54 void SpellingMenuObserver::InitMenu(const content::ContextMenuParams& params) { 54 void SpellingMenuObserver::InitMenu(const content::ContextMenuParams& params) {
55 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 55 DCHECK_CURRENTLY_ON(BrowserThread::UI);
56 DCHECK(!params.misspelled_word.empty() || 56 DCHECK(!params.misspelled_word.empty() ||
57 params.dictionary_suggestions.empty()); 57 params.dictionary_suggestions.empty());
58 58
59 // Exit if we are not in an editable element because we add a menu item only 59 // Exit if we are not in an editable element because we add a menu item only
60 // for editable elements. 60 // for editable elements.
61 content::BrowserContext* browser_context = proxy_->GetBrowserContext(); 61 content::BrowserContext* browser_context = proxy_->GetBrowserContext();
62 if (!params.is_editable || !browser_context) 62 if (!params.is_editable || !browser_context)
63 return; 63 return;
64 64
65 // Exit if there is no misspelled word. 65 // Exit if there is no misspelled word.
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 // Append '.' characters to the end of "Checking". 404 // Append '.' characters to the end of "Checking".
405 loading_frame_ = (loading_frame_ + 1) & 3; 405 loading_frame_ = (loading_frame_ + 1) & 3;
406 base::string16 loading_message = 406 base::string16 loading_message =
407 loading_message_ + base::string16(loading_frame_,'.'); 407 loading_message_ + base::string16(loading_frame_,'.');
408 408
409 // Update the menu item with the text. We disable this item to prevent users 409 // Update the menu item with the text. We disable this item to prevent users
410 // from selecting it. 410 // from selecting it.
411 proxy_->UpdateMenuItem(IDC_CONTENT_CONTEXT_SPELLING_SUGGESTION, false, false, 411 proxy_->UpdateMenuItem(IDC_CONTENT_CONTEXT_SPELLING_SUGGESTION, false, false,
412 loading_message); 412 loading_message);
413 } 413 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_context_menu/spellchecker_submenu_observer_mac.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698