| Index: chrome/browser/extensions/api/module/module.cc
|
| diff --git a/chrome/browser/extensions/api/module/module.cc b/chrome/browser/extensions/api/module/module.cc
|
| index 908661039db7161aca699a2f7948d58091db9e67..d9c11b77b45edcf1bb9fdd9b3abf1cdc6ce860e1 100644
|
| --- a/chrome/browser/extensions/api/module/module.cc
|
| +++ b/chrome/browser/extensions/api/module/module.cc
|
| @@ -6,26 +6,48 @@
|
|
|
| #include <string>
|
|
|
| +#include "base/values.h"
|
| #include "chrome/browser/extensions/extension_prefs.h"
|
| #include "chrome/browser/extensions/extension_service.h"
|
| +#include "chrome/browser/extensions/extension_system.h"
|
| #include "chrome/browser/profiles/profile.h"
|
|
|
| namespace extensions {
|
|
|
| -ExtensionPrefs* ExtensionSetUpdateUrlDataFunction::extension_prefs() {
|
| - return profile()->GetExtensionService()->extension_prefs();
|
| +namespace extension {
|
| +
|
| +namespace {
|
| +
|
| +// A preference for storing the extension's update URL data. If not empty, the
|
| +// the ExtensionUpdater will append a ap= parameter to the URL when checking if
|
| +// a new version of the extension is available.
|
| +const char kUpdateURLData[] = "update_url_data";
|
| +
|
| +} // namespace
|
| +
|
| +std::string GetUpdateURLData(const ExtensionPrefs* prefs,
|
| + const std::string& extension_id) {
|
| + std::string data;
|
| + prefs->ReadPrefAsString(extension_id, kUpdateURLData, &data);
|
| + return data;
|
| }
|
|
|
| +} // namespace extension
|
| +
|
| bool ExtensionSetUpdateUrlDataFunction::RunImpl() {
|
| std::string data;
|
| EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &data));
|
|
|
| - extension_prefs()->SetUpdateUrlData(extension_id(), data);
|
| + ExtensionPrefs::Get(profile())->UpdateExtensionPref(
|
| + extension_id(),
|
| + extension::kUpdateURLData,
|
| + base::Value::CreateStringValue(data));
|
| return true;
|
| }
|
|
|
| bool ExtensionIsAllowedIncognitoAccessFunction::RunImpl() {
|
| - ExtensionService* ext_service = profile()->GetExtensionService();
|
| + ExtensionService* ext_service =
|
| + ExtensionSystem::Get(profile())->extension_service();
|
| const Extension* extension = GetExtension();
|
|
|
| SetResult(Value::CreateBooleanValue(
|
| @@ -34,7 +56,8 @@ bool ExtensionIsAllowedIncognitoAccessFunction::RunImpl() {
|
| }
|
|
|
| bool ExtensionIsAllowedFileSchemeAccessFunction::RunImpl() {
|
| - ExtensionService* ext_service = profile()->GetExtensionService();
|
| + ExtensionService* ext_service =
|
| + ExtensionSystem::Get(profile())->extension_service();
|
| const Extension* extension = GetExtension();
|
|
|
| SetResult(Value::CreateBooleanValue(
|
|
|