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

Unified Diff: chrome/browser/extensions/extension_rlz_module.cc

Issue 3029001: When I specified the rlz chrome extension api, I explicitly did not include a... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/extension_rlz_module.h ('k') | chrome/common/extensions/api/extension_api.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_rlz_module.cc
===================================================================
--- chrome/browser/extensions/extension_rlz_module.cc (revision 52654)
+++ chrome/browser/extensions/extension_rlz_module.cc (working copy)
@@ -102,6 +102,54 @@
return true;
}
+bool RlzSendFinancialPingFunction::RunImpl() {
+ std::string product_name;
+ EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &product_name));
+ rlz_lib::Product product;
+ EXTENSION_FUNCTION_VALIDATE(GetProductFromName(product_name, &product));
+
+ ListValue* access_points_list;
+ EXTENSION_FUNCTION_VALIDATE(args_->GetList(1, &access_points_list));
+ if (access_points_list->GetSize() < 1) {
+ EXTENSION_FUNCTION_ERROR("Access point array should not be empty.");
+ }
+
+ // Allocate an access point array to pass to ClearProductState(). The array
+ // must be termindated with the value rlz_lib::NO_ACCESS_POINT, hence + 1
+ // when allocating the array.
+ scoped_array<rlz_lib::AccessPoint> access_points(
+ new rlz_lib::AccessPoint[access_points_list->GetSize() + 1]);
+
+ size_t i;
+ for (i = 0; i < access_points_list->GetSize(); ++i) {
+ std::string ap_name;
+ EXTENSION_FUNCTION_VALIDATE(access_points_list->GetString(i, &ap_name));
+ EXTENSION_FUNCTION_VALIDATE(rlz_lib::GetAccessPointFromName(
+ ap_name.c_str(), &access_points[i]));
+ }
+ access_points[i] = rlz_lib::NO_ACCESS_POINT;
+
+ std::string signature;
+ EXTENSION_FUNCTION_VALIDATE(args_->GetString(2, &signature));
+
+ std::string brand;
+ EXTENSION_FUNCTION_VALIDATE(args_->GetString(3, &brand));
+
+ std::string id;
+ EXTENSION_FUNCTION_VALIDATE(args_->GetString(4, &id));
+
+ std::string lang;
+ EXTENSION_FUNCTION_VALIDATE(args_->GetString(5, &lang));
+
+ bool exclude_machine_id;
+ EXTENSION_FUNCTION_VALIDATE(args_->GetBoolean(6, &exclude_machine_id));
+
+ return rlz_lib::SendFinancialPing(product, access_points.get(),
+ signature.c_str(), brand.c_str(),
+ id.c_str(), lang.c_str(),
+ exclude_machine_id);
+}
+
bool RlzClearProductStateFunction::RunImpl() {
std::string product_name;
EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &product_name));
« no previous file with comments | « chrome/browser/extensions/extension_rlz_module.h ('k') | chrome/common/extensions/api/extension_api.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698