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

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

Issue 257333002: Drive extension functions from ExtensionFunction::Run. The (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix comment 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 } 105 }
106 106
107 } // namespace 107 } // namespace
108 108
109 ChromeosInfoPrivateGetFunction::ChromeosInfoPrivateGetFunction() { 109 ChromeosInfoPrivateGetFunction::ChromeosInfoPrivateGetFunction() {
110 } 110 }
111 111
112 ChromeosInfoPrivateGetFunction::~ChromeosInfoPrivateGetFunction() { 112 ChromeosInfoPrivateGetFunction::~ChromeosInfoPrivateGetFunction() {
113 } 113 }
114 114
115 bool ChromeosInfoPrivateGetFunction::RunImpl() { 115 bool ChromeosInfoPrivateGetFunction::RunAsync() {
116 base::ListValue* list = NULL; 116 base::ListValue* list = NULL;
117 EXTENSION_FUNCTION_VALIDATE(args_->GetList(0, &list)); 117 EXTENSION_FUNCTION_VALIDATE(args_->GetList(0, &list));
118 scoped_ptr<base::DictionaryValue> result(new base::DictionaryValue()); 118 scoped_ptr<base::DictionaryValue> result(new base::DictionaryValue());
119 for (size_t i = 0; i < list->GetSize(); ++i) { 119 for (size_t i = 0; i < list->GetSize(); ++i) {
120 std::string property_name; 120 std::string property_name;
121 EXTENSION_FUNCTION_VALIDATE(list->GetString(i, &property_name)); 121 EXTENSION_FUNCTION_VALIDATE(list->GetString(i, &property_name));
122 base::Value* value = GetValue(property_name); 122 base::Value* value = GetValue(property_name);
123 if (value) 123 if (value)
124 result->Set(property_name, value); 124 result->Set(property_name, value);
125 } 125 }
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
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/screenlock_private_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698