From dbb9aa45617ebf4b521f066b3cd69a06b5a627d4 Mon Sep 17 00:00:00 2001
From: "avi@chromium.org"
 <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Date: Mon, 23 Dec 2013 20:08:21 +0000
Subject: Update some uses of Value in chrome/browser to use the base::
 namespace.

BUG=88666
TEST=no change
TBR=ben@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242399 0039d316-1c4b-4281-b951-d872f2087c98
---
 .../default_search_policy_handler.cc               | 56 +++++++++++-----------
 .../search_engines/default_search_policy_handler.h |  2 +-
 .../search_provider_install_data_unittest.cc       | 10 ++--
 .../template_url_prepopulate_data.cc               | 12 ++---
 .../template_url_prepopulate_data_unittest.cc      | 18 +++----
 .../browser/search_engines/template_url_service.cc |  4 +-
 .../template_url_service_test_util.cc              | 18 +++----
 7 files changed, 60 insertions(+), 60 deletions(-)

(limited to 'chrome/browser/search_engines')

diff --git a/chrome/browser/search_engines/default_search_policy_handler.cc b/chrome/browser/search_engines/default_search_policy_handler.cc
index ae6c0de..0501878 100644
--- a/chrome/browser/search_engines/default_search_policy_handler.cc
+++ b/chrome/browser/search_engines/default_search_policy_handler.cc
@@ -24,59 +24,59 @@ namespace policy {
 const PolicyToPreferenceMapEntry kDefaultSearchPolicyMap[] = {
   { key::kDefaultSearchProviderEnabled,
     prefs::kDefaultSearchProviderEnabled,
-    Value::TYPE_BOOLEAN },
+    base::Value::TYPE_BOOLEAN },
   { key::kDefaultSearchProviderName,
     prefs::kDefaultSearchProviderName,
-    Value::TYPE_STRING },
+    base::Value::TYPE_STRING },
   { key::kDefaultSearchProviderKeyword,
     prefs::kDefaultSearchProviderKeyword,
-    Value::TYPE_STRING },
+    base::Value::TYPE_STRING },
   { key::kDefaultSearchProviderSearchURL,
     prefs::kDefaultSearchProviderSearchURL,
-    Value::TYPE_STRING },
+    base::Value::TYPE_STRING },
   { key::kDefaultSearchProviderSuggestURL,
     prefs::kDefaultSearchProviderSuggestURL,
-    Value::TYPE_STRING },
+    base::Value::TYPE_STRING },
   { key::kDefaultSearchProviderInstantURL,
     prefs::kDefaultSearchProviderInstantURL,
-    Value::TYPE_STRING },
+    base::Value::TYPE_STRING },
   { key::kDefaultSearchProviderIconURL,
     prefs::kDefaultSearchProviderIconURL,
-    Value::TYPE_STRING },
+    base::Value::TYPE_STRING },
   { key::kDefaultSearchProviderEncodings,
     prefs::kDefaultSearchProviderEncodings,
-    Value::TYPE_LIST },
+    base::Value::TYPE_LIST },
   { key::kDefaultSearchProviderAlternateURLs,
     prefs::kDefaultSearchProviderAlternateURLs,
-    Value::TYPE_LIST },
+    base::Value::TYPE_LIST },
   { key::kDefaultSearchProviderSearchTermsReplacementKey,
     prefs::kDefaultSearchProviderSearchTermsReplacementKey,
-    Value::TYPE_STRING },
+    base::Value::TYPE_STRING },
   { key::kDefaultSearchProviderImageURL,
     prefs::kDefaultSearchProviderImageURL,
-    Value::TYPE_STRING },
+    base::Value::TYPE_STRING },
   { key::kDefaultSearchProviderNewTabURL,
     prefs::kDefaultSearchProviderNewTabURL,
-    Value::TYPE_STRING },
+    base::Value::TYPE_STRING },
   { key::kDefaultSearchProviderSearchURLPostParams,
     prefs::kDefaultSearchProviderSearchURLPostParams,
-    Value::TYPE_STRING },
+    base::Value::TYPE_STRING },
   { key::kDefaultSearchProviderSuggestURLPostParams,
     prefs::kDefaultSearchProviderSuggestURLPostParams,
-    Value::TYPE_STRING },
+    base::Value::TYPE_STRING },
   { key::kDefaultSearchProviderInstantURLPostParams,
     prefs::kDefaultSearchProviderInstantURLPostParams,
-    Value::TYPE_STRING },
+    base::Value::TYPE_STRING },
   { key::kDefaultSearchProviderImageURLPostParams,
     prefs::kDefaultSearchProviderImageURLPostParams,
-    Value::TYPE_STRING },
+    base::Value::TYPE_STRING },
 };
 
 // DefaultSearchEncodingsPolicyHandler implementation --------------------------
 
 DefaultSearchEncodingsPolicyHandler::DefaultSearchEncodingsPolicyHandler()
     : TypeCheckingPolicyHandler(key::kDefaultSearchProviderEncodings,
-                                Value::TYPE_LIST) {}
+                                base::Value::TYPE_LIST) {}
 
 DefaultSearchEncodingsPolicyHandler::~DefaultSearchEncodingsPolicyHandler() {
 }
@@ -86,13 +86,13 @@ void DefaultSearchEncodingsPolicyHandler::ApplyPolicySettings(
   // The DefaultSearchProviderEncodings policy has type list, but the related
   // preference has type string. Convert one into the other here, using
   // ';' as a separator.
-  const Value* value = policies.GetValue(policy_name());
-  const ListValue* list;
+  const base::Value* value = policies.GetValue(policy_name());
+  const base::ListValue* list;
   if (!value || !value->GetAsList(&list))
     return;
 
-  ListValue::const_iterator iter(list->begin());
-  ListValue::const_iterator end(list->end());
+  base::ListValue::const_iterator iter(list->begin());
+  base::ListValue::const_iterator end(list->end());
   std::vector<std::string> string_parts;
   for (; iter != end; ++iter) {
     std::string s;
@@ -102,7 +102,7 @@ void DefaultSearchEncodingsPolicyHandler::ApplyPolicySettings(
   }
   std::string encodings = JoinString(string_parts, ';');
   prefs->SetValue(prefs::kDefaultSearchProviderEncodings,
-                  Value::CreateStringValue(encodings));
+                  base::Value::CreateStringValue(encodings));
 }
 
 
@@ -147,7 +147,7 @@ bool DefaultSearchPolicyHandler::CheckPolicySettings(const PolicyMap& policies,
     return true;
   }
 
-  const Value* url;
+  const base::Value* url;
   std::string dummy;
   if (DefaultSearchURLIsValid(policies, &url, &dummy) ||
       !AnyDefaultSearchPoliciesSpecified(policies))
@@ -172,7 +172,7 @@ void DefaultSearchPolicyHandler::ApplyPolicySettings(const PolicyMap& policies,
     prefs->SetString(prefs::kDefaultSearchProviderInstantURL, std::string());
     prefs->SetString(prefs::kDefaultSearchProviderNewTabURL, std::string());
     prefs->SetValue(prefs::kDefaultSearchProviderAlternateURLs,
-                    new ListValue());
+                    new base::ListValue());
     prefs->SetString(
         prefs::kDefaultSearchProviderSearchTermsReplacementKey, std::string());
     prefs->SetString(prefs::kDefaultSearchProviderImageURL, std::string());
@@ -188,7 +188,7 @@ void DefaultSearchPolicyHandler::ApplyPolicySettings(const PolicyMap& policies,
     // The search URL is required.  The other entries are optional.  Just make
     // sure that they are all specified via policy, so that the regular prefs
     // aren't used.
-    const Value* dummy;
+    const base::Value* dummy;
     std::string url;
     if (DefaultSearchURLIsValid(policies, &dummy, &url)) {
 
@@ -281,7 +281,7 @@ bool DefaultSearchPolicyHandler::AnyDefaultSearchPoliciesSpecified(
 
 bool DefaultSearchPolicyHandler::DefaultSearchProviderIsDisabled(
     const PolicyMap& policies) {
-  const Value* provider_enabled =
+  const base::Value* provider_enabled =
       policies.GetValue(key::kDefaultSearchProviderEnabled);
   bool enabled = true;
   return provider_enabled && provider_enabled->GetAsBoolean(&enabled) &&
@@ -290,7 +290,7 @@ bool DefaultSearchPolicyHandler::DefaultSearchProviderIsDisabled(
 
 bool DefaultSearchPolicyHandler::DefaultSearchURLIsValid(
     const PolicyMap& policies,
-    const Value** url_value,
+    const base::Value** url_value,
     std::string* url_string) {
   *url_value = policies.GetValue(key::kDefaultSearchProviderSearchURL);
   if (!*url_value || !(*url_value)->GetAsString(url_string) ||
@@ -317,7 +317,7 @@ void DefaultSearchPolicyHandler::EnsureListPrefExists(
   base::Value* value;
   base::ListValue* list_value;
   if (!prefs->GetValue(path, &value) || !value->GetAsList(&list_value))
-    prefs->SetValue(path, new ListValue());
+    prefs->SetValue(path, new base::ListValue());
 }
 
 }  // namespace policy
diff --git a/chrome/browser/search_engines/default_search_policy_handler.h b/chrome/browser/search_engines/default_search_policy_handler.h
index 1dca24d..1f62541 100644
--- a/chrome/browser/search_engines/default_search_policy_handler.h
+++ b/chrome/browser/search_engines/default_search_policy_handler.h
@@ -57,7 +57,7 @@ class DefaultSearchPolicyHandler : public ConfigurationPolicyHandler {
   // Returns whether the default search URL is set and valid.  On success, both
   // outparams (which must be non-NULL) are filled with the search URL.
   bool DefaultSearchURLIsValid(const PolicyMap& policies,
-                               const Value** url_value,
+                               const base::Value** url_value,
                                std::string* url_string);
 
   // Make sure that the |path| is present in |prefs_|.  If not, set it to
diff --git a/chrome/browser/search_engines/search_provider_install_data_unittest.cc b/chrome/browser/search_engines/search_provider_install_data_unittest.cc
index 9f043ee..a09d1a8 100644
--- a/chrome/browser/search_engines/search_provider_install_data_unittest.cc
+++ b/chrome/browser/search_engines/search_provider_install_data_unittest.cc
@@ -175,16 +175,16 @@ void SearchProviderInstallDataTest::SimulateDefaultSearchIsManaged(
   TestingPrefServiceSyncable* service =
       util_.profile()->GetTestingPrefService();
   service->SetManagedPref(prefs::kDefaultSearchProviderEnabled,
-                          Value::CreateBooleanValue(true));
+                          base::Value::CreateBooleanValue(true));
   service->SetManagedPref(prefs::kDefaultSearchProviderSearchURL,
-                          Value::CreateStringValue(url));
+                          base::Value::CreateStringValue(url));
   service->SetManagedPref(prefs::kDefaultSearchProviderName,
-                          Value::CreateStringValue("managed"));
+                          base::Value::CreateStringValue("managed"));
   // Clear the IDs that are not specified via policy.
   service->SetManagedPref(prefs::kDefaultSearchProviderID,
-                          new StringValue(std::string()));
+                          new base::StringValue(std::string()));
   service->SetManagedPref(prefs::kDefaultSearchProviderPrepopulateID,
-                          new StringValue(std::string()));
+                          new base::StringValue(std::string()));
   util_.model()->Observe(chrome::NOTIFICATION_DEFAULT_SEARCH_POLICY_CHANGED,
                          content::NotificationService::AllSources(),
                          content::NotificationService::NoDetails());
diff --git a/chrome/browser/search_engines/template_url_prepopulate_data.cc b/chrome/browser/search_engines/template_url_prepopulate_data.cc
index 19a52d5..14b7c77 100644
--- a/chrome/browser/search_engines/template_url_prepopulate_data.cc
+++ b/chrome/browser/search_engines/template_url_prepopulate_data.cc
@@ -1083,7 +1083,7 @@ TemplateURL* MakePrepopulatedTemplateURL(
     const base::StringPiece& image_url_post_params,
     const base::StringPiece& favicon_url,
     const base::StringPiece& encoding,
-    const ListValue& alternate_urls,
+    const base::ListValue& alternate_urls,
     const base::StringPiece& search_terms_replacement_key,
     int id) {
 
@@ -1122,14 +1122,14 @@ ScopedVector<TemplateURL> GetPrepopulatedTemplateFromPrefs(Profile* profile) {
   if (!profile)
     return t_urls.Pass();
 
-  const ListValue* list =
+  const base::ListValue* list =
       profile->GetPrefs()->GetList(prefs::kSearchProviderOverrides);
   if (!list)
     return t_urls.Pass();
 
   size_t num_engines = list->GetSize();
   for (size_t i = 0; i != num_engines; ++i) {
-    const DictionaryValue* engine;
+    const base::DictionaryValue* engine;
     base::string16 name;
     base::string16 keyword;
     std::string search_url;
@@ -1154,8 +1154,8 @@ ScopedVector<TemplateURL> GetPrepopulatedTemplateFromPrefs(Profile* profile) {
       std::string suggest_url_post_params;
       std::string instant_url_post_params;
       std::string image_url_post_params;
-      ListValue empty_list;
-      const ListValue* alternate_urls = &empty_list;
+      base::ListValue empty_list;
+      const base::ListValue* alternate_urls = &empty_list;
       std::string search_terms_replacement_key;
       engine->GetString("suggest_url", &suggest_url);
       engine->GetString("instant_url", &instant_url);
@@ -1184,7 +1184,7 @@ TemplateURL* MakePrepopulatedTemplateURLFromPrepopulateEngine(
     Profile* profile,
     const PrepopulatedEngine& engine) {
 
-  ListValue alternate_urls;
+  base::ListValue alternate_urls;
   if (engine.alternate_urls) {
     for (size_t i = 0; i < engine.alternate_urls_size; ++i)
       alternate_urls.AppendString(std::string(engine.alternate_urls[i]));
diff --git a/chrome/browser/search_engines/template_url_prepopulate_data_unittest.cc b/chrome/browser/search_engines/template_url_prepopulate_data_unittest.cc
index 4e33b43..ffb53b3 100644
--- a/chrome/browser/search_engines/template_url_prepopulate_data_unittest.cc
+++ b/chrome/browser/search_engines/template_url_prepopulate_data_unittest.cc
@@ -105,9 +105,9 @@ TEST(TemplateURLPrepopulateDataTest, ProvidersFromPrefs) {
   TestingProfile profile;
   TestingPrefServiceSyncable* prefs = profile.GetTestingPrefService();
   prefs->SetUserPref(prefs::kSearchProviderOverridesVersion,
-                     Value::CreateIntegerValue(1));
-  ListValue* overrides = new ListValue;
-  scoped_ptr<DictionaryValue> entry(new DictionaryValue);
+                     base::Value::CreateIntegerValue(1));
+  base::ListValue* overrides = new base::ListValue;
+  scoped_ptr<base::DictionaryValue> entry(new base::DictionaryValue);
   // Set only the minimal required settings for a search provider configuration.
   entry->SetString("name", "foo");
   entry->SetString("keyword", "fook");
@@ -141,11 +141,11 @@ TEST(TemplateURLPrepopulateDataTest, ProvidersFromPrefs) {
   // Test the optional settings too.
   entry->SetString("suggest_url", "http://foo.com/suggest?q={searchTerms}");
   entry->SetString("instant_url", "http://foo.com/instant?q={searchTerms}");
-  ListValue* alternate_urls = new ListValue;
+  base::ListValue* alternate_urls = new base::ListValue;
   alternate_urls->AppendString("http://foo.com/alternate?q={searchTerms}");
   entry->Set("alternate_urls", alternate_urls);
   entry->SetString("search_terms_replacement_key", "espv");
-  overrides = new ListValue;
+  overrides = new base::ListValue;
   overrides->Append(entry->DeepCopy());
   prefs->SetUserPref(prefs::kSearchProviderOverrides, overrides);
 
@@ -169,7 +169,7 @@ TEST(TemplateURLPrepopulateDataTest, ProvidersFromPrefs) {
 
   // Test that subsequent providers are loaded even if an intermediate
   // provider has an incomplete configuration.
-  overrides = new ListValue;
+  overrides = new base::ListValue;
   overrides->Append(entry->DeepCopy());
   entry->SetInteger("id", 1002);
   entry->SetString("name", "bar");
@@ -192,9 +192,9 @@ TEST(TemplateURLPrepopulateDataTest, ClearProvidersFromPrefs) {
   TestingProfile profile;
   TestingPrefServiceSyncable* prefs = profile.GetTestingPrefService();
   prefs->SetUserPref(prefs::kSearchProviderOverridesVersion,
-                     Value::CreateIntegerValue(1));
-  ListValue* overrides = new ListValue;
-  DictionaryValue* entry(new DictionaryValue);
+                     base::Value::CreateIntegerValue(1));
+  base::ListValue* overrides = new base::ListValue;
+  base::DictionaryValue* entry(new base::DictionaryValue);
   // Set only the minimal required settings for a search provider configuration.
   entry->SetString("name", "foo");
   entry->SetString("keyword", "fook");
diff --git a/chrome/browser/search_engines/template_url_service.cc b/chrome/browser/search_engines/template_url_service.cc
index b4d6c7a..a4d28d9 100644
--- a/chrome/browser/search_engines/template_url_service.cc
+++ b/chrome/browser/search_engines/template_url_service.cc
@@ -1626,7 +1626,7 @@ void TemplateURLService::SaveDefaultSearchProviderToPrefs(
   std::string keyword;
   std::string id_string;
   std::string prepopulate_id;
-  ListValue alternate_urls;
+  base::ListValue alternate_urls;
   std::string search_terms_replacement_key;
   if (t_url) {
     DCHECK_EQ(TemplateURL::NORMAL, t_url->GetType());
@@ -1735,7 +1735,7 @@ bool TemplateURLService::LoadDefaultSearchProviderFromPrefs(
   std::string id_string = prefs->GetString(prefs::kDefaultSearchProviderID);
   std::string prepopulate_id =
       prefs->GetString(prefs::kDefaultSearchProviderPrepopulateID);
-  const ListValue* alternate_urls =
+  const base::ListValue* alternate_urls =
       prefs->GetList(prefs::kDefaultSearchProviderAlternateURLs);
   std::string search_terms_replacement_key = prefs->GetString(
       prefs::kDefaultSearchProviderSearchTermsReplacementKey);
diff --git a/chrome/browser/search_engines/template_url_service_test_util.cc b/chrome/browser/search_engines/template_url_service_test_util.cc
index efae64f..3f61682 100644
--- a/chrome/browser/search_engines/template_url_service_test_util.cc
+++ b/chrome/browser/search_engines/template_url_service_test_util.cc
@@ -146,27 +146,27 @@ void TemplateURLServiceTestUtilBase::SetManagedDefaultSearchPreferences(
     const std::string& search_terms_replacement_key) {
   TestingPrefServiceSyncable* pref_service = profile()->GetTestingPrefService();
   pref_service->SetManagedPref(prefs::kDefaultSearchProviderEnabled,
-                               Value::CreateBooleanValue(enabled));
+                               base::Value::CreateBooleanValue(enabled));
   pref_service->SetManagedPref(prefs::kDefaultSearchProviderName,
-                               Value::CreateStringValue(name));
+                               base::Value::CreateStringValue(name));
   pref_service->SetManagedPref(prefs::kDefaultSearchProviderKeyword,
-                               Value::CreateStringValue(keyword));
+                               base::Value::CreateStringValue(keyword));
   pref_service->SetManagedPref(prefs::kDefaultSearchProviderSearchURL,
-                               Value::CreateStringValue(search_url));
+                               base::Value::CreateStringValue(search_url));
   pref_service->SetManagedPref(prefs::kDefaultSearchProviderSuggestURL,
-                               Value::CreateStringValue(suggest_url));
+                               base::Value::CreateStringValue(suggest_url));
   pref_service->SetManagedPref(prefs::kDefaultSearchProviderIconURL,
-                               Value::CreateStringValue(icon_url));
+                               base::Value::CreateStringValue(icon_url));
   pref_service->SetManagedPref(prefs::kDefaultSearchProviderEncodings,
-                               Value::CreateStringValue(encodings));
+                               base::Value::CreateStringValue(encodings));
   scoped_ptr<base::ListValue> alternate_url_list(new base::ListValue());
   if (!alternate_url.empty())
-    alternate_url_list->Append(Value::CreateStringValue(alternate_url));
+    alternate_url_list->Append(base::Value::CreateStringValue(alternate_url));
   pref_service->SetManagedPref(prefs::kDefaultSearchProviderAlternateURLs,
                                alternate_url_list.release());
   pref_service->SetManagedPref(
       prefs::kDefaultSearchProviderSearchTermsReplacementKey,
-      Value::CreateStringValue(search_terms_replacement_key));
+      base::Value::CreateStringValue(search_terms_replacement_key));
   model()->Observe(chrome::NOTIFICATION_DEFAULT_SEARCH_POLICY_CHANGED,
                    content::NotificationService::AllSources(),
                    content::NotificationService::NoDetails());
-- 
cgit v1.1