OLD | NEW |
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/spellchecker_submenu_observer.h" | 5 #include "chrome/browser/renderer_context_menu/spellchecker_submenu_observer.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
10 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" | 10 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 : proxy_(proxy), | 37 : proxy_(proxy), |
38 submenu_model_(delegate) { | 38 submenu_model_(delegate) { |
39 DCHECK(proxy_); | 39 DCHECK(proxy_); |
40 } | 40 } |
41 | 41 |
42 SpellCheckerSubMenuObserver::~SpellCheckerSubMenuObserver() { | 42 SpellCheckerSubMenuObserver::~SpellCheckerSubMenuObserver() { |
43 } | 43 } |
44 | 44 |
45 void SpellCheckerSubMenuObserver::InitMenu( | 45 void SpellCheckerSubMenuObserver::InitMenu( |
46 const content::ContextMenuParams& params) { | 46 const content::ContextMenuParams& params) { |
47 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 47 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
48 | 48 |
49 // Add an item that toggles the spelling panel. | 49 // Add an item that toggles the spelling panel. |
50 submenu_model_.AddCheckItem( | 50 submenu_model_.AddCheckItem( |
51 IDC_SPELLPANEL_TOGGLE, | 51 IDC_SPELLPANEL_TOGGLE, |
52 l10n_util::GetStringUTF16( | 52 l10n_util::GetStringUTF16( |
53 spellcheck_mac::SpellingPanelVisible() ? | 53 spellcheck_mac::SpellingPanelVisible() ? |
54 IDS_CONTENT_CONTEXT_HIDE_SPELLING_PANEL : | 54 IDS_CONTENT_CONTEXT_HIDE_SPELLING_PANEL : |
55 IDS_CONTENT_CONTEXT_SHOW_SPELLING_PANEL)); | 55 IDS_CONTENT_CONTEXT_SHOW_SPELLING_PANEL)); |
56 submenu_model_.AddSeparator(ui::NORMAL_SEPARATOR); | 56 submenu_model_.AddSeparator(ui::NORMAL_SEPARATOR); |
57 | 57 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 prefs::kEnableContinuousSpellcheck, | 123 prefs::kEnableContinuousSpellcheck, |
124 !GetPrefs(context)->GetBoolean(prefs::kEnableContinuousSpellcheck)); | 124 !GetPrefs(context)->GetBoolean(prefs::kEnableContinuousSpellcheck)); |
125 break; | 125 break; |
126 | 126 |
127 case IDC_SPELLPANEL_TOGGLE: | 127 case IDC_SPELLPANEL_TOGGLE: |
128 rvh->Send(new SpellCheckMsg_ToggleSpellPanel( | 128 rvh->Send(new SpellCheckMsg_ToggleSpellPanel( |
129 rvh->GetRoutingID(), spellcheck_mac::SpellingPanelVisible())); | 129 rvh->GetRoutingID(), spellcheck_mac::SpellingPanelVisible())); |
130 break; | 130 break; |
131 } | 131 } |
132 } | 132 } |
OLD | NEW |