summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_module.cc
diff options
context:
space:
mode:
authorrogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-12 15:15:09 +0000
committerrogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-12 15:15:09 +0000
commita65882cfd89af9fc51fc34781fd9ebfc4978ea4c (patch)
tree1bc1a7484c4d286a1ce26af1076c13cd40682e20 /chrome/browser/extensions/extension_module.cc
parent96fdf3dd2d66d4c5b556df3574b324f36cafcd81 (diff)
downloadchromium_src-a65882cfd89af9fc51fc34781fd9ebfc4978ea4c.zip
chromium_src-a65882cfd89af9fc51fc34781fd9ebfc4978ea4c.tar.gz
chromium_src-a65882cfd89af9fc51fc34781fd9ebfc4978ea4c.tar.bz2
Allow an extension to dynamically set extra data in its update URL, in order
to communicate dynamic information to its update server if needed. BUG=none TEST=Make sure that existing extensions that do no set any extra data are not adversely affected. Review URL: http://codereview.chromium.org/4725002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65946 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_module.cc')
-rw-r--r--chrome/browser/extensions/extension_module.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extension_module.cc b/chrome/browser/extensions/extension_module.cc
new file mode 100644
index 0000000..84c3789
--- /dev/null
+++ b/chrome/browser/extensions/extension_module.cc
@@ -0,0 +1,23 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/extensions/extension_module.h"
+
+#include <string>
+
+#include "chrome/browser/extensions/extension_prefs.h"
+#include "chrome/browser/extensions/extensions_service.h"
+#include "chrome/browser/profile.h"
+
+ExtensionPrefs* SetUpdateUrlDataFunction::extension_prefs() {
+ return profile()->GetExtensionsService()->extension_prefs();
+}
+
+bool SetUpdateUrlDataFunction::RunImpl() {
+ std::string data;
+ EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &data));
+
+ extension_prefs()->SetUpdateUrlData(extension_id(), data);
+ return true;
+}