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

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

Issue 816403003: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 6 years 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/spellchecker_submenu_observer.h" 5 #include "chrome/browser/renderer_context_menu/spellchecker_submenu_observer.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/prefs/pref_member.h" 9 #include "base/prefs/pref_member.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 l10n_util::GetStringUTF16( 70 l10n_util::GetStringUTF16(
71 IDS_CONTENT_CONTEXT_CHECK_SPELLING_WHILE_TYPING)); 71 IDS_CONTENT_CONTEXT_CHECK_SPELLING_WHILE_TYPING));
72 72
73 // Add a check item "Ask Google for spelling suggestions" item. (This class 73 // Add a check item "Ask Google for spelling suggestions" item. (This class
74 // does not handle this item because the SpellingMenuObserver class handles it 74 // does not handle this item because the SpellingMenuObserver class handles it
75 // on behalf of this class.) 75 // on behalf of this class.)
76 submenu_model_.AddCheckItem(IDC_CONTENT_CONTEXT_SPELLING_TOGGLE, 76 submenu_model_.AddCheckItem(IDC_CONTENT_CONTEXT_SPELLING_TOGGLE,
77 l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_SPELLING_ASK_GOOGLE)); 77 l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_SPELLING_ASK_GOOGLE));
78 78
79 // Add a check item "Automatically correct spelling". 79 // Add a check item "Automatically correct spelling".
80 const CommandLine* command_line = CommandLine::ForCurrentProcess(); 80 const base::CommandLine* command_line =
81 base::CommandLine::ForCurrentProcess();
81 if (command_line->HasSwitch(switches::kEnableSpellingAutoCorrect)) { 82 if (command_line->HasSwitch(switches::kEnableSpellingAutoCorrect)) {
82 submenu_model_.AddCheckItem(IDC_CONTENT_CONTEXT_AUTOCORRECT_SPELLING_TOGGLE, 83 submenu_model_.AddCheckItem(IDC_CONTENT_CONTEXT_AUTOCORRECT_SPELLING_TOGGLE,
83 l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_SPELLING_AUTOCORRECT)); 84 l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_SPELLING_AUTOCORRECT));
84 } 85 }
85 86
86 proxy_->AddSubMenu( 87 proxy_->AddSubMenu(
87 IDC_SPELLCHECK_MENU, 88 IDC_SPELLCHECK_MENU,
88 l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_SPELLCHECK_MENU), 89 l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_SPELLCHECK_MENU),
89 &submenu_model_); 90 &submenu_model_);
90 } 91 }
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 } 170 }
170 171
171 switch (command_id) { 172 switch (command_id) {
172 case IDC_CHECK_SPELLING_WHILE_TYPING: 173 case IDC_CHECK_SPELLING_WHILE_TYPING:
173 profile->GetPrefs()->SetBoolean( 174 profile->GetPrefs()->SetBoolean(
174 prefs::kEnableContinuousSpellcheck, 175 prefs::kEnableContinuousSpellcheck,
175 !profile->GetPrefs()->GetBoolean(prefs::kEnableContinuousSpellcheck)); 176 !profile->GetPrefs()->GetBoolean(prefs::kEnableContinuousSpellcheck));
176 break; 177 break;
177 } 178 }
178 } 179 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698