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

Side by Side Diff: chrome/browser/chromeos/extensions/info_private_api.cc

Issue 252653002: Rename (Chrome)SyncExtensionFunction::RunImpl to RunSync so that the RunImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix bookmarks Created 6 years, 7 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 | Annotate | Revision Log
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 #include "chrome/browser/chromeos/extensions/info_private_api.h" 5 #include "chrome/browser/chromeos/extensions/info_private_api.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/sys_info.h" 9 #include "base/sys_info.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 DLOG(ERROR) << "Unknown property request: " << property_name; 178 DLOG(ERROR) << "Unknown property request: " << property_name;
179 return NULL; 179 return NULL;
180 } 180 }
181 181
182 ChromeosInfoPrivateSetFunction::ChromeosInfoPrivateSetFunction() { 182 ChromeosInfoPrivateSetFunction::ChromeosInfoPrivateSetFunction() {
183 } 183 }
184 184
185 ChromeosInfoPrivateSetFunction::~ChromeosInfoPrivateSetFunction() { 185 ChromeosInfoPrivateSetFunction::~ChromeosInfoPrivateSetFunction() {
186 } 186 }
187 187
188 bool ChromeosInfoPrivateSetFunction::RunImpl() { 188 bool ChromeosInfoPrivateSetFunction::RunSync() {
189 std::string param_name; 189 std::string param_name;
190 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &param_name)); 190 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &param_name));
191 if (param_name == kPropertyTimezone) { 191 if (param_name == kPropertyTimezone) {
192 std::string param_value; 192 std::string param_value;
193 EXTENSION_FUNCTION_VALIDATE(args_->GetString(1, &param_value)); 193 EXTENSION_FUNCTION_VALIDATE(args_->GetString(1, &param_value));
194 chromeos::CrosSettings::Get()->Set(chromeos::kSystemTimezone, 194 chromeos::CrosSettings::Get()->Set(chromeos::kSystemTimezone,
195 base::StringValue(param_value)); 195 base::StringValue(param_value));
196 } else { 196 } else {
197 const char* pref_name = GetBoolPrefNameForApiProperty(param_name.c_str()); 197 const char* pref_name = GetBoolPrefNameForApiProperty(param_name.c_str());
198 if (pref_name) { 198 if (pref_name) {
199 bool param_value; 199 bool param_value;
200 EXTENSION_FUNCTION_VALIDATE(args_->GetBoolean(1, &param_value)); 200 EXTENSION_FUNCTION_VALIDATE(args_->GetBoolean(1, &param_value));
201 Profile::FromBrowserContext(context_)->GetPrefs()->SetBoolean( 201 Profile::FromBrowserContext(context_)->GetPrefs()->SetBoolean(
202 pref_name, 202 pref_name,
203 param_value); 203 param_value);
204 } else { 204 } else {
205 error_ = ErrorUtils::FormatErrorMessage(kPropertyNotFound, param_name); 205 error_ = ErrorUtils::FormatErrorMessage(kPropertyNotFound, param_name);
206 return false; 206 return false;
207 } 207 }
208 } 208 }
209 209
210 return true; 210 return true;
211 } 211 }
212 212
213 } // namespace extensions 213 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/extensions/info_private_api.h ('k') | chrome/browser/chromeos/extensions/input_method_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698