Skip to content

Commit

Permalink
Get rid of the rest of CreateStringValue
Browse files Browse the repository at this point in the history
BUG=160586

Review URL: https://codereview.chromium.org/388963002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284201 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
estade@chromium.org committed Jul 18, 2014
1 parent 434a6e8 commit 04be980
Show file tree
Hide file tree
Showing 80 changed files with 656 additions and 505 deletions.
10 changes: 5 additions & 5 deletions athena/virtual_keyboard/virtual_keyboard_bindings_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ class VKBindings : public gin::Wrappable<VKBindings> {
return;
}
base::ListValue params;
params.Set(0, base::Value::CreateStringValue(event.event_type));
params.Set(1, base::Value::CreateIntegerValue(event.char_value));
params.Set(2, base::Value::CreateIntegerValue(event.key_code));
params.Set(3, base::Value::CreateStringValue(event.key_name));
params.Set(4, base::Value::CreateIntegerValue(event.modifiers));
params.Set(0, new base::StringValue(event.event_type));
params.Set(1, new base::FundamentalValue(event.char_value));
params.Set(2, new base::FundamentalValue(event.key_code));
params.Set(3, new base::StringValue(event.key_name));
params.Set(4, new base::FundamentalValue(event.modifiers));

std::string params_json;
JSONStringValueSerializer serializer(&params_json);
Expand Down
11 changes: 5 additions & 6 deletions cc/resources/tile_priority.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,15 @@ scoped_ptr<base::Value> TileResolutionAsValue(
scoped_ptr<base::Value> TilePriorityBinAsValue(TilePriority::PriorityBin bin) {
switch (bin) {
case TilePriority::NOW:
return scoped_ptr<base::Value>(base::Value::CreateStringValue("NOW"));
return scoped_ptr<base::Value>(new base::StringValue("NOW"));
case TilePriority::SOON:
return scoped_ptr<base::Value>(base::Value::CreateStringValue("SOON"));
return scoped_ptr<base::Value>(new base::StringValue("SOON"));
case TilePriority::EVENTUALLY:
return scoped_ptr<base::Value>(
base::Value::CreateStringValue("EVENTUALLY"));
return scoped_ptr<base::Value>(new base::StringValue("EVENTUALLY"));
}
DCHECK(false) << "Unrecognized TilePriority::PriorityBin value " << bin;
return scoped_ptr<base::Value>(base::Value::CreateStringValue(
"<unknown TilePriority::PriorityBin value>"));
return scoped_ptr<base::Value>(
new base::StringValue("<unknown TilePriority::PriorityBin value>"));
}

scoped_ptr<base::Value> TilePriority::AsValue() const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ static scoped_refptr<Extension> CreateExtensionBase(
base::ListValue* permissions = new base::ListValue();
manifest.Set(extensions::manifest_keys::kPermissions, permissions);
if (background_permission) {
permissions->Append(base::Value::CreateStringValue("background"));
permissions->Append(new base::StringValue("background"));
}
if (push_messaging == PUSH_MESSAGING_PERMISSION ||
push_messaging == PUSH_MESSAGING_BUT_NOT_BACKGROUND) {
permissions->Append(base::Value::CreateStringValue("pushMessaging"));
permissions->Append(new base::StringValue("pushMessaging"));
}

std::string error;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class DeviceOAuth2TokenServiceTest : public testing::Test {
void SetDeviceRefreshTokenInLocalState(const std::string& refresh_token) {
scoped_testing_local_state_.Get()->SetUserPref(
prefs::kDeviceRobotAnyApiRefreshToken,
base::Value::CreateStringValue(refresh_token));
new base::StringValue(refresh_token));
}

std::string GetValidTokenInfoResponse(const std::string email) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ TEST_F(PolicyProviderTest, GettingManagedContentSettings) {
TestingPrefServiceSyncable* prefs = profile.GetTestingPrefService();

base::ListValue* value = new base::ListValue();
value->Append(base::Value::CreateStringValue("[*.]google.com"));
value->Append(new base::StringValue("[*.]google.com"));
prefs->SetManagedPref(prefs::kManagedImagesBlockedForUrls,
value);

Expand Down Expand Up @@ -210,7 +210,7 @@ TEST_F(PolicyProviderTest, ResourceIdentifier) {
TestingPrefServiceSyncable* prefs = profile.GetTestingPrefService();

base::ListValue* value = new base::ListValue();
value->Append(base::Value::CreateStringValue("[*.]google.com"));
value->Append(new base::StringValue("[*.]google.com"));
prefs->SetManagedPref(prefs::kManagedPluginsAllowedForUrls,
value);

Expand Down Expand Up @@ -263,8 +263,8 @@ TEST_F(PolicyProviderTest, AutoSelectCertificateList) {
std::string pattern_str("\"pattern\":\"[*.]google.com\"");
std::string filter_str("\"filter\":{\"ISSUER\":{\"CN\":\"issuer name\"}}");
base::ListValue* value = new base::ListValue();
value->Append(base::Value::CreateStringValue(
"{" + pattern_str + "," + filter_str + "}"));
value->Append(
new base::StringValue("{" + pattern_str + "," + filter_str + "}"));
prefs->SetManagedPref(prefs::kManagedAutoSelectCertificateForUrls,
value);
GURL youtube_url("https://www.youtube.com");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ TEST_F(DownloadDirPolicyHandlerTest, SetDownloadDirectory) {
policy.Set(policy::key::kDownloadDirectory,
policy::POLICY_LEVEL_MANDATORY,
policy::POLICY_SCOPE_USER,
base::Value::CreateStringValue(std::string()),
new base::StringValue(std::string()),
NULL);
UpdateProviderPolicy(policy);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ class ExtensionGCMAppHandlerTest : public testing::Test {
manifest.SetString(manifest_keys::kVersion, "1.0.0.0");
manifest.SetString(manifest_keys::kName, kTestExtensionName);
base::ListValue* permission_list = new base::ListValue;
permission_list->Append(base::Value::CreateStringValue("gcm"));
permission_list->Append(new base::StringValue("gcm"));
manifest.Set(manifest_keys::kPermissions, permission_list);

std::string error;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,10 @@ class ExtensionMessageBubbleTest : public testing::Test {
base::Time::Now(),
true, // is_enabled.
false); // is_incognito_enabled.
extension_prefs_value_map->SetExtensionPref(
id,
prefs::kProxy,
kExtensionPrefsScopeRegular,
base::Value::CreateStringValue(id));
extension_prefs_value_map->SetExtensionPref(id,
prefs::kProxy,
kExtensionPrefsScopeRegular,
new base::StringValue(id));

if (ExtensionRegistry::Get(profile())->enabled_extensions().GetByID(id))
return testing::AssertionSuccess();
Expand Down
25 changes: 11 additions & 14 deletions chrome/browser/extensions/policy_handlers_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ TEST(ExtensionListPolicyHandlerTest, CheckPolicySettings) {
EXPECT_TRUE(handler.CheckPolicySettings(policy_map, &errors));
EXPECT_TRUE(errors.empty());

list.Append(
base::Value::CreateStringValue("abcdefghijklmnopabcdefghijklmnop"));
list.Append(new base::StringValue("abcdefghijklmnopabcdefghijklmnop"));
policy_map.Set(policy::key::kExtensionInstallBlacklist,
policy::POLICY_LEVEL_MANDATORY,
policy::POLICY_SCOPE_USER,
Expand All @@ -43,7 +42,7 @@ TEST(ExtensionListPolicyHandlerTest, CheckPolicySettings) {
EXPECT_TRUE(handler.CheckPolicySettings(policy_map, &errors));
EXPECT_TRUE(errors.empty());

list.Append(base::Value::CreateStringValue("*"));
list.Append(new base::StringValue("*"));
policy_map.Set(policy::key::kExtensionInstallBlacklist,
policy::POLICY_LEVEL_MANDATORY,
policy::POLICY_SCOPE_USER,
Expand All @@ -53,7 +52,7 @@ TEST(ExtensionListPolicyHandlerTest, CheckPolicySettings) {
EXPECT_TRUE(handler.CheckPolicySettings(policy_map, &errors));
EXPECT_TRUE(errors.empty());

list.Append(base::Value::CreateStringValue("invalid"));
list.Append(new base::StringValue("invalid"));
policy_map.Set(policy::key::kExtensionInstallBlacklist,
policy::POLICY_LEVEL_MANDATORY,
policy::POLICY_SCOPE_USER,
Expand All @@ -75,10 +74,8 @@ TEST(ExtensionListPolicyHandlerTest, ApplyPolicySettings) {
ExtensionListPolicyHandler handler(
policy::key::kExtensionInstallBlacklist, kTestPref, false);

policy.Append(
base::Value::CreateStringValue("abcdefghijklmnopabcdefghijklmnop"));
expected.Append(
base::Value::CreateStringValue("abcdefghijklmnopabcdefghijklmnop"));
policy.Append(new base::StringValue("abcdefghijklmnopabcdefghijklmnop"));
expected.Append(new base::StringValue("abcdefghijklmnopabcdefghijklmnop"));

policy_map.Set(policy::key::kExtensionInstallBlacklist,
policy::POLICY_LEVEL_MANDATORY,
Expand All @@ -89,7 +86,7 @@ TEST(ExtensionListPolicyHandlerTest, ApplyPolicySettings) {
EXPECT_TRUE(prefs.GetValue(kTestPref, &value));
EXPECT_TRUE(base::Value::Equals(&expected, value));

policy.Append(base::Value::CreateStringValue("invalid"));
policy.Append(new base::StringValue("invalid"));
policy_map.Set(policy::key::kExtensionInstallBlacklist,
policy::POLICY_LEVEL_MANDATORY,
policy::POLICY_SCOPE_USER,
Expand Down Expand Up @@ -220,7 +217,7 @@ TEST(ExtensionURLPatternListPolicyHandlerTest, CheckPolicySettings) {
EXPECT_TRUE(handler.CheckPolicySettings(policy_map, &errors));
EXPECT_TRUE(errors.empty());

list.Append(base::Value::CreateStringValue("http://*.google.com/*"));
list.Append(new base::StringValue("http://*.google.com/*"));
policy_map.Set(policy::key::kExtensionInstallSources,
policy::POLICY_LEVEL_MANDATORY,
policy::POLICY_SCOPE_USER,
Expand All @@ -230,7 +227,7 @@ TEST(ExtensionURLPatternListPolicyHandlerTest, CheckPolicySettings) {
EXPECT_TRUE(handler.CheckPolicySettings(policy_map, &errors));
EXPECT_TRUE(errors.empty());

list.Append(base::Value::CreateStringValue("<all_urls>"));
list.Append(new base::StringValue("<all_urls>"));
policy_map.Set(policy::key::kExtensionInstallSources,
policy::POLICY_LEVEL_MANDATORY,
policy::POLICY_SCOPE_USER,
Expand All @@ -240,7 +237,7 @@ TEST(ExtensionURLPatternListPolicyHandlerTest, CheckPolicySettings) {
EXPECT_TRUE(handler.CheckPolicySettings(policy_map, &errors));
EXPECT_TRUE(errors.empty());

list.Append(base::Value::CreateStringValue("invalid"));
list.Append(new base::StringValue("invalid"));
policy_map.Set(policy::key::kExtensionInstallSources,
policy::POLICY_LEVEL_MANDATORY,
policy::POLICY_SCOPE_USER,
Expand All @@ -253,7 +250,7 @@ TEST(ExtensionURLPatternListPolicyHandlerTest, CheckPolicySettings) {

// URLPattern syntax has a different way to express 'all urls'. Though '*'
// would be compatible today, it would be brittle, so we disallow.
list.Append(base::Value::CreateStringValue("*"));
list.Append(new base::StringValue("*"));
policy_map.Set(policy::key::kExtensionInstallSources,
policy::POLICY_LEVEL_MANDATORY,
policy::POLICY_SCOPE_USER,
Expand All @@ -273,7 +270,7 @@ TEST(ExtensionURLPatternListPolicyHandlerTest, ApplyPolicySettings) {
ExtensionURLPatternListPolicyHandler handler(
policy::key::kExtensionInstallSources, kTestPref);

list.Append(base::Value::CreateStringValue("https://corp.monkey.net/*"));
list.Append(new base::StringValue("https://corp.monkey.net/*"));
policy_map.Set(policy::key::kExtensionInstallSources,
policy::POLICY_LEVEL_MANDATORY,
policy::POLICY_SCOPE_USER,
Expand Down
5 changes: 2 additions & 3 deletions chrome/browser/media_galleries/media_galleries_test_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,14 @@ scoped_refptr<extensions::Extension> AddMediaGalleriesApp(
manifest->SetString(extensions::manifest_keys::kVersion, "0.1");
manifest->SetInteger(extensions::manifest_keys::kManifestVersion, 2);
base::ListValue* background_script_list = new base::ListValue;
background_script_list->Append(
base::Value::CreateStringValue("background.js"));
background_script_list->Append(new base::StringValue("background.js"));
manifest->Set(extensions::manifest_keys::kPlatformAppBackgroundScripts,
background_script_list);

base::ListValue* permission_detail_list = new base::ListValue;
for (size_t i = 0; i < media_galleries_permissions.size(); i++)
permission_detail_list->Append(
base::Value::CreateStringValue(media_galleries_permissions[i]));
new base::StringValue(media_galleries_permissions[i]));
base::DictionaryValue* media_galleries_permission =
new base::DictionaryValue();
media_galleries_permission->Set("mediaGalleries", permission_detail_list);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ TEST_F(DiskCacheDirPolicyTest, SetPolicyValid) {
policy_.Set(key::kDiskCacheDir,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
base::Value::CreateStringValue(in),
new base::StringValue(in),
NULL);
handler_.ApplyPolicySettings(policy_, &prefs_);

Expand Down
24 changes: 15 additions & 9 deletions chrome/browser/policy/cloud/cloud_policy_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,11 @@ std::string GetTestPolicy(const char* homepage, int key_version) {

void GetExpectedDefaultPolicy(PolicyMap* policy_map) {
#if defined(OS_CHROMEOS)
policy_map->Set(
key::kChromeOsMultiProfileUserBehavior, POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER, base::Value::CreateStringValue("primary-only"), NULL);
policy_map->Set(key::kChromeOsMultiProfileUserBehavior,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
new base::StringValue("primary-only"),
NULL);
#endif
}

Expand All @@ -161,13 +163,17 @@ void GetExpectedTestPolicy(PolicyMap* expected, const char* homepage) {
expected->Set(
key::kMaxInvalidationFetchDelay, POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER, base::Value::CreateIntegerValue(1000), NULL);
expected->Set(
key::kHomepageLocation, POLICY_LEVEL_RECOMMENDED,
POLICY_SCOPE_USER, base::Value::CreateStringValue(homepage), NULL);
expected->Set(key::kHomepageLocation,
POLICY_LEVEL_RECOMMENDED,
POLICY_SCOPE_USER,
new base::StringValue(homepage),
NULL);
#if defined(OS_CHROMEOS)
expected->Set(
key::kChromeOsMultiProfileUserBehavior, POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER, base::Value::CreateStringValue("primary-only"), NULL);
expected->Set(key::kChromeOsMultiProfileUserBehavior,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
new base::StringValue("primary-only"),
NULL);
#endif
}

Expand Down
Loading

0 comments on commit 04be980

Please sign in to comment.