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

Side by Side Diff: chrome/browser/renderer_host/chrome_render_widget_host_view_mac_delegate.mm

Issue 2254533003: Rename spellcheck::pref::kEnableContinuousSpellcheck to ...::kEnableSpellcheck (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 4 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
OLDNEW
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 #import "chrome/browser/renderer_host/chrome_render_widget_host_view_mac_delegat e.h" 5 #import "chrome/browser/renderer_host/chrome_render_widget_host_view_mac_delegat e.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/strings/sys_string_conversions.h" 9 #include "base/strings/sys_string_conversions.h"
10 #include "chrome/browser/devtools/devtools_window.h" 10 #include "chrome/browser/devtools/devtools_window.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 117
118 // TODO(groby): Clarify who sends this and if toggleContinuousSpellChecking: 118 // TODO(groby): Clarify who sends this and if toggleContinuousSpellChecking:
119 // is still necessary. 119 // is still necessary.
120 if (action == @selector(toggleContinuousSpellChecking:)) { 120 if (action == @selector(toggleContinuousSpellChecking:)) {
121 if ([(id)item respondsToSelector:@selector(setState:)]) { 121 if ([(id)item respondsToSelector:@selector(setState:)]) {
122 content::RenderProcessHost* host = renderWidgetHost_->GetProcess(); 122 content::RenderProcessHost* host = renderWidgetHost_->GetProcess();
123 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext()); 123 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext());
124 DCHECK(profile); 124 DCHECK(profile);
125 NSCellStateValue checkedState = 125 NSCellStateValue checkedState =
126 profile->GetPrefs()->GetBoolean( 126 profile->GetPrefs()->GetBoolean(
127 spellcheck::prefs::kEnableContinuousSpellcheck) 127 spellcheck::prefs::kEnableSpellcheck)
128 ? NSOnState 128 ? NSOnState
129 : NSOffState; 129 : NSOffState;
130 [(id)item setState:checkedState]; 130 [(id)item setState:checkedState];
131 } 131 }
132 *valid = YES; 132 *valid = YES;
133 return YES; 133 return YES;
134 } 134 }
135 135
136 return NO; 136 return NO;
137 } 137 }
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 renderWidgetHost_->GetRoutingID(), 192 renderWidgetHost_->GetRoutingID(),
193 spellcheck_platform::SpellingPanelVisible())); 193 spellcheck_platform::SpellingPanelVisible()));
194 } 194 }
195 195
196 - (void)toggleContinuousSpellChecking:(id)sender { 196 - (void)toggleContinuousSpellChecking:(id)sender {
197 content::RenderProcessHost* host = renderWidgetHost_->GetProcess(); 197 content::RenderProcessHost* host = renderWidgetHost_->GetProcess();
198 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext()); 198 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext());
199 DCHECK(profile); 199 DCHECK(profile);
200 PrefService* pref = profile->GetPrefs(); 200 PrefService* pref = profile->GetPrefs();
201 pref->SetBoolean( 201 pref->SetBoolean(
202 spellcheck::prefs::kEnableContinuousSpellcheck, 202 spellcheck::prefs::kEnableSpellcheck,
203 !pref->GetBoolean(spellcheck::prefs::kEnableContinuousSpellcheck)); 203 !pref->GetBoolean(spellcheck::prefs::kEnableSpellcheck));
204 } 204 }
205 205
206 // END Spellchecking methods 206 // END Spellchecking methods
207 207
208 @end 208 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698