Chromium Code Reviews| 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..8b291e1e2195376e40e88caac4d240f921ac1738 100644 |
| --- a/chrome/browser/extensions/api/module/module.cc |
| +++ b/chrome/browser/extensions/api/module/module.cc |
| @@ -6,26 +6,46 @@ |
| #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 { |
|
Yoyo Zhou
2013/05/16 18:39:09
newline after
|
| +// 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); |
| + ExtensionSystem::Get(profile())->extension_prefs()->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 +54,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( |