| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 16 matching lines...) Expand all Loading... |
| 27 int group) | 27 int group) |
| 28 : proxy_(proxy), | 28 : proxy_(proxy), |
| 29 submenu_model_(delegate), | 29 submenu_model_(delegate), |
| 30 check_spelling_while_typing_(false) { | 30 check_spelling_while_typing_(false) { |
| 31 DCHECK(proxy_); | 31 DCHECK(proxy_); |
| 32 } | 32 } |
| 33 | 33 |
| 34 SpellCheckerSubMenuObserver::~SpellCheckerSubMenuObserver() { | 34 SpellCheckerSubMenuObserver::~SpellCheckerSubMenuObserver() { |
| 35 } | 35 } |
| 36 | 36 |
| 37 void SpellCheckerSubMenuObserver::InitMenu(const ContextMenuParams& params) { | 37 void SpellCheckerSubMenuObserver::InitMenu( |
| 38 const content::ContextMenuParams& params) { |
| 38 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 39 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 39 | 40 |
| 40 check_spelling_while_typing_ = params.spellcheck_enabled; | 41 check_spelling_while_typing_ = params.spellcheck_enabled; |
| 41 | 42 |
| 42 // Add an item that toggles the spelling panel. | 43 // Add an item that toggles the spelling panel. |
| 43 submenu_model_.AddCheckItem( | 44 submenu_model_.AddCheckItem( |
| 44 IDC_SPELLPANEL_TOGGLE, | 45 IDC_SPELLPANEL_TOGGLE, |
| 45 l10n_util::GetStringUTF16( | 46 l10n_util::GetStringUTF16( |
| 46 spellcheck_mac::SpellingPanelVisible() ? | 47 spellcheck_mac::SpellingPanelVisible() ? |
| 47 IDS_CONTENT_CONTEXT_HIDE_SPELLING_PANEL : | 48 IDS_CONTENT_CONTEXT_HIDE_SPELLING_PANEL : |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 case IDC_CHECK_SPELLING_OF_THIS_FIELD: | 122 case IDC_CHECK_SPELLING_OF_THIS_FIELD: |
| 122 rvh->Send(new SpellCheckMsg_ToggleSpellCheck(rvh->routing_id())); | 123 rvh->Send(new SpellCheckMsg_ToggleSpellCheck(rvh->routing_id())); |
| 123 break; | 124 break; |
| 124 | 125 |
| 125 case IDC_SPELLPANEL_TOGGLE: | 126 case IDC_SPELLPANEL_TOGGLE: |
| 126 rvh->Send(new SpellCheckMsg_ToggleSpellPanel( | 127 rvh->Send(new SpellCheckMsg_ToggleSpellPanel( |
| 127 rvh->routing_id(), spellcheck_mac::SpellingPanelVisible())); | 128 rvh->routing_id(), spellcheck_mac::SpellingPanelVisible())); |
| 128 break; | 129 break; |
| 129 } | 130 } |
| 130 } | 131 } |
| OLD | NEW |