| Index: chrome/browser/extensions/extension_prefs.cc
|
| diff --git a/chrome/browser/extensions/extension_prefs.cc b/chrome/browser/extensions/extension_prefs.cc
|
| index 776273ee31e5077b9b39769eb66f9037591239bf..42ae29affa45a0524f29113f4f0a2e5584ee9ca6 100644
|
| --- a/chrome/browser/extensions/extension_prefs.cc
|
| +++ b/chrome/browser/extensions/extension_prefs.cc
|
| @@ -430,7 +430,7 @@ void ExtensionPrefs::SetExtensionPrefURLPatternSet(
|
| ListValue* value = new ListValue();
|
| for (URLPatternSet::const_iterator i = new_value.begin();
|
| i != new_value.end(); ++i)
|
| - value->AppendIfNotPresent(Value::CreateStringValue(i->GetAsString()));
|
| + value->AppendIfNotPresent(base::StringValue::New(i->GetAsString()));
|
|
|
| UpdateExtensionPref(extension_id, pref_key, value);
|
| }
|
| @@ -485,7 +485,7 @@ void ExtensionPrefs::SetExtensionPrefPermissionSet(
|
| i != apis.end(); ++i) {
|
| ExtensionAPIPermission* perm = info->GetByID(*i);
|
| if (perm)
|
| - api_values->Append(Value::CreateStringValue(perm->name()));
|
| + api_values->Append(base::StringValue::New(perm->name()));
|
| }
|
| UpdateExtensionPref(extension_id, api_pref, api_values);
|
|
|
| @@ -566,7 +566,7 @@ bool ExtensionPrefs::DidExtensionEscalatePermissions(
|
| void ExtensionPrefs::SetDidExtensionEscalatePermissions(
|
| const Extension* extension, bool did_escalate) {
|
| UpdateExtensionPref(extension->id(), kExtensionDidEscalatePermissions,
|
| - Value::CreateBooleanValue(did_escalate));
|
| + base::BooleanValue::New(did_escalate));
|
| }
|
|
|
| void ExtensionPrefs::UpdateBlacklist(
|
| @@ -613,8 +613,7 @@ void ExtensionPrefs::UpdateBlacklist(
|
| std::set<std::string>::const_iterator set_itr = blacklist_set.begin();
|
| for (; set_itr != blacklist_set.end(); ++set_itr) {
|
| if (used_id_set.find(*set_itr) == used_id_set.end()) {
|
| - UpdateExtensionPref(*set_itr, kPrefBlacklist,
|
| - Value::CreateBooleanValue(true));
|
| + UpdateExtensionPref(*set_itr, kPrefBlacklist, base::TrueValue());
|
| }
|
| }
|
| for (unsigned int i = 0; i < remove_pref_ids.size(); ++i) {
|
| @@ -694,7 +693,7 @@ bool ExtensionPrefs::GetActiveBit(const std::string& extension_id) {
|
| void ExtensionPrefs::SetActiveBit(const std::string& extension_id,
|
| bool active) {
|
| UpdateExtensionPref(extension_id, kActiveBit,
|
| - Value::CreateBooleanValue(active));
|
| + base::BooleanValue::New(active));
|
| }
|
|
|
| void ExtensionPrefs::MigratePermissions(const ExtensionIdSet& extension_ids) {
|
| @@ -728,7 +727,7 @@ void ExtensionPrefs::MigratePermissions(const ExtensionIdSet& extension_ids) {
|
|
|
| std::string plugin_name = info->GetByID(
|
| ExtensionAPIPermission::kPlugin)->name();
|
| - new_apis->Append(Value::CreateStringValue(plugin_name));
|
| + new_apis->Append(base::StringValue::New(plugin_name));
|
| UpdateExtensionPref(*ext_id, granted_apis, new_apis);
|
| }
|
|
|
| @@ -795,7 +794,7 @@ bool ExtensionPrefs::IsIncognitoEnabled(const std::string& extension_id) {
|
| void ExtensionPrefs::SetIsIncognitoEnabled(const std::string& extension_id,
|
| bool enabled) {
|
| UpdateExtensionPref(extension_id, kPrefIncognitoEnabled,
|
| - Value::CreateBooleanValue(enabled));
|
| + base::BooleanValue::New(enabled));
|
| }
|
|
|
| bool ExtensionPrefs::AllowFileAccess(const std::string& extension_id) {
|
| @@ -805,7 +804,7 @@ bool ExtensionPrefs::AllowFileAccess(const std::string& extension_id) {
|
| void ExtensionPrefs::SetAllowFileAccess(const std::string& extension_id,
|
| bool allow) {
|
| UpdateExtensionPref(extension_id, kPrefAllowFileAccess,
|
| - Value::CreateBooleanValue(allow));
|
| + base::BooleanValue::New(allow));
|
| }
|
|
|
| bool ExtensionPrefs::HasAllowFileAccessSetting(
|
| @@ -893,7 +892,7 @@ extension_misc::LaunchContainer ExtensionPrefs::GetLaunchContainer(
|
| void ExtensionPrefs::SetLaunchType(const std::string& extension_id,
|
| LaunchType launch_type) {
|
| UpdateExtensionPref(extension_id, kPrefLaunchType,
|
| - Value::CreateIntegerValue(static_cast<int>(launch_type)));
|
| + base::NumberValue::New(static_cast<int>(launch_type)));
|
| }
|
|
|
| bool ExtensionPrefs::DoesExtensionHaveState(
|
| @@ -941,7 +940,7 @@ void ExtensionPrefs::SetToolbarOrder(
|
| toolbar_order->Clear();
|
| for (std::vector<std::string>::const_iterator iter = extension_ids.begin();
|
| iter != extension_ids.end(); ++iter) {
|
| - toolbar_order->Append(new StringValue(*iter));
|
| + toolbar_order->Append(base::StringValue::New(*iter));
|
| }
|
| SavePrefs();
|
| }
|
| @@ -955,15 +954,15 @@ void ExtensionPrefs::OnExtensionInstalled(
|
| ScopedExtensionPrefUpdate update(prefs_, id);
|
| DictionaryValue* extension_dict = update.Get();
|
| const base::Time install_time = GetCurrentTime();
|
| - extension_dict->Set(kPrefState, Value::CreateIntegerValue(initial_state));
|
| + extension_dict->Set(kPrefState, base::NumberValue::New(initial_state));
|
| extension_dict->Set(kPrefLocation,
|
| - Value::CreateIntegerValue(extension->location()));
|
| + base::NumberValue::New(extension->location()));
|
| extension_dict->Set(kPrefFromWebStore,
|
| - Value::CreateBooleanValue(from_webstore));
|
| + base::BooleanValue::New(from_webstore));
|
| extension_dict->Set(kPrefFromBookmark,
|
| - Value::CreateBooleanValue(extension->from_bookmark()));
|
| + base::BooleanValue::New(extension->from_bookmark()));
|
| extension_dict->Set(kPrefInstallTime,
|
| - Value::CreateStringValue(
|
| + base::StringValue::New(
|
| base::Int64ToString(install_time.ToInternalValue())));
|
| extension_dict->Set(kPrefPreferences, new DictionaryValue());
|
| extension_dict->Set(kPrefIncognitoPreferences, new DictionaryValue());
|
| @@ -972,7 +971,7 @@ void ExtensionPrefs::OnExtensionInstalled(
|
|
|
| FilePath::StringType path = MakePathRelative(install_directory_,
|
| extension->path());
|
| - extension_dict->Set(kPrefPath, Value::CreateStringValue(path));
|
| + extension_dict->Set(kPrefPath, base::StringValue::New(path));
|
| // We store prefs about LOAD extensions, but don't cache their manifest
|
| // since it may change on disk.
|
| if (extension->location() != Extension::LOAD) {
|
| @@ -980,7 +979,7 @@ void ExtensionPrefs::OnExtensionInstalled(
|
| extension->manifest_value()->DeepCopy());
|
| }
|
| extension_dict->Set(kPrefAppLaunchIndex,
|
| - Value::CreateIntegerValue(GetNextAppLaunchIndex()));
|
| + base::NumberValue::New(GetNextAppLaunchIndex()));
|
| extension_pref_value_map_->RegisterExtension(
|
| id, install_time, initial_state == Extension::ENABLED);
|
| content_settings_store_->RegisterExtension(
|
| @@ -996,7 +995,7 @@ void ExtensionPrefs::OnExtensionUninstalled(const std::string& extension_id,
|
| // no longer lists the extension).
|
| if (!external_uninstall && Extension::IsExternalLocation(location)) {
|
| UpdateExtensionPref(extension_id, kPrefState,
|
| - Value::CreateIntegerValue(
|
| + base::NumberValue::New(
|
| Extension::EXTERNAL_EXTENSION_UNINSTALLED));
|
| extension_pref_value_map_->SetExtensionState(extension_id, false);
|
| content_settings_store_->SetExtensionState(extension_id, false);
|
| @@ -1008,7 +1007,7 @@ void ExtensionPrefs::OnExtensionUninstalled(const std::string& extension_id,
|
| void ExtensionPrefs::SetExtensionState(const std::string& extension_id,
|
| Extension::State state) {
|
| UpdateExtensionPref(extension_id, kPrefState,
|
| - Value::CreateIntegerValue(state));
|
| + base::NumberValue::New(state));
|
| bool enabled = (state == Extension::ENABLED);
|
| extension_pref_value_map_->SetExtensionState(extension_id, enabled);
|
| content_settings_store_->SetExtensionState(extension_id, enabled);
|
| @@ -1031,7 +1030,7 @@ void ExtensionPrefs::SetBrowserActionVisibility(const Extension* extension,
|
| return;
|
|
|
| UpdateExtensionPref(extension->id(), kBrowserActionVisible,
|
| - Value::CreateBooleanValue(visible));
|
| + base::BooleanValue::New(visible));
|
| NotificationService::current()->Notify(
|
| chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_VISIBILITY_CHANGED,
|
| Source<ExtensionPrefs>(this),
|
| @@ -1321,7 +1320,7 @@ void ExtensionPrefs::SetAppLaunchIndex(const std::string& extension_id,
|
| int index) {
|
| DCHECK_GE(index, 0);
|
| UpdateExtensionPref(extension_id, kPrefAppLaunchIndex,
|
| - Value::CreateIntegerValue(index));
|
| + base::NumberValue::New(index));
|
| }
|
|
|
| int ExtensionPrefs::GetNextAppLaunchIndex() {
|
| @@ -1359,7 +1358,7 @@ int ExtensionPrefs::GetPageIndex(const std::string& extension_id) {
|
| void ExtensionPrefs::SetPageIndex(const std::string& extension_id, int index) {
|
| CHECK_GE(index, 0);
|
| UpdateExtensionPref(extension_id, kPrefPageIndex,
|
| - Value::CreateIntegerValue(index));
|
| + base::NumberValue::New(index));
|
| }
|
|
|
| bool ExtensionPrefs::WasAppDraggedByUser(const std::string& extension_id) {
|
| @@ -1367,14 +1366,13 @@ bool ExtensionPrefs::WasAppDraggedByUser(const std::string& extension_id) {
|
| }
|
|
|
| void ExtensionPrefs::SetAppDraggedByUser(const std::string& extension_id) {
|
| - UpdateExtensionPref(extension_id, kPrefUserDraggedApp,
|
| - Value::CreateBooleanValue(true));
|
| + UpdateExtensionPref(extension_id, kPrefUserDraggedApp, base::TrueValue());
|
| }
|
|
|
| void ExtensionPrefs::SetUpdateUrlData(const std::string& extension_id,
|
| const std::string& data) {
|
| UpdateExtensionPref(extension_id, kUpdateUrlData,
|
| - Value::CreateStringValue(data));
|
| + base::StringValue::New(data));
|
| }
|
|
|
| std::string ExtensionPrefs::GetUpdateUrlData(const std::string& extension_id) {
|
| @@ -1463,7 +1461,7 @@ void ExtensionPrefs::FixMissingPrefs(const ExtensionIdSet& extension_ids) {
|
| << kPrefInstallTime << " was introduced. Updating "
|
| << kPrefInstallTime << " to the current time.";
|
| const base::Time install_time = GetCurrentTime();
|
| - UpdateExtensionPref(*ext_id, kPrefInstallTime, Value::CreateStringValue(
|
| + UpdateExtensionPref(*ext_id, kPrefInstallTime, base::StringValue::New(
|
| base::Int64ToString(install_time.ToInternalValue())));
|
| }
|
| }
|
|
|