| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/tab_contents/spellchecker_submenu_observer.h" | 5 #include "chrome/browser/tab_contents/spellchecker_submenu_observer.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
| 9 #include "chrome/browser/prefs/pref_service.h" | 9 #include "chrome/browser/prefs/pref_service.h" |
| 10 #include "chrome/browser/spellchecker/spellcheck_platform_mac.h" | 10 #include "chrome/browser/spellchecker/spellcheck_platform_mac.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 const content::ContextMenuParams& params) { | 37 const content::ContextMenuParams& params) { |
| 38 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 38 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 39 | 39 |
| 40 // Add an item that toggles the spelling panel. | 40 // Add an item that toggles the spelling panel. |
| 41 submenu_model_.AddCheckItem( | 41 submenu_model_.AddCheckItem( |
| 42 IDC_SPELLPANEL_TOGGLE, | 42 IDC_SPELLPANEL_TOGGLE, |
| 43 l10n_util::GetStringUTF16( | 43 l10n_util::GetStringUTF16( |
| 44 spellcheck_mac::SpellingPanelVisible() ? | 44 spellcheck_mac::SpellingPanelVisible() ? |
| 45 IDS_CONTENT_CONTEXT_HIDE_SPELLING_PANEL : | 45 IDS_CONTENT_CONTEXT_HIDE_SPELLING_PANEL : |
| 46 IDS_CONTENT_CONTEXT_SHOW_SPELLING_PANEL)); | 46 IDS_CONTENT_CONTEXT_SHOW_SPELLING_PANEL)); |
| 47 submenu_model_.AddSeparator(); | 47 submenu_model_.AddSeparator(ui::NORMAL_SEPARATOR); |
| 48 | 48 |
| 49 // Add a 'Check Spelling While Typing' item in the sub menu. | 49 // Add a 'Check Spelling While Typing' item in the sub menu. |
| 50 submenu_model_.AddCheckItem( | 50 submenu_model_.AddCheckItem( |
| 51 IDC_CHECK_SPELLING_WHILE_TYPING, | 51 IDC_CHECK_SPELLING_WHILE_TYPING, |
| 52 l10n_util::GetStringUTF16( | 52 l10n_util::GetStringUTF16( |
| 53 IDS_CONTENT_CONTEXT_CHECK_SPELLING_WHILE_TYPING)); | 53 IDS_CONTENT_CONTEXT_CHECK_SPELLING_WHILE_TYPING)); |
| 54 | 54 |
| 55 proxy_->AddSubMenu( | 55 proxy_->AddSubMenu( |
| 56 IDC_SPELLCHECK_MENU, | 56 IDC_SPELLCHECK_MENU, |
| 57 l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_SPELLCHECK_MENU), | 57 l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_SPELLCHECK_MENU), |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 if (rvh) | 116 if (rvh) |
| 117 rvh->Send(new SpellCheckMsg_ToggleSpellCheck(rvh->GetRoutingID())); | 117 rvh->Send(new SpellCheckMsg_ToggleSpellCheck(rvh->GetRoutingID())); |
| 118 break; | 118 break; |
| 119 | 119 |
| 120 case IDC_SPELLPANEL_TOGGLE: | 120 case IDC_SPELLPANEL_TOGGLE: |
| 121 rvh->Send(new SpellCheckMsg_ToggleSpellPanel( | 121 rvh->Send(new SpellCheckMsg_ToggleSpellPanel( |
| 122 rvh->GetRoutingID(), spellcheck_mac::SpellingPanelVisible())); | 122 rvh->GetRoutingID(), spellcheck_mac::SpellingPanelVisible())); |
| 123 break; | 123 break; |
| 124 } | 124 } |
| 125 } | 125 } |
| OLD | NEW |