diff options
79 files changed, 672 insertions, 638 deletions
diff --git a/chrome/browser/automation/automation_provider_observers.h b/chrome/browser/automation/automation_provider_observers.h index 3a2652d..38f12c4 100644 --- a/chrome/browser/automation/automation_provider_observers.h +++ b/chrome/browser/automation/automation_provider_observers.h @@ -853,7 +853,7 @@ class AllDownloadsCompleteObserver AutomationProvider* provider, IPC::Message* reply_message, content::DownloadManager* download_manager, - ListValue* pre_download_ids); + base::ListValue* pre_download_ids); virtual ~AllDownloadsCompleteObserver(); // content::DownloadManager::Observer. diff --git a/chrome/browser/automation/testing_automation_provider.h b/chrome/browser/automation/testing_automation_provider.h index 05ff049..ed32f21 100644 --- a/chrome/browser/automation/testing_automation_provider.h +++ b/chrome/browser/automation/testing_automation_provider.h @@ -208,7 +208,7 @@ class TestingAutomationProvider : public AutomationProvider, IPC::Message*); // JSON interface helper functions. - static scoped_ptr<DictionaryValue> ParseJSONRequestCommand( + static scoped_ptr<base::DictionaryValue> ParseJSONRequestCommand( const std::string& json_request, std::string* command, std::string* error); @@ -224,7 +224,7 @@ class TestingAutomationProvider : public AutomationProvider, // This includes info about the type of infobars, the message text, // buttons, etc. // Caller owns the returned object. - ListValue* GetInfobarsInfo(content::WebContents* tc); + base::ListValue* GetInfobarsInfo(content::WebContents* tc); // Perform actions on an infobar like dismiss, accept, cancel. // This method can handle dismiss for all infobars. It can also handle @@ -646,7 +646,7 @@ class TestingAutomationProvider : public AutomationProvider, // input: { "accelerator": 1, // "windex": 1 // } - void ExecuteBrowserCommandAsyncJSON(DictionaryValue* args, + void ExecuteBrowserCommandAsyncJSON(base::DictionaryValue* args, IPC::Message* reply_message); // Executes a browser command on the given browser window. Waits for the @@ -655,7 +655,7 @@ class TestingAutomationProvider : public AutomationProvider, // input: { "accelerator": 1, // "windex": 1 // } - void ExecuteBrowserCommandJSON(DictionaryValue* args, + void ExecuteBrowserCommandJSON(base::DictionaryValue* args, IPC::Message* reply_message); // Checks if a browser command is enabled on the given browser window. @@ -664,7 +664,7 @@ class TestingAutomationProvider : public AutomationProvider, // "windex": 1 // } // output: { "enabled": true } - void IsMenuCommandEnabledJSON(DictionaryValue* args, + void IsMenuCommandEnabledJSON(base::DictionaryValue* args, IPC::Message* reply_message); // Returns a dictionary of information about the given tab. @@ -674,14 +674,14 @@ class TestingAutomationProvider : public AutomationProvider, // } // output: { "title": "Hello World", // "url": "http://foo.bar" } - void GetTabInfo(DictionaryValue* args, + void GetTabInfo(base::DictionaryValue* args, IPC::Message* reply_message); // Returns the tab count for the given browser window. // Example: // input: { "windex": 1 } // output: { "tab_count": 5 } - void GetTabCountJSON(DictionaryValue* args, + void GetTabCountJSON(base::DictionaryValue* args, IPC::Message* reply_message); // Navigates to the given URL. Uses the JSON interface. @@ -702,7 +702,7 @@ class TestingAutomationProvider : public AutomationProvider, // Example: // input: { "windex": 1 } // output: { "tab_index": 3 } - void GetActiveTabIndexJSON(DictionaryValue* args, + void GetActiveTabIndexJSON(base::DictionaryValue* args, IPC::Message* reply_message); // Append a new tab. Uses the JSON interface. @@ -713,7 +713,7 @@ class TestingAutomationProvider : public AutomationProvider, // "url": "http://google.com" // } // output: { "result": AUTOMATION_MSG_NAVIGATION_SUCCESS } - void AppendTabJSON(DictionaryValue* args, IPC::Message* reply_message); + void AppendTabJSON(base::DictionaryValue* args, IPC::Message* reply_message); // Waits until any pending navigation completes in the specified tab. // The pair |windex| and |tab_index| or the single |auto_id| must be given @@ -1127,7 +1127,7 @@ class TestingAutomationProvider : public AutomationProvider, // Blocks until the given tab is restored. // Uses the JSON interface. - void WaitForTabToBeRestored(DictionaryValue* args, + void WaitForTabToBeRestored(base::DictionaryValue* args, IPC::Message* reply_message); // Simulates an action on the SSL blocking page at the specified tab. @@ -1141,7 +1141,7 @@ class TestingAutomationProvider : public AutomationProvider, // "proceed": true // } // output: none - void ActionOnSSLBlockingPage(DictionaryValue* args, + void ActionOnSSLBlockingPage(base::DictionaryValue* args, IPC::Message* reply_message); // Gets the security state for the given tab. Uses the JSON interface. @@ -1153,7 +1153,7 @@ class TestingAutomationProvider : public AutomationProvider, // "ssl_cert_status": 3, // bitmask of status flags // "insecure_content_status": 1, // bitmask of ContentStatusFlags // } - void GetSecurityState(DictionaryValue* args, + void GetSecurityState(base::DictionaryValue* args, IPC::Message* reply_message); // Brings the given brower's window to the front. @@ -1231,14 +1231,15 @@ class TestingAutomationProvider : public AutomationProvider, // Example: // input: { "skip_image_selection": true } // output: { "next_screen": "login" } - void SkipToLogin(DictionaryValue* args, IPC::Message* reply_message); + void SkipToLogin(base::DictionaryValue* args, IPC::Message* reply_message); // Returns info about the current OOBE screen. // Example: // input: none // output: { "screen_name": "network" } // output: none (when already logged in) - void GetOOBEScreenInfo(DictionaryValue* args, IPC::Message* reply_message); + void GetOOBEScreenInfo(base::DictionaryValue* args, + IPC::Message* reply_message); // Login / Logout. void GetLoginInfo(base::DictionaryValue* args, IPC::Message* reply_message); @@ -1257,7 +1258,7 @@ class TestingAutomationProvider : public AutomationProvider, void SubmitLoginForm(base::DictionaryValue* args, IPC::Message* reply_message); - void AddLoginEventObserver(DictionaryValue* args, + void AddLoginEventObserver(base::DictionaryValue* args, IPC::Message* reply_message); // Executes javascript in the specified frame in the OOBE WebUI on chromeos. @@ -1286,9 +1287,10 @@ class TestingAutomationProvider : public AutomationProvider, void GetBatteryInfo(base::DictionaryValue* args, IPC::Message* reply_message); // Accessibility. - void EnableSpokenFeedback(DictionaryValue* args, IPC::Message* reply_message); + void EnableSpokenFeedback(base::DictionaryValue* args, + IPC::Message* reply_message); - void IsSpokenFeedbackEnabled(DictionaryValue* args, + void IsSpokenFeedbackEnabled(base::DictionaryValue* args, IPC::Message* reply_message); // Time. @@ -1309,7 +1311,7 @@ class TestingAutomationProvider : public AutomationProvider, void SetMute(base::DictionaryValue* args, IPC::Message* reply_message); void CaptureProfilePhoto(Browser* browser, - DictionaryValue* args, + base::DictionaryValue* args, IPC::Message* reply_message); // Html terminal. diff --git a/chrome/browser/chromeos/login/managed/supervised_user_authentication.cc b/chrome/browser/chromeos/login/managed/supervised_user_authentication.cc index 21bd885..a45b929 100644 --- a/chrome/browser/chromeos/login/managed/supervised_user_authentication.cc +++ b/chrome/browser/chromeos/login/managed/supervised_user_authentication.cc @@ -105,7 +105,7 @@ bool SupervisedUserAuthentication::FillDataForNewUser( void SupervisedUserAuthentication::StorePasswordData( const std::string& user_id, const base::DictionaryValue& password_data) { - DictionaryValue holder; + base::DictionaryValue holder; owner_->GetPasswordInformation(user_id, &holder); const base::Value* value; if (password_data.GetWithoutPathExpansion(kSchemaVersion, &value)) diff --git a/chrome/browser/chromeos/login/supervised_user_manager_impl.cc b/chrome/browser/chromeos/login/supervised_user_manager_impl.cc index c975ba0..d335b8a 100644 --- a/chrome/browser/chromeos/login/supervised_user_manager_impl.cc +++ b/chrome/browser/chromeos/login/supervised_user_manager_impl.cc @@ -242,7 +242,7 @@ bool SupervisedUserManagerImpl::GetUserStringValue( const char* key, std::string* out_value) const { PrefService* local_state = g_browser_process->local_state(); - const DictionaryValue* dictionary = local_state->GetDictionary(key); + const base::DictionaryValue* dictionary = local_state->GetDictionary(key); return dictionary->GetStringWithoutPathExpansion(user_id, out_value); } @@ -251,7 +251,7 @@ bool SupervisedUserManagerImpl::GetUserIntegerValue( const char* key, int* out_value) const { PrefService* local_state = g_browser_process->local_state(); - const DictionaryValue* dictionary = local_state->GetDictionary(key); + const base::DictionaryValue* dictionary = local_state->GetDictionary(key); return dictionary->GetIntegerWithoutPathExpansion(user_id, out_value); } diff --git a/chrome/browser/content_settings/content_settings_pref_provider.h b/chrome/browser/content_settings/content_settings_pref_provider.h index ad78aee..9d8a2bc 100644 --- a/chrome/browser/content_settings/content_settings_pref_provider.h +++ b/chrome/browser/content_settings/content_settings_pref_provider.h @@ -48,7 +48,7 @@ class PrefProvider : public ObservableProvider { const ContentSettingsPattern& secondary_pattern, ContentSettingsType content_type, const ResourceIdentifier& resource_identifier, - Value* value) OVERRIDE; + base::Value* value) OVERRIDE; virtual void ClearAllContentSettingsRules( ContentSettingsType content_type) OVERRIDE; diff --git a/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.cc b/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.cc index bed03c0..c73713a 100644 --- a/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.cc +++ b/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.cc @@ -388,7 +388,7 @@ bool MediaGalleriesPrivateGetHandlersFunction::RunImpl() { extensions::ExtensionSystem::Get(GetProfile())->extension_service(); DCHECK(service); - ListValue* result_list = new ListValue; + base::ListValue* result_list = new base::ListValue; for (ExtensionSet::const_iterator iter = service->extensions()->begin(); iter != service->extensions()->end(); @@ -408,7 +408,7 @@ bool MediaGalleriesPrivateGetHandlersFunction::RunImpl() { action_iter != handler_list->end(); ++action_iter) { const MediaGalleriesHandler* action = action_iter->get(); - DictionaryValue* handler = new DictionaryValue; + base::DictionaryValue* handler = new base::DictionaryValue; handler->SetString("extensionId", action->extension_id()); handler->SetString("id", action->id()); handler->SetString("title", action->title()); diff --git a/chrome/browser/extensions/api/networking_private/networking_private_service_client.cc b/chrome/browser/extensions/api/networking_private/networking_private_service_client.cc index 1c1eb29..9d5e47e 100644 --- a/chrome/browser/extensions/api/networking_private/networking_private_service_client.cc +++ b/chrome/browser/extensions/api/networking_private/networking_private_service_client.cc @@ -183,7 +183,7 @@ void NetworkingPrivateServiceClient::GetProperties( service_callbacks->error_callback = error_callback; service_callbacks->get_properties_callback = callback; - DictionaryValue* properties = new DictionaryValue(); + base::DictionaryValue* properties = new base::DictionaryValue(); std::string* error = new std::string; task_runner_->PostTaskAndReply( @@ -209,7 +209,7 @@ void NetworkingPrivateServiceClient::GetManagedProperties( service_callbacks->error_callback = error_callback; service_callbacks->get_properties_callback = callback; - DictionaryValue* properties = new DictionaryValue(); + base::DictionaryValue* properties = new base::DictionaryValue(); std::string* error = new std::string; task_runner_->PostTaskAndReply( @@ -235,7 +235,7 @@ void NetworkingPrivateServiceClient::GetState( service_callbacks->error_callback = error_callback; service_callbacks->get_properties_callback = callback; - DictionaryValue* properties = new DictionaryValue(); + base::DictionaryValue* properties = new base::DictionaryValue(); std::string* error = new std::string; task_runner_->PostTaskAndReply( @@ -259,7 +259,7 @@ void NetworkingPrivateServiceClient::GetVisibleNetworks( ServiceCallbacks* service_callbacks = AddServiceCallbacks(); service_callbacks->get_visible_networks_callback = callback; - ListValue* networks = new ListValue(); + base::ListValue* networks = new base::ListValue(); task_runner_->PostTaskAndReply( FROM_HERE, @@ -430,7 +430,7 @@ void NetworkingPrivateServiceClient::VerifyAndEncryptData( void NetworkingPrivateServiceClient::AfterGetProperties( ServiceCallbacksID callback_id, const std::string& network_guid, - const DictionaryValue* properties, + const base::DictionaryValue* properties, const std::string* error) { ServiceCallbacks* service_callbacks = callbacks_map_.Lookup(callback_id); DCHECK(service_callbacks); @@ -447,7 +447,7 @@ void NetworkingPrivateServiceClient::AfterGetProperties( void NetworkingPrivateServiceClient::AfterGetVisibleNetworks( ServiceCallbacksID callback_id, - const ListValue* networks) { + const base::ListValue* networks) { ServiceCallbacks* service_callbacks = callbacks_map_.Lookup(callback_id); DCHECK(service_callbacks); DCHECK(!service_callbacks->get_visible_networks_callback.is_null()); diff --git a/chrome/browser/extensions/api/networking_private/networking_private_service_client.h b/chrome/browser/extensions/api/networking_private/networking_private_service_client.h index 91ea7de..a708fc9 100644 --- a/chrome/browser/extensions/api/networking_private/networking_private_service_client.h +++ b/chrome/browser/extensions/api/networking_private/networking_private_service_client.h @@ -218,7 +218,7 @@ class NetworkingPrivateServiceClient : public BrowserContextKeyedService { // Callback wrappers. void AfterGetProperties(ServiceCallbacksID callback_id, const std::string& network_guid, - const DictionaryValue* properties, + const base::DictionaryValue* properties, const std::string* error); void AfterSetProperties(ServiceCallbacksID callback_id, const std::string* error); @@ -226,7 +226,7 @@ class NetworkingPrivateServiceClient : public BrowserContextKeyedService { const std::string* network_guid, const std::string* error); void AfterGetVisibleNetworks(ServiceCallbacksID callback_id, - const ListValue* network_list); + const base::ListValue* network_list); void AfterStartConnect(ServiceCallbacksID callback_id, const std::string* error); void AfterStartDisconnect(ServiceCallbacksID callback_id, diff --git a/chrome/browser/extensions/api/permissions/permissions_api_helpers_unittest.cc b/chrome/browser/extensions/api/permissions/permissions_api_helpers_unittest.cc index 4ac1b81..3ab2d41 100644 --- a/chrome/browser/extensions/api/permissions/permissions_api_helpers_unittest.cc +++ b/chrome/browser/extensions/api/permissions/permissions_api_helpers_unittest.cc @@ -52,13 +52,13 @@ TEST(ExtensionPermissionsAPIHelpers, Pack) { std::string expected_apis[] = { "tabs", "webRequest" }; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(expected_apis); ++i) { - scoped_ptr<Value> value(new base::StringValue(expected_apis[i])); + scoped_ptr<base::Value> value(new base::StringValue(expected_apis[i])); EXPECT_NE(api_list->end(), api_list->Find(*value)); } std::string expected_origins[] = { "http://a.com/*", "http://b.com/*" }; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(expected_origins); ++i) { - scoped_ptr<Value> value(new base::StringValue(expected_origins[i])); + scoped_ptr<base::Value> value(new base::StringValue(expected_origins[i])); EXPECT_NE(origin_list->end(), origin_list->Find(*value)); } diff --git a/chrome/browser/extensions/api/preference/chrome_direct_setting.cc b/chrome/browser/extensions/api/preference/chrome_direct_setting.cc index bcd13a5..3c3aa2939 100644 --- a/chrome/browser/extensions/api/preference/chrome_direct_setting.cc +++ b/chrome/browser/extensions/api/preference/chrome_direct_setting.cc @@ -42,7 +42,7 @@ bool GetDirectSettingFunction::RunImpl() { EXTENSION_FUNCTION_VALIDATE(preference); const base::Value* value = preference->GetValue(); - scoped_ptr<DictionaryValue> result(new DictionaryValue); + scoped_ptr<base::DictionaryValue> result(new base::DictionaryValue); result->Set(preference_api_constants::kValue, value->DeepCopy()); SetResult(result.release()); @@ -61,10 +61,10 @@ bool SetDirectSettingFunction::RunImpl() { EXTENSION_FUNCTION_VALIDATE(ChromeDirectSettingAPI::Get(GetProfile()) ->IsPreferenceOnWhitelist(pref_key)); - DictionaryValue* details = NULL; + base::DictionaryValue* details = NULL; EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(1, &details)); - Value* value = NULL; + base::Value* value = NULL; EXTENSION_FUNCTION_VALIDATE( details->Get(preference_api_constants::kValue, &value)); diff --git a/chrome/browser/extensions/api/preference/chrome_direct_setting_api.cc b/chrome/browser/extensions/api/preference/chrome_direct_setting_api.cc index 04b4307..33b26bd 100644 --- a/chrome/browser/extensions/api/preference/chrome_direct_setting_api.cc +++ b/chrome/browser/extensions/api/preference/chrome_direct_setting_api.cc @@ -127,7 +127,7 @@ void ChromeDirectSettingAPI::OnPrefChanged( profile_->GetPrefs()->FindPreference(pref_key.c_str()); const base::Value* value = preference->GetValue(); - scoped_ptr<DictionaryValue> result(new DictionaryValue); + scoped_ptr<base::DictionaryValue> result(new base::DictionaryValue); result->Set(preference_api_constants::kValue, value->DeepCopy()); base::ListValue args; args.Append(result.release()); diff --git a/chrome/browser/extensions/api/preference/preference_api.cc b/chrome/browser/extensions/api/preference/preference_api.cc index 9711adf..d2b2198 100644 --- a/chrome/browser/extensions/api/preference/preference_api.cc +++ b/chrome/browser/extensions/api/preference/preference_api.cc @@ -110,31 +110,33 @@ PrefMappingEntry kPrefMapping[] = { class IdentityPrefTransformer : public PrefTransformerInterface { public: - virtual Value* ExtensionToBrowserPref(const Value* extension_pref, - std::string* error, - bool* bad_message) OVERRIDE { + virtual base::Value* ExtensionToBrowserPref(const base::Value* extension_pref, + std::string* error, + bool* bad_message) OVERRIDE { return extension_pref->DeepCopy(); } - virtual Value* BrowserToExtensionPref(const Value* browser_pref) OVERRIDE { + virtual base::Value* BrowserToExtensionPref( + const base::Value* browser_pref) OVERRIDE { return browser_pref->DeepCopy(); } }; class InvertBooleanTransformer : public PrefTransformerInterface { public: - virtual Value* ExtensionToBrowserPref(const Value* extension_pref, - std::string* error, - bool* bad_message) OVERRIDE { + virtual base::Value* ExtensionToBrowserPref(const base::Value* extension_pref, + std::string* error, + bool* bad_message) OVERRIDE { return InvertBooleanValue(extension_pref); } - virtual Value* BrowserToExtensionPref(const Value* browser_pref) OVERRIDE { + virtual base::Value* BrowserToExtensionPref( + const base::Value* browser_pref) OVERRIDE { return InvertBooleanValue(browser_pref); } private: - static Value* InvertBooleanValue(const Value* value) { + static base::Value* InvertBooleanValue(const base::Value* value) { bool bool_value = false; bool result = value->GetAsBoolean(&bool_value); DCHECK(result); @@ -265,14 +267,14 @@ void PreferenceEventRouter::OnPrefChanged(PrefService* pref_service, DCHECK(rv); base::ListValue args; - DictionaryValue* dict = new DictionaryValue(); + base::DictionaryValue* dict = new base::DictionaryValue(); args.Append(dict); const PrefService::Preference* pref = pref_service->FindPreference(browser_pref.c_str()); CHECK(pref); PrefTransformerInterface* transformer = PrefMapping::GetInstance()->FindTransformerForBrowserPref(browser_pref); - Value* transformed_value = + base::Value* transformed_value = transformer->BrowserToExtensionPref(pref->GetValue()); if (!transformed_value) { LOG(ERROR) << ErrorUtils::FormatErrorMessage(kConversionErrorMessage, @@ -317,7 +319,7 @@ void PreferenceAPIBase::SetExtensionControlledPref( ExtensionPrefs::ScopedDictionaryUpdate update(extension_prefs(), extension_id, scope_string); - DictionaryValue* preference = update.Get(); + base::DictionaryValue* preference = update.Get(); if (!preference) preference = update.Create(); preference->SetWithoutPathExpansion(pref_key, value->DeepCopy()); @@ -339,7 +341,7 @@ void PreferenceAPIBase::RemoveExtensionControlledPref( ExtensionPrefs::ScopedDictionaryUpdate update(extension_prefs(), extension_id, scope_string); - DictionaryValue* preference = update.Get(); + base::DictionaryValue* preference = update.Get(); if (preference) preference->RemoveWithoutPathExpansion(pref_key, NULL); } @@ -423,13 +425,13 @@ void PreferenceAPI::LoadExtensionControlledPrefs( return; std::string key = extension_id + "." + scope_string; - const DictionaryValue* source_dict = prefs->pref_service()-> + const base::DictionaryValue* source_dict = prefs->pref_service()-> GetDictionary(prefs::kExtensionsPref); - const DictionaryValue* preferences = NULL; + const base::DictionaryValue* preferences = NULL; if (!source_dict->GetDictionary(key, &preferences)) return; - for (DictionaryValue::Iterator iter(*preferences); + for (base::DictionaryValue::Iterator iter(*preferences); !iter.IsAtEnd(); iter.Advance()) { value_map->SetExtensionPref( extension_id, iter.key(), scope, iter.value().DeepCopy()); @@ -552,7 +554,7 @@ GetPreferenceFunction::~GetPreferenceFunction() { } bool GetPreferenceFunction::RunImpl() { std::string pref_key; EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &pref_key)); - DictionaryValue* details = NULL; + base::DictionaryValue* details = NULL; EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(1, &details)); bool incognito = false; @@ -576,7 +578,7 @@ bool GetPreferenceFunction::RunImpl() { prefs->FindPreference(browser_pref.c_str()); CHECK(pref); - scoped_ptr<DictionaryValue> result(new DictionaryValue); + scoped_ptr<base::DictionaryValue> result(new base::DictionaryValue); // Retrieve level of control. std::string level_of_control = helpers::GetLevelOfControl( @@ -586,7 +588,7 @@ bool GetPreferenceFunction::RunImpl() { // Retrieve pref value. PrefTransformerInterface* transformer = PrefMapping::GetInstance()->FindTransformerForBrowserPref(browser_pref); - Value* transformed_value = + base::Value* transformed_value = transformer->BrowserToExtensionPref(pref->GetValue()); if (!transformed_value) { LOG(ERROR) << @@ -612,10 +614,10 @@ SetPreferenceFunction::~SetPreferenceFunction() { } bool SetPreferenceFunction::RunImpl() { std::string pref_key; EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &pref_key)); - DictionaryValue* details = NULL; + base::DictionaryValue* details = NULL; EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(1, &details)); - Value* value = NULL; + base::Value* value = NULL; EXTENSION_FUNCTION_VALIDATE(details->Get(keys::kValue, &value)); ExtensionPrefsScope scope = kExtensionPrefsScopeRegular; @@ -667,7 +669,7 @@ bool SetPreferenceFunction::RunImpl() { PrefMapping::GetInstance()->FindTransformerForBrowserPref(browser_pref); std::string error; bool bad_message = false; - scoped_ptr<Value> browser_pref_value( + scoped_ptr<base::Value> browser_pref_value( transformer->ExtensionToBrowserPref(value, &error, &bad_message)); if (!browser_pref_value) { error_ = error; @@ -677,7 +679,7 @@ bool SetPreferenceFunction::RunImpl() { // Validate also that the stored value can be converted back by the // transformer. - scoped_ptr<Value> extensionPrefValue( + scoped_ptr<base::Value> extensionPrefValue( transformer->BrowserToExtensionPref(browser_pref_value.get())); if (!extensionPrefValue) { error_ = ErrorUtils::FormatErrorMessage(kConversionErrorMessage, @@ -696,7 +698,7 @@ ClearPreferenceFunction::~ClearPreferenceFunction() { } bool ClearPreferenceFunction::RunImpl() { std::string pref_key; EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &pref_key)); - DictionaryValue* details = NULL; + base::DictionaryValue* details = NULL; EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(1, &details)); ExtensionPrefsScope scope = kExtensionPrefsScopeRegular; diff --git a/chrome/browser/extensions/api/preference/preference_api_prefs_unittest.cc b/chrome/browser/extensions/api/preference/preference_api_prefs_unittest.cc index 4f26606..63adc0b 100644 --- a/chrome/browser/extensions/api/preference/preference_api_prefs_unittest.cc +++ b/chrome/browser/extensions/api/preference/preference_api_prefs_unittest.cc @@ -107,7 +107,7 @@ void ExtensionControlledPrefsTest::RegisterPreferences( void ExtensionControlledPrefsTest::InstallExtensionControlledPref( Extension* extension, const std::string& key, - Value* value) { + base::Value* value) { EnsureExtensionInstalled(extension); test_preference_api_.SetExtensionControlledPref( extension->id(), key, kExtensionPrefsScopeRegular, value); @@ -116,7 +116,7 @@ void ExtensionControlledPrefsTest::InstallExtensionControlledPref( void ExtensionControlledPrefsTest::InstallExtensionControlledPrefIncognito( Extension* extension, const std::string& key, - Value* value) { + base::Value* value) { EnsureExtensionInstalled(extension); test_preference_api_.SetExtensionControlledPref( extension->id(), key, kExtensionPrefsScopeIncognitoPersistent, value); @@ -125,7 +125,7 @@ void ExtensionControlledPrefsTest::InstallExtensionControlledPrefIncognito( void ExtensionControlledPrefsTest:: InstallExtensionControlledPrefIncognitoSessionOnly(Extension* extension, const std::string& key, - Value* value) { + base::Value* value) { EnsureExtensionInstalled(extension); test_preference_api_.SetExtensionControlledPref( extension->id(), key, kExtensionPrefsScopeIncognitoSessionOnly, value); @@ -390,10 +390,10 @@ class ControlledPrefsReenableExtension : public ExtensionControlledPrefsTest { TEST_F(ControlledPrefsDisableExtension, ControlledPrefsReenableExtension) { } // Mock class to test whether objects are deleted correctly. -class MockStringValue : public StringValue { +class MockStringValue : public base::StringValue { public: explicit MockStringValue(const std::string& in_value) - : StringValue(in_value) { + : base::StringValue(in_value) { } virtual ~MockStringValue() { Die(); diff --git a/chrome/browser/extensions/api/processes/processes_api.cc b/chrome/browser/extensions/api/processes/processes_api.cc index 1d304d9..6129d5c 100644 --- a/chrome/browser/extensions/api/processes/processes_api.cc +++ b/chrome/browser/extensions/api/processes/processes_api.cc @@ -678,7 +678,7 @@ GetProcessInfoFunction::~GetProcessInfoFunction() { bool GetProcessInfoFunction::RunImpl() { #if defined(ENABLE_TASK_MANAGER) - Value* processes = NULL; + base::Value* processes = NULL; EXTENSION_FUNCTION_VALIDATE(args_->Get(0, &processes)); EXTENSION_FUNCTION_VALIDATE(args_->GetBoolean(1, &memory_)); diff --git a/chrome/browser/extensions/api/proxy/proxy_api.cc b/chrome/browser/extensions/api/proxy/proxy_api.cc index d5b60c9..3f43260 100644 --- a/chrome/browser/extensions/api/proxy/proxy_api.cc +++ b/chrome/browser/extensions/api/proxy/proxy_api.cc @@ -88,13 +88,14 @@ ProxyPrefTransformer::ProxyPrefTransformer() { ProxyPrefTransformer::~ProxyPrefTransformer() { } -Value* ProxyPrefTransformer::ExtensionToBrowserPref(const Value* extension_pref, - std::string* error, - bool* bad_message) { +base::Value* ProxyPrefTransformer::ExtensionToBrowserPref( + const base::Value* extension_pref, + std::string* error, + bool* bad_message) { // When ExtensionToBrowserPref is called, the format of |extension_pref| // has been verified already by the extension API to match the schema // defined in the extension API JSON. - CHECK(extension_pref->IsType(Value::TYPE_DICTIONARY)); + CHECK(extension_pref->IsType(base::Value::TYPE_DICTIONARY)); const base::DictionaryValue* config = static_cast<const base::DictionaryValue*>(extension_pref); @@ -129,8 +130,9 @@ Value* ProxyPrefTransformer::ExtensionToBrowserPref(const Value* extension_pref, bypass_list, error); } -Value* ProxyPrefTransformer::BrowserToExtensionPref(const Value* browser_pref) { - CHECK(browser_pref->IsType(Value::TYPE_DICTIONARY)); +base::Value* ProxyPrefTransformer::BrowserToExtensionPref( + const base::Value* browser_pref) { + CHECK(browser_pref->IsType(base::Value::TYPE_DICTIONARY)); // This is a dictionary wrapper that exposes the proxy configuration stored in // the browser preferences. diff --git a/chrome/browser/extensions/api/proxy/proxy_api_helpers_unittest.cc b/chrome/browser/extensions/api/proxy/proxy_api_helpers_unittest.cc index 7a92fa4..b32256b 100644 --- a/chrome/browser/extensions/api/proxy/proxy_api_helpers_unittest.cc +++ b/chrome/browser/extensions/api/proxy/proxy_api_helpers_unittest.cc @@ -230,7 +230,7 @@ TEST(ExtensionProxyApiHelpers, CreateProxyConfigDict) { std::string(), std::string(), &error)); - EXPECT_TRUE(Value::Equals(exp_direct.get(), out_direct.get())); + EXPECT_TRUE(base::Value::Equals(exp_direct.get(), out_direct.get())); scoped_ptr<base::DictionaryValue> exp_auto( ProxyConfigDictionary::CreateAutoDetect()); @@ -242,7 +242,7 @@ TEST(ExtensionProxyApiHelpers, CreateProxyConfigDict) { std::string(), std::string(), &error)); - EXPECT_TRUE(Value::Equals(exp_auto.get(), out_auto.get())); + EXPECT_TRUE(base::Value::Equals(exp_auto.get(), out_auto.get())); scoped_ptr<base::DictionaryValue> exp_pac_url( ProxyConfigDictionary::CreatePacScript(kSamplePacScriptUrl, false)); @@ -254,7 +254,7 @@ TEST(ExtensionProxyApiHelpers, CreateProxyConfigDict) { std::string(), std::string(), &error)); - EXPECT_TRUE(Value::Equals(exp_pac_url.get(), out_pac_url.get())); + EXPECT_TRUE(base::Value::Equals(exp_pac_url.get(), out_pac_url.get())); scoped_ptr<base::DictionaryValue> exp_pac_data( ProxyConfigDictionary::CreatePacScript(kSamplePacScriptAsDataUrl, false)); @@ -266,7 +266,7 @@ TEST(ExtensionProxyApiHelpers, CreateProxyConfigDict) { std::string(), std::string(), &error)); - EXPECT_TRUE(Value::Equals(exp_pac_data.get(), out_pac_data.get())); + EXPECT_TRUE(base::Value::Equals(exp_pac_data.get(), out_pac_data.get())); scoped_ptr<base::DictionaryValue> exp_fixed( ProxyConfigDictionary::CreateFixedServers("foo:80", "localhost")); @@ -278,7 +278,7 @@ TEST(ExtensionProxyApiHelpers, CreateProxyConfigDict) { "foo:80", "localhost", &error)); - EXPECT_TRUE(Value::Equals(exp_fixed.get(), out_fixed.get())); + EXPECT_TRUE(base::Value::Equals(exp_fixed.get(), out_fixed.get())); scoped_ptr<base::DictionaryValue> exp_system( ProxyConfigDictionary::CreateSystem()); @@ -290,7 +290,7 @@ TEST(ExtensionProxyApiHelpers, CreateProxyConfigDict) { std::string(), std::string(), &error)); - EXPECT_TRUE(Value::Equals(exp_system.get(), out_system.get())); + EXPECT_TRUE(base::Value::Equals(exp_system.get(), out_system.get())); // Neither of them should have set an error. EXPECT_EQ(std::string(), error); @@ -358,7 +358,7 @@ TEST(ExtensionProxyApiHelpers, CreateProxyRulesDict) { bypass_list->Append(new base::StringValue("localhost")); expected->Set(keys::kProxyConfigBypassList, bypass_list); - EXPECT_TRUE(Value::Equals(expected.get(), extension_pref.get())); + EXPECT_TRUE(base::Value::Equals(expected.get(), extension_pref.get())); } // Test multiple proxies per scheme -- expect that only the first is returned. @@ -386,7 +386,7 @@ TEST(ExtensionProxyApiHelpers, CreateProxyRulesDictMultipleProxies) { bypass_list->Append(new base::StringValue("localhost")); expected->Set(keys::kProxyConfigBypassList, bypass_list); - EXPECT_TRUE(Value::Equals(expected.get(), extension_pref.get())); + EXPECT_TRUE(base::Value::Equals(expected.get(), extension_pref.get())); } // Test if a PAC script URL is specified. @@ -401,7 +401,7 @@ TEST(ExtensionProxyApiHelpers, CreatePacScriptDictWithUrl) { expected->SetString(keys::kProxyConfigPacScriptUrl, kSamplePacScriptUrl); expected->SetBoolean(keys::kProxyConfigPacScriptMandatory, false); - EXPECT_TRUE(Value::Equals(expected.get(), extension_pref.get())); + EXPECT_TRUE(base::Value::Equals(expected.get(), extension_pref.get())); } // Test if a PAC script is encoded in a data URL. @@ -416,7 +416,7 @@ TEST(ExtensionProxyApiHelpers, CreatePacScriptDictWidthData) { expected->SetString(keys::kProxyConfigPacScriptData, kSamplePacScript); expected->SetBoolean(keys::kProxyConfigPacScriptMandatory, false); - EXPECT_TRUE(Value::Equals(expected.get(), extension_pref.get())); + EXPECT_TRUE(base::Value::Equals(expected.get(), extension_pref.get())); } TEST(ExtensionProxyApiHelpers, TokenizeToStringList) { @@ -426,7 +426,7 @@ TEST(ExtensionProxyApiHelpers, TokenizeToStringList) { expected.Append(new base::StringValue("s3")); scoped_ptr<base::ListValue> out(TokenizeToStringList("s1;s2;s3", ";")); - EXPECT_TRUE(Value::Equals(&expected, out.get())); + EXPECT_TRUE(base::Value::Equals(&expected, out.get())); } } // namespace proxy_api_helpers diff --git a/chrome/browser/extensions/api/sessions/sessions_api.cc b/chrome/browser/extensions/api/sessions/sessions_api.cc index 96094d7..9bd68b1 100644 --- a/chrome/browser/extensions/api/sessions/sessions_api.cc +++ b/chrome/browser/extensions/api/sessions/sessions_api.cc @@ -393,7 +393,7 @@ void SessionsRestoreFunction::SetInvalidIdError(const std::string& invalid_id) { void SessionsRestoreFunction::SetResultRestoredTab( const content::WebContents* contents) { - scoped_ptr<DictionaryValue> tab_value( + scoped_ptr<base::DictionaryValue> tab_value( ExtensionTabUtil::CreateTabValue(contents, GetExtension())); scoped_ptr<tabs::Tab> tab(tabs::Tab::FromValue(*tab_value)); scoped_ptr<api::sessions::Session> restored_session(CreateSessionModelHelper( @@ -409,7 +409,7 @@ bool SessionsRestoreFunction::SetResultRestoredWindow(int window_id) { // error_ is set by GetWindowFromWindowId function call. return false; } - scoped_ptr<DictionaryValue> window_value( + scoped_ptr<base::DictionaryValue> window_value( controller->CreateWindowValueWithTabs(GetExtension())); scoped_ptr<windows::Window> window(windows::Window::FromValue( *window_value)); diff --git a/chrome/browser/extensions/api/sessions/sessions_apitest.cc b/chrome/browser/extensions/api/sessions/sessions_apitest.cc index 633d681..2555e26 100644 --- a/chrome/browser/extensions/api/sessions/sessions_apitest.cc +++ b/chrome/browser/extensions/api/sessions/sessions_apitest.cc @@ -220,10 +220,10 @@ IN_PROC_BROWSER_TEST_F(ExtensionSessionsTest, GetDevices) { "[{\"maxResults\": 0}]", browser_))); ASSERT_TRUE(result); - ListValue* devices = result.get(); + base::ListValue* devices = result.get(); EXPECT_EQ(5u, devices->GetSize()); - DictionaryValue* device = NULL; - ListValue* sessions = NULL; + base::DictionaryValue* device = NULL; + base::ListValue* sessions = NULL; for (size_t i = 0; i < devices->GetSize(); ++i) { EXPECT_TRUE(devices->GetDictionary(i, &device)); EXPECT_EQ(kSessionTags[i], utils::GetString(device, "info")); @@ -241,10 +241,10 @@ IN_PROC_BROWSER_TEST_F(ExtensionSessionsTest, GetDevicesMaxResults) { "[]", browser_))); ASSERT_TRUE(result); - ListValue* devices = result.get(); + base::ListValue* devices = result.get(); EXPECT_EQ(5u, devices->GetSize()); - DictionaryValue* device = NULL; - ListValue* sessions = NULL; + base::DictionaryValue* device = NULL; + base::ListValue* sessions = NULL; for (size_t i = 0; i < devices->GetSize(); ++i) { EXPECT_TRUE(devices->GetDictionary(i, &device)); EXPECT_EQ(kSessionTags[i], utils::GetString(device, "info")); @@ -261,7 +261,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionSessionsTest, GetDevicesListEmpty) { browser_))); ASSERT_TRUE(result); - ListValue* devices = result.get(); + base::ListValue* devices = result.get(); EXPECT_EQ(0u, devices->GetSize()); } @@ -285,12 +285,12 @@ IN_PROC_BROWSER_TEST_F(ExtensionSessionsTest, browser_))); ASSERT_TRUE(result); - ListValue* windows = result.get(); + base::ListValue* windows = result.get(); EXPECT_EQ(2u, windows->GetSize()); - DictionaryValue* restored_window = NULL; + base::DictionaryValue* restored_window = NULL; EXPECT_TRUE(restored_window_session->GetDictionary("window", &restored_window)); - DictionaryValue* window = NULL; + base::DictionaryValue* window = NULL; int restored_id = utils::GetInteger(restored_window, "id"); for (size_t i = 0; i < windows->GetSize(); ++i) { EXPECT_TRUE(windows->GetDictionary(i, &window)); diff --git a/chrome/browser/extensions/api/settings_overrides/settings_overrides_api.cc b/chrome/browser/extensions/api/settings_overrides/settings_overrides_api.cc index bd70e9c..6ed3b95 100644 --- a/chrome/browser/extensions/api/settings_overrides/settings_overrides_api.cc +++ b/chrome/browser/extensions/api/settings_overrides/settings_overrides_api.cc @@ -130,8 +130,9 @@ void SettingsOverridesAPI::Observe( VLOG(1) << extensions::ErrorUtils::FormatErrorMessage( kManyStartupPagesWarning, manifest_keys::kSettingsOverride); } - scoped_ptr<ListValue> url_list(new ListValue); - url_list->Append(new StringValue(settings->startup_pages[0].spec())); + scoped_ptr<base::ListValue> url_list(new base::ListValue); + url_list->Append( + new base::StringValue(settings->startup_pages[0].spec())); SetPref(extension->id(), prefs::kURLsToRestoreOnStartup, url_list.release()); } diff --git a/chrome/browser/extensions/api/signed_in_devices/id_mapping_helper.cc b/chrome/browser/extensions/api/signed_in_devices/id_mapping_helper.cc index e0b564d..322ae82 100644 --- a/chrome/browser/extensions/api/signed_in_devices/id_mapping_helper.cc +++ b/chrome/browser/extensions/api/signed_in_devices/id_mapping_helper.cc @@ -23,10 +23,10 @@ namespace extensions { std::string GetPublicIdFromGUID( const base::DictionaryValue& id_mapping, const std::string& guid) { - for (DictionaryValue::Iterator it(id_mapping); + for (base::DictionaryValue::Iterator it(id_mapping); !it.IsAtEnd(); it.Advance()) { - const Value& value = it.value(); + const base::Value& value = it.value(); std::string guid_in_value; if (!value.GetAsString(&guid_in_value)) { LOG(ERROR) << "Badly formatted dictionary"; @@ -51,13 +51,13 @@ std::string GetGUIDFromPublicId( // Finds out a random unused id. First finds a random id. // If the id is in use, increments the id until it finds an unused id. std::string GetRandomId( - const DictionaryValue& mapping, + const base::DictionaryValue& mapping, int device_count) { // Set the max value for rand to be twice the device count. int max = device_count * 2; int rand_value = base::RandInt(0, max); std::string string_value; - const Value *out_value; + const base::Value *out_value; do { string_value = base::IntToString(rand_value); diff --git a/chrome/browser/extensions/api/signed_in_devices/signed_in_devices_api.cc b/chrome/browser/extensions/api/signed_in_devices/signed_in_devices_api.cc index 2c678f4..9b3ea1d 100644 --- a/chrome/browser/extensions/api/signed_in_devices/signed_in_devices_api.cc +++ b/chrome/browser/extensions/api/signed_in_devices/signed_in_devices_api.cc @@ -34,7 +34,7 @@ const base::DictionaryValue* GetIdMappingDictionary( &out_value) || out_value == NULL) { // Looks like this is the first call to get the dictionary. Let us create // a dictionary and set it in to |extension_prefs|. - scoped_ptr<DictionaryValue> dictionary(new DictionaryValue()); + scoped_ptr<base::DictionaryValue> dictionary(new base::DictionaryValue()); out_value = dictionary.get(); extension_prefs->UpdateExtensionPref( extension_id, @@ -53,14 +53,14 @@ ScopedVector<DeviceInfo> GetAllSignedInDevices( ProfileSyncService* pss, ExtensionPrefs* extension_prefs) { ScopedVector<DeviceInfo> devices = pss->GetAllSignedInDevices(); - const DictionaryValue* mapping_dictionary = GetIdMappingDictionary( + const base::DictionaryValue* mapping_dictionary = GetIdMappingDictionary( extension_prefs, extension_id); CHECK(mapping_dictionary); // |mapping_dictionary| is const. So make an editable copy. - scoped_ptr<DictionaryValue> editable_mapping_dictionary( + scoped_ptr<base::DictionaryValue> editable_mapping_dictionary( mapping_dictionary->DeepCopy()); CreateMappingForUnmappedDevices(&(devices.get()), diff --git a/chrome/browser/extensions/api/socket/socket_api.cc b/chrome/browser/extensions/api/socket/socket_api.cc index cd17a7f..7354a49 100644 --- a/chrome/browser/extensions/api/socket/socket_api.cc +++ b/chrome/browser/extensions/api/socket/socket_api.cc @@ -259,7 +259,7 @@ void SocketDisconnectFunction::Work() { socket->Disconnect(); else error_ = kSocketNotFoundError; - SetResult(Value::CreateNullValue()); + SetResult(base::Value::CreateNullValue()); } bool SocketBindFunction::Prepare() { diff --git a/chrome/browser/extensions/api/storage/setting_sync_data.cc b/chrome/browser/extensions/api/storage/setting_sync_data.cc index 42f72f2..212f5c7 100644 --- a/chrome/browser/extensions/api/storage/setting_sync_data.cc +++ b/chrome/browser/extensions/api/storage/setting_sync_data.cc @@ -46,7 +46,7 @@ void SettingSyncData::InitFromExtensionSettingSpecifics( syncer::SyncChange::SyncChangeType change_type, const sync_pb::ExtensionSettingSpecifics& specifics) { DCHECK(!internal_.get()); - scoped_ptr<Value> value( + scoped_ptr<base::Value> value( base::JSONReader::Read(specifics.value())); if (!value.get()) { LOG(WARNING) << "Specifics for " << specifics.extension_id() << "/" << @@ -64,7 +64,7 @@ SettingSyncData::SettingSyncData( syncer::SyncChange::SyncChangeType change_type, const std::string& extension_id, const std::string& key, - scoped_ptr<Value> value) + scoped_ptr<base::Value> value) : internal_(new Internal(change_type, extension_id, key, value.Pass())) {} SettingSyncData::~SettingSyncData() {} @@ -81,7 +81,7 @@ const std::string& SettingSyncData::key() const { return internal_->key_; } -const Value& SettingSyncData::value() const { +const base::Value& SettingSyncData::value() const { return *internal_->value_; } @@ -89,7 +89,7 @@ SettingSyncData::Internal::Internal( syncer::SyncChange::SyncChangeType change_type, const std::string& extension_id, const std::string& key, - scoped_ptr<Value> value) + scoped_ptr<base::Value> value) : change_type_(change_type), extension_id_(extension_id), key_(key), diff --git a/chrome/browser/extensions/api/storage/setting_sync_data.h b/chrome/browser/extensions/api/storage/setting_sync_data.h index 4cecb23..8fc0f91 100644 --- a/chrome/browser/extensions/api/storage/setting_sync_data.h +++ b/chrome/browser/extensions/api/storage/setting_sync_data.h @@ -35,7 +35,7 @@ class SettingSyncData { syncer::SyncChange::SyncChangeType change_type, const std::string& extension_id, const std::string& key, - scoped_ptr<Value> value); + scoped_ptr<base::Value> value); ~SettingSyncData(); @@ -49,7 +49,7 @@ class SettingSyncData { const std::string& key() const; // Returns the value of the setting. - const Value& value() const; + const base::Value& value() const; private: // Ref-counted container for the data. @@ -60,12 +60,12 @@ class SettingSyncData { syncer::SyncChange::SyncChangeType change_type, const std::string& extension_id, const std::string& key, - scoped_ptr<Value> value); + scoped_ptr<base::Value> value); syncer::SyncChange::SyncChangeType change_type_; std::string extension_id_; std::string key_; - scoped_ptr<Value> value_; + scoped_ptr<base::Value> value_; private: friend class base::RefCountedThreadSafe<Internal>; diff --git a/chrome/browser/extensions/api/storage/settings_apitest.cc b/chrome/browser/extensions/api/storage/settings_apitest.cc index 74be733..146cccd 100644 --- a/chrome/browser/extensions/api/storage/settings_apitest.cc +++ b/chrome/browser/extensions/api/storage/settings_apitest.cc @@ -376,7 +376,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionSettingsApiTest, // Set "foo" to "bar" via sync. syncer::SyncChangeList sync_changes; - StringValue bar("bar"); + base::StringValue bar("bar"); sync_changes.push_back(settings_sync_util::CreateAdd( extension_id, "foo", bar, kModelType)); SendChanges(sync_changes); @@ -421,7 +421,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionSettingsApiTest, // Set "foo" to "bar" via sync. syncer::SyncChangeList sync_changes; - StringValue bar("bar"); + base::StringValue bar("bar"); sync_changes.push_back(settings_sync_util::CreateAdd( extension_id, "foo", bar, kModelType)); SendChanges(sync_changes); diff --git a/chrome/browser/extensions/api/storage/settings_frontend_unittest.cc b/chrome/browser/extensions/api/storage/settings_frontend_unittest.cc index 03027bf..af00571 100644 --- a/chrome/browser/extensions/api/storage/settings_frontend_unittest.cc +++ b/chrome/browser/extensions/api/storage/settings_frontend_unittest.cc @@ -30,21 +30,21 @@ namespace { const ValueStore::WriteOptions DEFAULTS = ValueStore::DEFAULTS; // Creates a kilobyte of data. -scoped_ptr<Value> CreateKilobyte() { +scoped_ptr<base::Value> CreateKilobyte() { std::string kilobyte_string; for (int i = 0; i < 1024; ++i) { kilobyte_string += "a"; } - return scoped_ptr<Value>(new base::StringValue(kilobyte_string)); + return scoped_ptr<base::Value>(new base::StringValue(kilobyte_string)); } // Creates a megabyte of data. -scoped_ptr<Value> CreateMegabyte() { +scoped_ptr<base::Value> CreateMegabyte() { base::ListValue* megabyte = new base::ListValue(); for (int i = 0; i < 1000; ++i) { megabyte->Append(CreateKilobyte().release()); } - return scoped_ptr<Value>(megabyte); + return scoped_ptr<base::Value>(megabyte); } } // namespace @@ -103,7 +103,7 @@ TEST_F(ExtensionSettingsFrontendTest, SettingsPreservedAcrossReconstruction) { // The correctness of Get/Set/Remove/Clear is tested elsewhere so no need to // be too rigorous. { - StringValue bar("bar"); + base::StringValue bar("bar"); ValueStore::WriteResult result = storage->Set(DEFAULTS, "foo", bar); ASSERT_FALSE(result->HasError()); } @@ -134,7 +134,7 @@ TEST_F(ExtensionSettingsFrontendTest, SettingsClearedOnUninstall) { ValueStore* storage = util::GetStorage(id, frontend_.get()); { - StringValue bar("bar"); + base::StringValue bar("bar"); ValueStore::WriteResult result = storage->Set(DEFAULTS, "foo", bar); ASSERT_FALSE(result->HasError()); } @@ -162,7 +162,7 @@ TEST_F(ExtensionSettingsFrontendTest, LeveldbDatabaseDeletedFromDiskOnClear) { ValueStore* storage = util::GetStorage(id, frontend_.get()); { - StringValue bar("bar"); + base::StringValue bar("bar"); ValueStore::WriteResult result = storage->Set(DEFAULTS, "foo", bar); ASSERT_FALSE(result->HasError()); EXPECT_TRUE(base::PathExists(temp_dir_.path())); @@ -199,7 +199,7 @@ TEST_F(ExtensionSettingsFrontendTest, util::GetStorage(id, settings::LOCAL, frontend_.get()); // Sync storage should run out after ~100K. - scoped_ptr<Value> kilobyte = CreateKilobyte(); + scoped_ptr<base::Value> kilobyte = CreateKilobyte(); for (int i = 0; i < 100; ++i) { sync_storage->Set( ValueStore::DEFAULTS, base::StringPrintf("%d", i), *kilobyte); @@ -218,7 +218,7 @@ TEST_F(ExtensionSettingsFrontendTest, ValueStore::DEFAULTS, "WontError", *kilobyte)->HasError()); // Local storage should run out after ~5MB. - scoped_ptr<Value> megabyte = CreateMegabyte(); + scoped_ptr<base::Value> megabyte = CreateMegabyte(); for (int i = 0; i < 5; ++i) { local_storage->Set( ValueStore::DEFAULTS, base::StringPrintf("%d", i), *megabyte); @@ -236,7 +236,7 @@ TEST_F(ExtensionSettingsFrontendTest, static void UnlimitedSyncStorageTestCallback(ValueStore* sync_storage) { // Sync storage should still run out after ~100K; the unlimitedStorage // permission can't apply to sync. - scoped_ptr<Value> kilobyte = CreateKilobyte(); + scoped_ptr<base::Value> kilobyte = CreateKilobyte(); for (int i = 0; i < 100; ++i) { sync_storage->Set( ValueStore::DEFAULTS, base::StringPrintf("%d", i), *kilobyte); @@ -248,7 +248,7 @@ static void UnlimitedSyncStorageTestCallback(ValueStore* sync_storage) { static void UnlimitedLocalStorageTestCallback(ValueStore* local_storage) { // Local storage should never run out. - scoped_ptr<Value> megabyte = CreateMegabyte(); + scoped_ptr<base::Value> megabyte = CreateMegabyte(); for (int i = 0; i < 7; ++i) { local_storage->Set( ValueStore::DEFAULTS, base::StringPrintf("%d", i), *megabyte); diff --git a/chrome/browser/extensions/api/storage/settings_quota_unittest.cc b/chrome/browser/extensions/api/storage/settings_quota_unittest.cc index 7a87a60..48943bb 100644 --- a/chrome/browser/extensions/api/storage/settings_quota_unittest.cc +++ b/chrome/browser/extensions/api/storage/settings_quota_unittest.cc @@ -27,7 +27,7 @@ class ExtensionSettingsQuotaTest : public testing::Test { ExtensionSettingsQuotaTest() : byte_value_1_(new base::FundamentalValue(1)), byte_value_16_(new base::StringValue("sixteen bytes.")), - byte_value_256_(new ListValue()), + byte_value_256_(new base::ListValue()), delegate_(new TestingValueStore()) { for (int i = 1; i < 89; ++i) { byte_value_256_->Append(new base::FundamentalValue(i)); @@ -61,15 +61,15 @@ class ExtensionSettingsQuotaTest : public testing::Test { // Returns whether the settings in |storage_| and |delegate_| are the same as // |settings|. - bool SettingsEqual(const DictionaryValue& settings) { + bool SettingsEqual(const base::DictionaryValue& settings) { return settings.Equals(&storage_->Get()->settings()) && settings.Equals(&delegate_->Get()->settings()); } // Values with different serialized sizes. - scoped_ptr<Value> byte_value_1_; - scoped_ptr<Value> byte_value_16_; - scoped_ptr<ListValue> byte_value_256_; + scoped_ptr<base::Value> byte_value_1_; + scoped_ptr<base::Value> byte_value_16_; + scoped_ptr<base::ListValue> byte_value_256_; // Quota enforcing storage area being tested. scoped_ptr<SettingsStorageQuotaEnforcer> storage_; @@ -79,7 +79,7 @@ class ExtensionSettingsQuotaTest : public testing::Test { }; TEST_F(ExtensionSettingsQuotaTest, ZeroQuotaBytes) { - DictionaryValue empty; + base::DictionaryValue empty; CreateStorage(0, UINT_MAX, UINT_MAX); EXPECT_TRUE(storage_->Set(DEFAULTS, "a", *byte_value_1_)->HasError()); @@ -89,7 +89,7 @@ TEST_F(ExtensionSettingsQuotaTest, ZeroQuotaBytes) { } TEST_F(ExtensionSettingsQuotaTest, KeySizeTakenIntoAccount) { - DictionaryValue empty; + base::DictionaryValue empty; CreateStorage(8u, UINT_MAX, UINT_MAX); EXPECT_TRUE( storage_->Set(DEFAULTS, "Really long key", *byte_value_1_)->HasError()); @@ -97,7 +97,7 @@ TEST_F(ExtensionSettingsQuotaTest, KeySizeTakenIntoAccount) { } TEST_F(ExtensionSettingsQuotaTest, SmallByteQuota) { - DictionaryValue settings; + base::DictionaryValue settings; CreateStorage(8u, UINT_MAX, UINT_MAX); EXPECT_FALSE(storage_->Set(DEFAULTS, "a", *byte_value_1_)->HasError()); @@ -110,10 +110,10 @@ TEST_F(ExtensionSettingsQuotaTest, SmallByteQuota) { } TEST_F(ExtensionSettingsQuotaTest, MediumByteQuota) { - DictionaryValue settings; + base::DictionaryValue settings; CreateStorage(40, UINT_MAX, UINT_MAX); - DictionaryValue to_set; + base::DictionaryValue to_set; to_set.Set("a", byte_value_1_->DeepCopy()); to_set.Set("b", byte_value_16_->DeepCopy()); EXPECT_FALSE(storage_->Set(DEFAULTS, to_set)->HasError()); @@ -132,7 +132,7 @@ TEST_F(ExtensionSettingsQuotaTest, MediumByteQuota) { } TEST_F(ExtensionSettingsQuotaTest, ZeroMaxKeys) { - DictionaryValue empty; + base::DictionaryValue empty; CreateStorage(UINT_MAX, UINT_MAX, 0); EXPECT_TRUE(storage_->Set(DEFAULTS, "a", *byte_value_1_)->HasError()); @@ -142,7 +142,7 @@ TEST_F(ExtensionSettingsQuotaTest, ZeroMaxKeys) { } TEST_F(ExtensionSettingsQuotaTest, SmallMaxKeys) { - DictionaryValue settings; + base::DictionaryValue settings; CreateStorage(UINT_MAX, UINT_MAX, 1); EXPECT_FALSE(storage_->Set(DEFAULTS, "a", *byte_value_1_)->HasError()); @@ -160,10 +160,10 @@ TEST_F(ExtensionSettingsQuotaTest, SmallMaxKeys) { } TEST_F(ExtensionSettingsQuotaTest, MediumMaxKeys) { - DictionaryValue settings; + base::DictionaryValue settings; CreateStorage(UINT_MAX, UINT_MAX, 2); - DictionaryValue to_set; + base::DictionaryValue to_set; to_set.Set("a", byte_value_1_->DeepCopy()); to_set.Set("b", byte_value_16_->DeepCopy()); EXPECT_FALSE(storage_->Set(DEFAULTS, to_set)->HasError()); @@ -183,7 +183,7 @@ TEST_F(ExtensionSettingsQuotaTest, MediumMaxKeys) { } TEST_F(ExtensionSettingsQuotaTest, RemovingExistingSettings) { - DictionaryValue settings; + base::DictionaryValue settings; CreateStorage(266, UINT_MAX, 2); storage_->Set(DEFAULTS, "b", *byte_value_16_); @@ -216,11 +216,11 @@ TEST_F(ExtensionSettingsQuotaTest, RemovingExistingSettings) { } TEST_F(ExtensionSettingsQuotaTest, RemovingNonexistentSettings) { - DictionaryValue settings; + base::DictionaryValue settings; CreateStorage(36, UINT_MAX, 3); // Max out bytes. - DictionaryValue to_set; + base::DictionaryValue to_set; to_set.Set("b1", byte_value_16_->DeepCopy()); to_set.Set("b2", byte_value_16_->DeepCopy()); storage_->Set(DEFAULTS, to_set); @@ -266,12 +266,12 @@ TEST_F(ExtensionSettingsQuotaTest, RemovingNonexistentSettings) { } TEST_F(ExtensionSettingsQuotaTest, Clear) { - DictionaryValue settings; + base::DictionaryValue settings; CreateStorage(40, UINT_MAX, 5); // Test running out of byte quota. { - DictionaryValue to_set; + base::DictionaryValue to_set; to_set.Set("a", byte_value_16_->DeepCopy()); to_set.Set("b", byte_value_16_->DeepCopy()); EXPECT_FALSE(storage_->Set(DEFAULTS, to_set)->HasError()); @@ -287,7 +287,7 @@ TEST_F(ExtensionSettingsQuotaTest, Clear) { // Test reaching max keys. storage_->Clear(); { - DictionaryValue to_set; + base::DictionaryValue to_set; to_set.Set("a", byte_value_1_->DeepCopy()); to_set.Set("b", byte_value_1_->DeepCopy()); to_set.Set("c", byte_value_1_->DeepCopy()); @@ -305,7 +305,7 @@ TEST_F(ExtensionSettingsQuotaTest, Clear) { } TEST_F(ExtensionSettingsQuotaTest, ChangingUsedBytesWithSet) { - DictionaryValue settings; + base::DictionaryValue settings; CreateStorage(20, UINT_MAX, UINT_MAX); // Change a setting to make it go over quota. @@ -327,14 +327,14 @@ TEST_F(ExtensionSettingsQuotaTest, ChangingUsedBytesWithSet) { } TEST_F(ExtensionSettingsQuotaTest, SetsOnlyEntirelyCompletedWithByteQuota) { - DictionaryValue settings; + base::DictionaryValue settings; CreateStorage(40, UINT_MAX, UINT_MAX); storage_->Set(DEFAULTS, "a", *byte_value_16_); settings.Set("a", byte_value_16_->DeepCopy()); // The entire change is over quota. - DictionaryValue to_set; + base::DictionaryValue to_set; to_set.Set("b", byte_value_16_->DeepCopy()); to_set.Set("c", byte_value_16_->DeepCopy()); EXPECT_TRUE(storage_->Set(DEFAULTS, to_set)->HasError()); @@ -350,13 +350,13 @@ TEST_F(ExtensionSettingsQuotaTest, SetsOnlyEntirelyCompletedWithByteQuota) { } TEST_F(ExtensionSettingsQuotaTest, SetsOnlyEntireCompletedWithMaxKeys) { - DictionaryValue settings; + base::DictionaryValue settings; CreateStorage(UINT_MAX, UINT_MAX, 2); storage_->Set(DEFAULTS, "a", *byte_value_1_); settings.Set("a", byte_value_1_->DeepCopy()); - DictionaryValue to_set; + base::DictionaryValue to_set; to_set.Set("b", byte_value_16_->DeepCopy()); to_set.Set("c", byte_value_16_->DeepCopy()); EXPECT_TRUE(storage_->Set(DEFAULTS, to_set)->HasError()); @@ -364,7 +364,7 @@ TEST_F(ExtensionSettingsQuotaTest, SetsOnlyEntireCompletedWithMaxKeys) { } TEST_F(ExtensionSettingsQuotaTest, WithInitialDataAndByteQuota) { - DictionaryValue settings; + base::DictionaryValue settings; delegate_->Set(DEFAULTS, "a", *byte_value_256_); settings.Set("a", byte_value_256_->DeepCopy()); @@ -406,7 +406,7 @@ TEST_F(ExtensionSettingsQuotaTest, WithInitialDataAndByteQuota) { } TEST_F(ExtensionSettingsQuotaTest, WithInitialDataAndMaxKeys) { - DictionaryValue settings; + base::DictionaryValue settings; delegate_->Set(DEFAULTS, "a", *byte_value_1_); settings.Set("a", byte_value_1_->DeepCopy()); CreateStorage(UINT_MAX, UINT_MAX, 2); @@ -420,7 +420,7 @@ TEST_F(ExtensionSettingsQuotaTest, WithInitialDataAndMaxKeys) { } TEST_F(ExtensionSettingsQuotaTest, InitiallyOverByteQuota) { - DictionaryValue settings; + base::DictionaryValue settings; settings.Set("a", byte_value_16_->DeepCopy()); settings.Set("b", byte_value_16_->DeepCopy()); settings.Set("c", byte_value_16_->DeepCopy()); @@ -443,7 +443,7 @@ TEST_F(ExtensionSettingsQuotaTest, InitiallyOverByteQuota) { } TEST_F(ExtensionSettingsQuotaTest, InitiallyOverMaxKeys) { - DictionaryValue settings; + base::DictionaryValue settings; settings.Set("a", byte_value_16_->DeepCopy()); settings.Set("b", byte_value_16_->DeepCopy()); settings.Set("c", byte_value_16_->DeepCopy()); @@ -475,7 +475,7 @@ TEST_F(ExtensionSettingsQuotaTest, InitiallyOverMaxKeys) { } TEST_F(ExtensionSettingsQuotaTest, ZeroQuotaBytesPerSetting) { - DictionaryValue empty; + base::DictionaryValue empty; CreateStorage(UINT_MAX, 0, UINT_MAX); EXPECT_TRUE(storage_->Set(DEFAULTS, "a", *byte_value_1_)->HasError()); @@ -485,7 +485,7 @@ TEST_F(ExtensionSettingsQuotaTest, ZeroQuotaBytesPerSetting) { } TEST_F(ExtensionSettingsQuotaTest, QuotaBytesPerSetting) { - DictionaryValue settings; + base::DictionaryValue settings; CreateStorage(UINT_MAX, 20, UINT_MAX); @@ -503,7 +503,7 @@ TEST_F(ExtensionSettingsQuotaTest, QuotaBytesPerSetting) { } TEST_F(ExtensionSettingsQuotaTest, QuotaBytesPerSettingWithInitialSettings) { - DictionaryValue settings; + base::DictionaryValue settings; delegate_->Set(DEFAULTS, "a", *byte_value_1_); delegate_->Set(DEFAULTS, "b", *byte_value_16_); @@ -533,7 +533,7 @@ TEST_F(ExtensionSettingsQuotaTest, // This is a lazy test to make sure IGNORE_QUOTA lets through changes: the // test above copied, but using IGNORE_QUOTA and asserting nothing is ever // rejected... - DictionaryValue settings; + base::DictionaryValue settings; delegate_->Set(DEFAULTS, "a", *byte_value_1_); delegate_->Set(DEFAULTS, "b", *byte_value_16_); diff --git a/chrome/browser/extensions/api/storage/settings_storage_quota_enforcer.cc b/chrome/browser/extensions/api/storage/settings_storage_quota_enforcer.cc index 6961cb9..25162d5 100644 --- a/chrome/browser/extensions/api/storage/settings_storage_quota_enforcer.cc +++ b/chrome/browser/extensions/api/storage/settings_storage_quota_enforcer.cc @@ -29,7 +29,7 @@ enum Resource { // Allocates a setting in a record of total and per-setting usage. void Allocate( const std::string& key, - const Value& value, + const base::Value& value, size_t* used_total, std::map<std::string, size_t>* used_per_setting) { // Calculate the setting size based on its JSON serialization size. @@ -139,7 +139,7 @@ ValueStore::ReadResult SettingsStorageQuotaEnforcer::Get() { } ValueStore::WriteResult SettingsStorageQuotaEnforcer::Set( - WriteOptions options, const std::string& key, const Value& value) { + WriteOptions options, const std::string& key, const base::Value& value) { size_t new_used_total = used_total_; std::map<std::string, size_t> new_used_per_setting = used_per_setting_; Allocate(key, value, &new_used_total, &new_used_per_setting); diff --git a/chrome/browser/extensions/api/storage/settings_storage_quota_enforcer.h b/chrome/browser/extensions/api/storage/settings_storage_quota_enforcer.h index 7db793e..f8283d3 100644 --- a/chrome/browser/extensions/api/storage/settings_storage_quota_enforcer.h +++ b/chrome/browser/extensions/api/storage/settings_storage_quota_enforcer.h @@ -40,7 +40,7 @@ class SettingsStorageQuotaEnforcer : public ValueStore { virtual WriteResult Set( WriteOptions options, const std::string& key, - const Value& value) OVERRIDE; + const base::Value& value) OVERRIDE; virtual WriteResult Set( WriteOptions options, const base::DictionaryValue& values) OVERRIDE; virtual WriteResult Remove(const std::string& key) OVERRIDE; diff --git a/chrome/browser/extensions/api/storage/settings_sync_processor.cc b/chrome/browser/extensions/api/storage/settings_sync_processor.cc index b016e9e..ef815c1 100644 --- a/chrome/browser/extensions/api/storage/settings_sync_processor.cc +++ b/chrome/browser/extensions/api/storage/settings_sync_processor.cc @@ -54,7 +54,7 @@ syncer::SyncError SettingsSyncProcessor::SendChanges( for (ValueStoreChangeList::const_iterator i = changes.begin(); i != changes.end(); ++i) { const std::string& key = i->key(); - const Value* value = i->new_value(); + const base::Value* value = i->new_value(); if (value) { if (synced_keys_.count(key)) { // New value, key is synced; send ACTION_UPDATE. diff --git a/chrome/browser/extensions/api/storage/settings_sync_unittest.cc b/chrome/browser/extensions/api/storage/settings_sync_unittest.cc index 3f42000..7311b3e 100644 --- a/chrome/browser/extensions/api/storage/settings_sync_unittest.cc +++ b/chrome/browser/extensions/api/storage/settings_sync_unittest.cc @@ -39,7 +39,7 @@ namespace { const ValueStore::WriteOptions DEFAULTS = ValueStore::DEFAULTS; // Gets the pretty-printed JSON for a value. -static std::string GetJson(const Value& value) { +static std::string GetJson(const base::Value& value) { std::string json; base::JSONWriter::WriteWithOptions(&value, base::JSONWriter::OPTIONS_PRETTY_PRINT, @@ -50,8 +50,8 @@ static std::string GetJson(const Value& value) { // Returns whether two Values are equal. testing::AssertionResult ValuesEq( const char* _1, const char* _2, - const Value* expected, - const Value* actual) { + const base::Value* expected, + const base::Value* actual) { if (expected == actual) { return testing::AssertionSuccess(); } @@ -74,7 +74,7 @@ testing::AssertionResult ValuesEq( // Logs when different. testing::AssertionResult SettingsEq( const char* _1, const char* _2, - const DictionaryValue& expected, + const base::DictionaryValue& expected, ValueStore::ReadResult actual) { if (actual->HasError()) { return testing::AssertionFailure() << @@ -142,7 +142,8 @@ class MockSyncChangeProcessor : public syncer::SyncChangeProcessor { return SettingSyncData(syncer::SyncChange::ACTION_INVALID, std::string(), std::string(), - scoped_ptr<Value>(new DictionaryValue())); + scoped_ptr<base::Value>( + new base::DictionaryValue())); } if (matching_changes.size() != 1u) { ADD_FAILURE() << matching_changes.size() << " matching changes for " << @@ -315,8 +316,8 @@ TEST_F(ExtensionSettingsSyncTest, InSyncDataDoesNotInvokeSync) { syncer::ModelType model_type = syncer::APP_SETTINGS; Manifest::Type type = Manifest::TYPE_LEGACY_PACKAGED_APP; - StringValue value1("fooValue"); - ListValue value2; + base::StringValue value1("fooValue"); + base::ListValue value2; value2.Append(new base::StringValue("barValue")); ValueStore* storage1 = AddExtensionAndGetStorage("s1", type); @@ -365,8 +366,8 @@ TEST_F(ExtensionSettingsSyncTest, LocalDataWithNoSyncDataIsPushedToSync) { syncer::ModelType model_type = syncer::EXTENSION_SETTINGS; Manifest::Type type = Manifest::TYPE_EXTENSION; - StringValue value1("fooValue"); - ListValue value2; + base::StringValue value1("fooValue"); + base::ListValue value2; value2.Append(new base::StringValue("barValue")); ValueStore* storage1 = AddExtensionAndGetStorage("s1", type); @@ -397,13 +398,13 @@ TEST_F(ExtensionSettingsSyncTest, AnySyncDataOverwritesLocalData) { syncer::ModelType model_type = syncer::APP_SETTINGS; Manifest::Type type = Manifest::TYPE_LEGACY_PACKAGED_APP; - StringValue value1("fooValue"); - ListValue value2; + base::StringValue value1("fooValue"); + base::ListValue value2; value2.Append(new base::StringValue("barValue")); // Maintain dictionaries mirrored to the expected values of the settings in // each storage area. - DictionaryValue expected1, expected2; + base::DictionaryValue expected1, expected2; // Pre-populate one of the storage areas. ValueStore* storage1 = AddExtensionAndGetStorage("s1", type); @@ -437,13 +438,13 @@ TEST_F(ExtensionSettingsSyncTest, ProcessSyncChanges) { syncer::ModelType model_type = syncer::EXTENSION_SETTINGS; Manifest::Type type = Manifest::TYPE_EXTENSION; - StringValue value1("fooValue"); - ListValue value2; + base::StringValue value1("fooValue"); + base::ListValue value2; value2.Append(new base::StringValue("barValue")); // Maintain dictionaries mirrored to the expected values of the settings in // each storage area. - DictionaryValue expected1, expected2; + base::DictionaryValue expected1, expected2; // Make storage1 initialised from local data, storage2 initialised from sync. ValueStore* storage1 = AddExtensionAndGetStorage("s1", type); @@ -510,8 +511,8 @@ TEST_F(ExtensionSettingsSyncTest, PushToSync) { syncer::ModelType model_type = syncer::APP_SETTINGS; Manifest::Type type = Manifest::TYPE_LEGACY_PACKAGED_APP; - StringValue value1("fooValue"); - ListValue value2; + base::StringValue value1("fooValue"); + base::ListValue value2; value2.Append(new base::StringValue("barValue")); // Make storage1/2 initialised from local data, storage3/4 initialised from @@ -649,8 +650,8 @@ TEST_F(ExtensionSettingsSyncTest, PushToSync) { } TEST_F(ExtensionSettingsSyncTest, ExtensionAndAppSettingsSyncSeparately) { - StringValue value1("fooValue"); - ListValue value2; + base::StringValue value1("fooValue"); + base::ListValue value2; value2.Append(new base::StringValue("barValue")); // storage1 is an extension, storage2 is an app. @@ -708,8 +709,8 @@ TEST_F(ExtensionSettingsSyncTest, FailingStartSyncingDisablesSync) { syncer::ModelType model_type = syncer::EXTENSION_SETTINGS; Manifest::Type type = Manifest::TYPE_EXTENSION; - StringValue fooValue("fooValue"); - StringValue barValue("barValue"); + base::StringValue fooValue("fooValue"); + base::StringValue barValue("barValue"); // There is a bit of a convoluted method to get storage areas that can fail; // hand out TestingValueStore object then toggle them failing/succeeding @@ -738,12 +739,12 @@ TEST_F(ExtensionSettingsSyncTest, FailingStartSyncingDisablesSync) { testing_factory->GetExisting("bad")->set_error_code(ValueStore::OK); { - DictionaryValue dict; + base::DictionaryValue dict; dict.Set("foo", fooValue.DeepCopy()); EXPECT_PRED_FORMAT2(SettingsEq, dict, good->Get()); } { - DictionaryValue dict; + base::DictionaryValue dict; EXPECT_PRED_FORMAT2(SettingsEq, dict, bad->Get()); } @@ -758,13 +759,13 @@ TEST_F(ExtensionSettingsSyncTest, FailingStartSyncingDisablesSync) { EXPECT_EQ(1u, sync_processor_->changes().size()); { - DictionaryValue dict; + base::DictionaryValue dict; dict.Set("foo", fooValue.DeepCopy()); dict.Set("bar", barValue.DeepCopy()); EXPECT_PRED_FORMAT2(SettingsEq, dict, good->Get()); } { - DictionaryValue dict; + base::DictionaryValue dict; dict.Set("bar", barValue.DeepCopy()); EXPECT_PRED_FORMAT2(SettingsEq, dict, bad->Get()); } @@ -783,13 +784,13 @@ TEST_F(ExtensionSettingsSyncTest, FailingStartSyncingDisablesSync) { } { - DictionaryValue dict; + base::DictionaryValue dict; dict.Set("foo", barValue.DeepCopy()); dict.Set("bar", barValue.DeepCopy()); EXPECT_PRED_FORMAT2(SettingsEq, dict, good->Get()); } { - DictionaryValue dict; + base::DictionaryValue dict; dict.Set("bar", barValue.DeepCopy()); EXPECT_PRED_FORMAT2(SettingsEq, dict, bad->Get()); } @@ -806,13 +807,13 @@ TEST_F(ExtensionSettingsSyncTest, FailingStartSyncingDisablesSync) { EXPECT_EQ(1u, sync_processor_->changes().size()); { - DictionaryValue dict; + base::DictionaryValue dict; dict.Set("foo", barValue.DeepCopy()); dict.Set("bar", fooValue.DeepCopy()); EXPECT_PRED_FORMAT2(SettingsEq, dict, good->Get()); } { - DictionaryValue dict; + base::DictionaryValue dict; dict.Set("bar", fooValue.DeepCopy()); EXPECT_PRED_FORMAT2(SettingsEq, dict, bad->Get()); } @@ -831,13 +832,13 @@ TEST_F(ExtensionSettingsSyncTest, FailingStartSyncingDisablesSync) { testing_factory->GetExisting("bad")->set_error_code(ValueStore::OK); { - DictionaryValue dict; + base::DictionaryValue dict; dict.Set("foo", fooValue.DeepCopy()); dict.Set("bar", fooValue.DeepCopy()); EXPECT_PRED_FORMAT2(SettingsEq, dict, good->Get()); } { - DictionaryValue dict; + base::DictionaryValue dict; dict.Set("bar", fooValue.DeepCopy()); EXPECT_PRED_FORMAT2(SettingsEq, dict, bad->Get()); } @@ -890,13 +891,13 @@ TEST_F(ExtensionSettingsSyncTest, FailingStartSyncingDisablesSync) { } { - DictionaryValue dict; + base::DictionaryValue dict; dict.Set("foo", fooValue.DeepCopy()); dict.Set("bar", fooValue.DeepCopy()); EXPECT_PRED_FORMAT2(SettingsEq, dict, good->Get()); } { - DictionaryValue dict; + base::DictionaryValue dict; dict.Set("bar", fooValue.DeepCopy()); EXPECT_PRED_FORMAT2(SettingsEq, dict, bad->Get()); } @@ -908,8 +909,8 @@ TEST_F(ExtensionSettingsSyncTest, FailingProcessChangesDisablesSync) { syncer::ModelType model_type = syncer::APP_SETTINGS; Manifest::Type type = Manifest::TYPE_LEGACY_PACKAGED_APP; - StringValue fooValue("fooValue"); - StringValue barValue("barValue"); + base::StringValue fooValue("fooValue"); + base::StringValue barValue("barValue"); TestingValueStoreFactory* testing_factory = new TestingValueStoreFactory(); storage_factory_->Reset(testing_factory); @@ -935,12 +936,12 @@ TEST_F(ExtensionSettingsSyncTest, FailingProcessChangesDisablesSync) { EXPECT_EQ(0u, sync_processor_->changes().size()); { - DictionaryValue dict; + base::DictionaryValue dict; dict.Set("foo", fooValue.DeepCopy()); EXPECT_PRED_FORMAT2(SettingsEq, dict, good->Get()); } { - DictionaryValue dict; + base::DictionaryValue dict; dict.Set("foo", fooValue.DeepCopy()); EXPECT_PRED_FORMAT2(SettingsEq, dict, bad->Get()); } @@ -958,13 +959,13 @@ TEST_F(ExtensionSettingsSyncTest, FailingProcessChangesDisablesSync) { testing_factory->GetExisting("bad")->set_error_code(ValueStore::OK); { - DictionaryValue dict; + base::DictionaryValue dict; dict.Set("foo", fooValue.DeepCopy()); dict.Set("bar", barValue.DeepCopy()); EXPECT_PRED_FORMAT2(SettingsEq, dict, good->Get()); } { - DictionaryValue dict; + base::DictionaryValue dict; dict.Set("foo", fooValue.DeepCopy()); EXPECT_PRED_FORMAT2(SettingsEq, dict, bad->Get()); } @@ -990,13 +991,13 @@ TEST_F(ExtensionSettingsSyncTest, FailingProcessChangesDisablesSync) { } { - DictionaryValue dict; + base::DictionaryValue dict; dict.Set("foo", fooValue.DeepCopy()); dict.Set("bar", barValue.DeepCopy()); EXPECT_PRED_FORMAT2(SettingsEq, dict, good->Get()); } { - DictionaryValue dict; + base::DictionaryValue dict; dict.Set("foo", barValue.DeepCopy()); EXPECT_PRED_FORMAT2(SettingsEq, dict, bad->Get()); } @@ -1006,8 +1007,8 @@ TEST_F(ExtensionSettingsSyncTest, FailingGetAllSyncDataDoesntStopSync) { syncer::ModelType model_type = syncer::EXTENSION_SETTINGS; Manifest::Type type = Manifest::TYPE_EXTENSION; - StringValue fooValue("fooValue"); - StringValue barValue("barValue"); + base::StringValue fooValue("fooValue"); + base::StringValue barValue("barValue"); TestingValueStoreFactory* testing_factory = new TestingValueStoreFactory(); storage_factory_->Reset(testing_factory); @@ -1061,8 +1062,8 @@ TEST_F(ExtensionSettingsSyncTest, FailureToReadChangesToPushDisablesSync) { syncer::ModelType model_type = syncer::APP_SETTINGS; Manifest::Type type = Manifest::TYPE_LEGACY_PACKAGED_APP; - StringValue fooValue("fooValue"); - StringValue barValue("barValue"); + base::StringValue fooValue("fooValue"); + base::StringValue barValue("barValue"); TestingValueStoreFactory* testing_factory = new TestingValueStoreFactory(); storage_factory_->Reset(testing_factory); @@ -1110,13 +1111,13 @@ TEST_F(ExtensionSettingsSyncTest, FailureToReadChangesToPushDisablesSync) { } { - DictionaryValue dict; + base::DictionaryValue dict; dict.Set("foo", barValue.DeepCopy()); dict.Set("bar", barValue.DeepCopy()); EXPECT_PRED_FORMAT2(SettingsEq, dict, good->Get()); } { - DictionaryValue dict; + base::DictionaryValue dict; dict.Set("foo", fooValue.DeepCopy()); dict.Set("bar", barValue.DeepCopy()); EXPECT_PRED_FORMAT2(SettingsEq, dict, bad->Get()); @@ -1165,8 +1166,8 @@ TEST_F(ExtensionSettingsSyncTest, FailureToPushLocalStateDisablesSync) { syncer::ModelType model_type = syncer::EXTENSION_SETTINGS; Manifest::Type type = Manifest::TYPE_EXTENSION; - StringValue fooValue("fooValue"); - StringValue barValue("barValue"); + base::StringValue fooValue("fooValue"); + base::StringValue barValue("barValue"); TestingValueStoreFactory* testing_factory = new TestingValueStoreFactory(); storage_factory_->Reset(testing_factory); @@ -1206,13 +1207,13 @@ TEST_F(ExtensionSettingsSyncTest, FailureToPushLocalStateDisablesSync) { } { - DictionaryValue dict; + base::DictionaryValue dict; dict.Set("foo", barValue.DeepCopy()); dict.Set("bar", barValue.DeepCopy()); EXPECT_PRED_FORMAT2(SettingsEq, dict, good->Get()); } { - DictionaryValue dict; + base::DictionaryValue dict; dict.Set("foo", barValue.DeepCopy()); EXPECT_PRED_FORMAT2(SettingsEq, dict, bad->Get()); } @@ -1256,8 +1257,8 @@ TEST_F(ExtensionSettingsSyncTest, FailureToPushLocalChangeDisablesSync) { syncer::ModelType model_type = syncer::EXTENSION_SETTINGS; Manifest::Type type = Manifest::TYPE_EXTENSION; - StringValue fooValue("fooValue"); - StringValue barValue("barValue"); + base::StringValue fooValue("fooValue"); + base::StringValue barValue("barValue"); TestingValueStoreFactory* testing_factory = new TestingValueStoreFactory(); storage_factory_->Reset(testing_factory); @@ -1303,13 +1304,13 @@ TEST_F(ExtensionSettingsSyncTest, FailureToPushLocalChangeDisablesSync) { } { - DictionaryValue dict; + base::DictionaryValue dict; dict.Set("foo", barValue.DeepCopy()); dict.Set("bar", barValue.DeepCopy()); EXPECT_PRED_FORMAT2(SettingsEq, dict, good->Get()); } { - DictionaryValue dict; + base::DictionaryValue dict; dict.Set("foo", barValue.DeepCopy()); EXPECT_PRED_FORMAT2(SettingsEq, dict, bad->Get()); } @@ -1359,7 +1360,7 @@ TEST_F(ExtensionSettingsSyncTest, for (size_t i = 0; i < 5000; ++i) { string_5k.append("a"); } - StringValue large_value(string_5k); + base::StringValue large_value(string_5k); GetSyncableService(model_type)->MergeDataAndStartSyncing( model_type, @@ -1383,7 +1384,7 @@ TEST_F(ExtensionSettingsSyncTest, GetSyncableService(model_type)->ProcessSyncChanges(FROM_HERE, change_list); } { - DictionaryValue expected; + base::DictionaryValue expected; expected.Set("large_value", large_value.DeepCopy()); EXPECT_PRED_FORMAT2(SettingsEq, expected, storage1->Get()); EXPECT_PRED_FORMAT2(SettingsEq, expected, storage2->Get()); @@ -1400,7 +1401,7 @@ TEST_F(ExtensionSettingsSyncTest, Dots) { { syncer::SyncDataList sync_data_list; - scoped_ptr<Value> string_value(new base::StringValue("value")); + scoped_ptr<base::Value> string_value(new base::StringValue("value")); sync_data_list.push_back(settings_sync_util::CreateData( "ext", "key.with.dot", *string_value, model_type)); @@ -1417,16 +1418,16 @@ TEST_F(ExtensionSettingsSyncTest, Dots) { ValueStore::ReadResult data = storage->Get(); ASSERT_FALSE(data->HasError()); - DictionaryValue expected_data; + base::DictionaryValue expected_data; expected_data.SetWithoutPathExpansion( "key.with.dot", new base::StringValue("value")); - EXPECT_TRUE(Value::Equals(&expected_data, &data->settings())); + EXPECT_TRUE(base::Value::Equals(&expected_data, &data->settings())); } // Test dots in keys going to sync. { - scoped_ptr<Value> string_value(new base::StringValue("spot")); + scoped_ptr<base::Value> string_value(new base::StringValue("spot")); storage->Set(DEFAULTS, "key.with.spot", *string_value); ASSERT_EQ(1u, sync_processor_->changes().size()); diff --git a/chrome/browser/extensions/api/storage/settings_sync_util.cc b/chrome/browser/extensions/api/storage/settings_sync_util.cc index 4509ee9..b974aa3 100644 --- a/chrome/browser/extensions/api/storage/settings_sync_util.cc +++ b/chrome/browser/extensions/api/storage/settings_sync_util.cc @@ -19,7 +19,7 @@ namespace { void PopulateExtensionSettingSpecifics( const std::string& extension_id, const std::string& key, - const Value& value, + const base::Value& value, sync_pb::ExtensionSettingSpecifics* specifics) { specifics->set_extension_id(extension_id); specifics->set_key(key); @@ -33,7 +33,7 @@ void PopulateExtensionSettingSpecifics( void PopulateAppSettingSpecifics( const std::string& extension_id, const std::string& key, - const Value& value, + const base::Value& value, sync_pb::AppSettingSpecifics* specifics) { PopulateExtensionSettingSpecifics( extension_id, key, value, specifics->mutable_extension_setting()); @@ -44,7 +44,7 @@ void PopulateAppSettingSpecifics( syncer::SyncData CreateData( const std::string& extension_id, const std::string& key, - const Value& value, + const base::Value& value, syncer::ModelType type) { sync_pb::EntitySpecifics specifics; switch (type) { @@ -75,7 +75,7 @@ syncer::SyncData CreateData( syncer::SyncChange CreateAdd( const std::string& extension_id, const std::string& key, - const Value& value, + const base::Value& value, syncer::ModelType type) { return syncer::SyncChange( FROM_HERE, @@ -86,7 +86,7 @@ syncer::SyncChange CreateAdd( syncer::SyncChange CreateUpdate( const std::string& extension_id, const std::string& key, - const Value& value, + const base::Value& value, syncer::ModelType type) { return syncer::SyncChange( FROM_HERE, diff --git a/chrome/browser/extensions/api/storage/syncable_settings_storage.cc b/chrome/browser/extensions/api/storage/syncable_settings_storage.cc index fbfa0786..5c4b13e 100644 --- a/chrome/browser/extensions/api/storage/syncable_settings_storage.cc +++ b/chrome/browser/extensions/api/storage/syncable_settings_storage.cc @@ -65,7 +65,7 @@ ValueStore::ReadResult SyncableSettingsStorage::Get() { } ValueStore::WriteResult SyncableSettingsStorage::Set( - WriteOptions options, const std::string& key, const Value& value) { + WriteOptions options, const std::string& key, const base::Value& value) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); WriteResult result = delegate_->Set(options, key, value); if (result->HasError()) { @@ -182,8 +182,9 @@ syncer::SyncError SyncableSettingsStorage::OverwriteLocalSettingsWithSync( scoped_ptr<base::DictionaryValue> new_sync_state(sync_state.DeepCopy()); SettingSyncDataList changes; - for (base::DictionaryValue::Iterator it(settings); !it.IsAtEnd(); it.Advance()) { - scoped_ptr<Value> sync_value; + for (base::DictionaryValue::Iterator it(settings); + !it.IsAtEnd(); it.Advance()) { + scoped_ptr<base::Value> sync_value; if (new_sync_state->RemoveWithoutPathExpansion(it.key(), &sync_value)) { if (sync_value->Equals(&it.value())) { // Sync and local values are the same, no changes to send. @@ -203,7 +204,7 @@ syncer::SyncError SyncableSettingsStorage::OverwriteLocalSettingsWithSync( syncer::SyncChange::ACTION_DELETE, extension_id_, it.key(), - scoped_ptr<Value>(new base::DictionaryValue()))); + scoped_ptr<base::Value>(new base::DictionaryValue()))); } } @@ -211,7 +212,7 @@ syncer::SyncError SyncableSettingsStorage::OverwriteLocalSettingsWithSync( while (!new_sync_state->empty()) { base::DictionaryValue::Iterator first_entry(*new_sync_state); std::string key = first_entry.key(); - scoped_ptr<Value> value; + scoped_ptr<base::Value> value; CHECK(new_sync_state->RemoveWithoutPathExpansion(key, &value)); changes.push_back( SettingSyncData( @@ -253,9 +254,9 @@ syncer::SyncError SyncableSettingsStorage::ProcessSyncChanges( DCHECK_EQ(extension_id_, it->extension_id()); const std::string& key = it->key(); - const Value& value = it->value(); + const base::Value& value = it->value(); - scoped_ptr<Value> current_value; + scoped_ptr<base::Value> current_value; { ReadResult maybe_settings = Get(it->key()); if (maybe_settings->HasError()) { @@ -333,7 +334,7 @@ syncer::SyncError SyncableSettingsStorage::ProcessSyncChanges( syncer::SyncError SyncableSettingsStorage::OnSyncAdd( const std::string& key, - Value* new_value, + base::Value* new_value, ValueStoreChangeList* changes) { DCHECK(new_value); WriteResult result = delegate_->Set(IGNORE_QUOTA, key, *new_value); @@ -351,8 +352,8 @@ syncer::SyncError SyncableSettingsStorage::OnSyncAdd( syncer::SyncError SyncableSettingsStorage::OnSyncUpdate( const std::string& key, - Value* old_value, - Value* new_value, + base::Value* old_value, + base::Value* new_value, ValueStoreChangeList* changes) { DCHECK(old_value); DCHECK(new_value); @@ -371,7 +372,7 @@ syncer::SyncError SyncableSettingsStorage::OnSyncUpdate( syncer::SyncError SyncableSettingsStorage::OnSyncDelete( const std::string& key, - Value* old_value, + base::Value* old_value, ValueStoreChangeList* changes) { DCHECK(old_value); WriteResult result = delegate_->Remove(key); diff --git a/chrome/browser/extensions/api/storage/syncable_settings_storage.h b/chrome/browser/extensions/api/storage/syncable_settings_storage.h index d971ef0..bffc829 100644 --- a/chrome/browser/extensions/api/storage/syncable_settings_storage.h +++ b/chrome/browser/extensions/api/storage/syncable_settings_storage.h @@ -41,7 +41,7 @@ class SyncableSettingsStorage : public ValueStore { virtual WriteResult Set( WriteOptions options, const std::string& key, - const Value& value) OVERRIDE; + const base::Value& value) OVERRIDE; virtual WriteResult Set( WriteOptions options, const base::DictionaryValue& values) OVERRIDE; virtual WriteResult Remove(const std::string& key) OVERRIDE; @@ -80,16 +80,16 @@ class SyncableSettingsStorage : public ValueStore { // are taken. syncer::SyncError OnSyncAdd( const std::string& key, - Value* new_value, + base::Value* new_value, ValueStoreChangeList* changes); syncer::SyncError OnSyncUpdate( const std::string& key, - Value* old_value, - Value* new_value, + base::Value* old_value, + base::Value* new_value, ValueStoreChangeList* changes); syncer::SyncError OnSyncDelete( const std::string& key, - Value* old_value, + base::Value* old_value, ValueStoreChangeList* changes); // List of observers to settings changes. diff --git a/chrome/browser/extensions/api/storage/weak_unlimited_settings_storage.h b/chrome/browser/extensions/api/storage/weak_unlimited_settings_storage.h index 66a4002..ca95324 100644 --- a/chrome/browser/extensions/api/storage/weak_unlimited_settings_storage.h +++ b/chrome/browser/extensions/api/storage/weak_unlimited_settings_storage.h @@ -30,7 +30,7 @@ class WeakUnlimitedSettingsStorage : public ValueStore { virtual WriteResult Set( WriteOptions options, const std::string& key, - const Value& value) OVERRIDE; + const base::Value& value) OVERRIDE; virtual WriteResult Set( WriteOptions options, const base::DictionaryValue& values) OVERRIDE; virtual WriteResult Remove(const std::string& key) OVERRIDE; diff --git a/chrome/browser/extensions/api/tabs/tabs_api.cc b/chrome/browser/extensions/api/tabs/tabs_api.cc index bcf5615..541ef9d 100644 --- a/chrome/browser/extensions/api/tabs/tabs_api.cc +++ b/chrome/browser/extensions/api/tabs/tabs_api.cc @@ -618,7 +618,7 @@ bool WindowsCreateFunction::RunImpl() { !GetProfile()->IsOffTheRecord() && !include_incognito()) { // Don't expose incognito windows if extension itself works in non-incognito // profile and CanCrossIncognito isn't allowed. - SetResult(Value::CreateNullValue()); + SetResult(base::Value::CreateNullValue()); } else { SetResult( new_window->extension_window_controller()->CreateWindowValueWithTabs( @@ -1449,7 +1449,7 @@ bool TabsMoveFunction::RunImpl() { if (num_tabs > 1) { SetResult(tab_values.DeepCopy()); } else { - Value* value = NULL; + base::Value* value = NULL; CHECK(tab_values.Get(0, &value)); SetResult(value->DeepCopy()); } diff --git a/chrome/browser/extensions/api/tabs/tabs_event_router.cc b/chrome/browser/extensions/api/tabs/tabs_event_router.cc index eef304c..b7c952d 100644 --- a/chrome/browser/extensions/api/tabs/tabs_event_router.cc +++ b/chrome/browser/extensions/api/tabs/tabs_event_router.cc @@ -37,14 +37,15 @@ namespace { namespace tabs = api::tabs; -void WillDispatchTabUpdatedEvent(WebContents* contents, - const DictionaryValue* changed_properties, - content::BrowserContext* context, - const Extension* extension, - ListValue* event_args) { +void WillDispatchTabUpdatedEvent( + WebContents* contents, + const base::DictionaryValue* changed_properties, + content::BrowserContext* context, + const Extension* extension, + base::ListValue* event_args) { // Overwrite the second argument with the appropriate properties dictionary, // depending on extension permissions. - DictionaryValue* properties_value = changed_properties->DeepCopy(); + base::DictionaryValue* properties_value = changed_properties->DeepCopy(); ExtensionTabUtil::ScrubTabValueForExtension(contents, extension, properties_value); @@ -60,7 +61,7 @@ TabsEventRouter::TabEntry::TabEntry() : complete_waiting_on_load_(false), url_() { } -DictionaryValue* TabsEventRouter::TabEntry::UpdateLoadState( +base::DictionaryValue* TabsEventRouter::TabEntry::UpdateLoadState( const WebContents* contents) { // The tab may go in & out of loading (for instance if iframes navigate). // We only want to respond to the first change from loading to !loading after @@ -70,17 +71,17 @@ DictionaryValue* TabsEventRouter::TabEntry::UpdateLoadState( // Send "complete" state change. complete_waiting_on_load_ = false; - DictionaryValue* changed_properties = new DictionaryValue(); + base::DictionaryValue* changed_properties = new base::DictionaryValue(); changed_properties->SetString(tabs_constants::kStatusKey, tabs_constants::kStatusValueComplete); return changed_properties; } -DictionaryValue* TabsEventRouter::TabEntry::DidNavigate( +base::DictionaryValue* TabsEventRouter::TabEntry::DidNavigate( const WebContents* contents) { // Send "loading" state change. complete_waiting_on_load_ = true; - DictionaryValue* changed_properties = new DictionaryValue(); + base::DictionaryValue* changed_properties = new base::DictionaryValue(); changed_properties->SetString(tabs_constants::kStatusKey, tabs_constants::kStatusValueLoading); @@ -179,8 +180,8 @@ static void WillDispatchTabCreatedEvent(WebContents* contents, bool active, content::BrowserContext* context, const Extension* extension, - ListValue* event_args) { - DictionaryValue* tab_value = ExtensionTabUtil::CreateTabValue( + base::ListValue* event_args) { + base::DictionaryValue* tab_value = ExtensionTabUtil::CreateTabValue( contents, extension); event_args->Clear(); event_args->Append(tab_value); @@ -191,7 +192,7 @@ void TabsEventRouter::TabCreatedAt(WebContents* contents, int index, bool active) { Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext()); - scoped_ptr<ListValue> args(new ListValue); + scoped_ptr<base::ListValue> args(new base::ListValue); scoped_ptr<Event> event(new Event(tabs::OnCreated::kEventName, args.Pass())); event->restrict_to_browser_context = profile; event->user_gesture = EventRouter::USER_GESTURE_NOT_ENABLED; @@ -214,10 +215,10 @@ void TabsEventRouter::TabInsertedAt(WebContents* contents, return; } - scoped_ptr<ListValue> args(new ListValue); + scoped_ptr<base::ListValue> args(new base::ListValue); args->Append(new FundamentalValue(tab_id)); - DictionaryValue* object_args = new DictionaryValue(); + base::DictionaryValue* object_args = new base::DictionaryValue(); object_args->Set(tabs_constants::kNewWindowIdKey, new FundamentalValue( ExtensionTabUtil::GetWindowIdOfTab(contents))); @@ -236,11 +237,11 @@ void TabsEventRouter::TabDetachedAt(WebContents* contents, int index) { return; } - scoped_ptr<ListValue> args(new ListValue); + scoped_ptr<base::ListValue> args(new base::ListValue); args->Append( new FundamentalValue(ExtensionTabUtil::GetTabId(contents))); - DictionaryValue* object_args = new DictionaryValue(); + base::DictionaryValue* object_args = new base::DictionaryValue(); object_args->Set(tabs_constants::kOldWindowIdKey, new FundamentalValue( ExtensionTabUtil::GetWindowIdOfTab(contents))); @@ -260,10 +261,10 @@ void TabsEventRouter::TabClosingAt(TabStripModel* tab_strip_model, int index) { int tab_id = ExtensionTabUtil::GetTabId(contents); - scoped_ptr<ListValue> args(new ListValue); + scoped_ptr<base::ListValue> args(new base::ListValue); args->Append(new FundamentalValue(tab_id)); - DictionaryValue* object_args = new DictionaryValue(); + base::DictionaryValue* object_args = new base::DictionaryValue(); object_args->SetInteger(tabs_constants::kWindowIdKey, ExtensionTabUtil::GetWindowIdOfTab(contents)); object_args->SetBoolean(tabs_constants::kWindowClosing, @@ -286,11 +287,11 @@ void TabsEventRouter::ActiveTabChanged(WebContents* old_contents, WebContents* new_contents, int index, int reason) { - scoped_ptr<ListValue> args(new ListValue); + scoped_ptr<base::ListValue> args(new base::ListValue); int tab_id = ExtensionTabUtil::GetTabId(new_contents); args->Append(new FundamentalValue(tab_id)); - DictionaryValue* object_args = new DictionaryValue(); + base::DictionaryValue* object_args = new base::DictionaryValue(); object_args->Set(tabs_constants::kWindowIdKey, new FundamentalValue( ExtensionTabUtil::GetWindowIdOfTab(new_contents))); @@ -306,11 +307,11 @@ void TabsEventRouter::ActiveTabChanged(WebContents* old_contents, : EventRouter::USER_GESTURE_NOT_ENABLED; DispatchEvent(profile, tabs::OnSelectionChanged::kEventName, - scoped_ptr<ListValue>(args->DeepCopy()), + scoped_ptr<base::ListValue>(args->DeepCopy()), gesture); DispatchEvent(profile, tabs::OnActiveChanged::kEventName, - scoped_ptr<ListValue>(args->DeepCopy()), + scoped_ptr<base::ListValue>(args->DeepCopy()), gesture); // The onActivated event takes one argument: {windowId, tabId}. @@ -325,7 +326,7 @@ void TabsEventRouter::TabSelectionChanged( const ui::ListSelectionModel& old_model) { ui::ListSelectionModel::SelectedIndices new_selection = tab_strip_model->selection_model().selected_indices(); - scoped_ptr<ListValue> all_tabs(new ListValue); + scoped_ptr<base::ListValue> all_tabs(new base::ListValue); for (size_t i = 0; i < new_selection.size(); ++i) { int index = new_selection[i]; @@ -336,8 +337,8 @@ void TabsEventRouter::TabSelectionChanged( all_tabs->Append(new FundamentalValue(tab_id)); } - scoped_ptr<ListValue> args(new ListValue); - scoped_ptr<DictionaryValue> select_info(new DictionaryValue); + scoped_ptr<base::ListValue> args(new base::ListValue); + scoped_ptr<base::DictionaryValue> select_info(new base::DictionaryValue); select_info->Set( tabs_constants::kWindowIdKey, @@ -351,7 +352,7 @@ void TabsEventRouter::TabSelectionChanged( Profile* profile = tab_strip_model->profile(); DispatchEvent(profile, tabs::OnHighlightChanged::kEventName, - scoped_ptr<ListValue>(args->DeepCopy()), + scoped_ptr<base::ListValue>(args->DeepCopy()), EventRouter::USER_GESTURE_UNKNOWN); DispatchEvent(profile, tabs::OnHighlighted::kEventName, @@ -362,11 +363,11 @@ void TabsEventRouter::TabSelectionChanged( void TabsEventRouter::TabMoved(WebContents* contents, int from_index, int to_index) { - scoped_ptr<ListValue> args(new ListValue); + scoped_ptr<base::ListValue> args(new base::ListValue); args->Append( new FundamentalValue(ExtensionTabUtil::GetTabId(contents))); - DictionaryValue* object_args = new DictionaryValue(); + base::DictionaryValue* object_args = new base::DictionaryValue(); object_args->Set(tabs_constants::kWindowIdKey, new FundamentalValue( ExtensionTabUtil::GetWindowIdOfTab(contents))); @@ -385,7 +386,7 @@ void TabsEventRouter::TabMoved(WebContents* contents, void TabsEventRouter::TabUpdated(WebContents* contents, bool did_navigate) { TabEntry* entry = GetTabEntry(contents); - scoped_ptr<DictionaryValue> changed_properties; + scoped_ptr<base::DictionaryValue> changed_properties; CHECK(entry); @@ -403,7 +404,8 @@ void TabsEventRouter::FaviconUrlUpdated(WebContents* contents) { contents->GetController().GetVisibleEntry(); if (!entry || !entry->GetFavicon().valid) return; - scoped_ptr<DictionaryValue> changed_properties(new DictionaryValue); + scoped_ptr<base::DictionaryValue> changed_properties( + new base::DictionaryValue); changed_properties->SetString( tabs_constants::kFaviconUrlKey, entry->GetFavicon().url.possibly_invalid_spec()); @@ -413,7 +415,7 @@ void TabsEventRouter::FaviconUrlUpdated(WebContents* contents) { void TabsEventRouter::DispatchEvent( Profile* profile, const std::string& event_name, - scoped_ptr<ListValue> args, + scoped_ptr<base::ListValue> args, EventRouter::UserGestureState user_gesture) { if (!profile_->IsSameProfile(profile) || !ExtensionSystem::Get(profile)->event_router()) @@ -430,7 +432,7 @@ void TabsEventRouter::DispatchSimpleBrowserEvent( if (!profile_->IsSameProfile(profile)) return; - scoped_ptr<ListValue> args(new ListValue); + scoped_ptr<base::ListValue> args(new base::ListValue); args->Append(new FundamentalValue(window_id)); DispatchEvent(profile, @@ -440,13 +442,14 @@ void TabsEventRouter::DispatchSimpleBrowserEvent( } void TabsEventRouter::DispatchTabUpdatedEvent( - WebContents* contents, scoped_ptr<DictionaryValue> changed_properties) { + WebContents* contents, + scoped_ptr<base::DictionaryValue> changed_properties) { DCHECK(changed_properties); DCHECK(contents); // The state of the tab (as seen from the extension point of view) has // changed. Send a notification to the extension. - scoped_ptr<ListValue> args_base(new ListValue); + scoped_ptr<base::ListValue> args_base(new base::ListValue); // First arg: The id of the tab that changed. args_base->AppendInteger(ExtensionTabUtil::GetTabId(contents)); @@ -518,7 +521,7 @@ void TabsEventRouter::TabReplacedAt(TabStripModel* tab_strip_model, // WebContents being swapped. const int new_tab_id = ExtensionTabUtil::GetTabId(new_contents); const int old_tab_id = ExtensionTabUtil::GetTabId(old_contents); - scoped_ptr<ListValue> args(new ListValue); + scoped_ptr<base::ListValue> args(new base::ListValue); args->Append(new FundamentalValue(new_tab_id)); args->Append(new FundamentalValue(old_tab_id)); @@ -543,7 +546,8 @@ void TabsEventRouter::TabPinnedStateChanged(WebContents* contents, int index) { int tab_index; if (ExtensionTabUtil::GetTabStripModel(contents, &tab_strip, &tab_index)) { - scoped_ptr<DictionaryValue> changed_properties(new DictionaryValue()); + scoped_ptr<base::DictionaryValue> changed_properties( + new base::DictionaryValue()); changed_properties->SetBoolean(tabs_constants::kPinnedKey, tab_strip->IsTabPinned(tab_index)); DispatchTabUpdatedEvent(contents, changed_properties.Pass()); diff --git a/chrome/browser/extensions/api/tabs/tabs_event_router.h b/chrome/browser/extensions/api/tabs/tabs_event_router.h index b7f911c..461786a 100644 --- a/chrome/browser/extensions/api/tabs/tabs_event_router.h +++ b/chrome/browser/extensions/api/tabs/tabs_event_router.h @@ -101,8 +101,9 @@ class TabsEventRouter : public TabStripModelObserver, // Packages |changed_properties| as a tab updated event for the tab |contents| // and dispatches the event to the extension. - void DispatchTabUpdatedEvent(content::WebContents* contents, - scoped_ptr<DictionaryValue> changed_properties); + void DispatchTabUpdatedEvent( + content::WebContents* contents, + scoped_ptr<base::DictionaryValue> changed_properties); // Register ourselves to receive the various notifications we are interested // in for a browser. @@ -135,12 +136,13 @@ class TabsEventRouter : public TabStripModelObserver, // processing of TabChangedAt(). This method will "hold" a state-change // to "loading", until the DidNavigate() method which should always follow // it. Returns NULL if no updates should be sent. - DictionaryValue* UpdateLoadState(const content::WebContents* contents); + base::DictionaryValue* UpdateLoadState( + const content::WebContents* contents); // Indicates that a tab load has resulted in a navigation and the // destination url is available for inspection. Returns NULL if no updates // should be sent. - DictionaryValue* DidNavigate(const content::WebContents* contents); + base::DictionaryValue* DidNavigate(const content::WebContents* contents); private: // Whether we are waiting to fire the 'complete' status change. This will diff --git a/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc b/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc index 3e5959c..6138b12 100644 --- a/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc +++ b/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc @@ -697,7 +697,7 @@ bool WebNavigationGetFrameFunction::RunImpl() { int frame_id = params->details.frame_id; int process_id = params->details.process_id; - SetResult(Value::CreateNullValue()); + SetResult(base::Value::CreateNullValue()); content::WebContents* web_contents; if (!ExtensionTabUtil::GetTabById(tab_id, @@ -752,7 +752,7 @@ bool WebNavigationGetAllFramesFunction::RunImpl() { EXTENSION_FUNCTION_VALIDATE(params.get()); int tab_id = params->details.tab_id; - SetResult(Value::CreateNullValue()); + SetResult(base::Value::CreateNullValue()); content::WebContents* web_contents; if (!ExtensionTabUtil::GetTabById(tab_id, diff --git a/chrome/browser/extensions/api/web_request/upload_data_presenter.cc b/chrome/browser/extensions/api/web_request/upload_data_presenter.cc index 2870bc6..aaa739d 100644 --- a/chrome/browser/extensions/api/web_request/upload_data_presenter.cc +++ b/chrome/browser/extensions/api/web_request/upload_data_presenter.cc @@ -25,11 +25,11 @@ namespace { // Takes |dictionary| of <string, list of strings> pairs, and gets the list // for |key|, creating it if necessary. -ListValue* GetOrCreateList(DictionaryValue* dictionary, - const std::string& key) { - ListValue* list = NULL; +base::ListValue* GetOrCreateList(base::DictionaryValue* dictionary, + const std::string& key) { + base::ListValue* list = NULL; if (!dictionary->GetList(key, &list)) { - list = new ListValue(); + list = new base::ListValue(); dictionary->SetWithoutPathExpansion(key, list); } return list; @@ -41,8 +41,10 @@ namespace extensions { namespace subtle { -void AppendKeyValuePair(const char* key, Value* value, ListValue* list) { - DictionaryValue* dictionary = new DictionaryValue; +void AppendKeyValuePair(const char* key, + base::Value* value, + base::ListValue* list) { + base::DictionaryValue* dictionary = new base::DictionaryValue; dictionary->SetWithoutPathExpansion(key, value); list->Append(dictionary); } @@ -81,11 +83,11 @@ bool RawDataPresenter::Succeeded() { return success_; } -scoped_ptr<Value> RawDataPresenter::Result() { +scoped_ptr<base::Value> RawDataPresenter::Result() { if (!success_) - return scoped_ptr<Value>(); + return scoped_ptr<base::Value>(); - return list_.PassAs<Value>(); + return list_.PassAs<base::Value>(); } void RawDataPresenter::FeedNextBytes(const char* bytes, size_t size) { @@ -106,7 +108,7 @@ void RawDataPresenter::FeedNextFile(const std::string& filename) { ParsedDataPresenter::ParsedDataPresenter(const net::URLRequest& request) : parser_(FormDataParser::Create(request)), success_(parser_.get() != NULL), - dictionary_(success_ ? new DictionaryValue() : NULL) { + dictionary_(success_ ? new base::DictionaryValue() : NULL) { } ParsedDataPresenter::~ParsedDataPresenter() {} @@ -128,7 +130,7 @@ void ParsedDataPresenter::FeedNext(const net::UploadElementReader& reader) { FormDataParser::Result result; while (parser_->GetNextNameValue(&result)) { GetOrCreateList(dictionary_.get(), result.name())->Append( - new StringValue(result.value())); + new base::StringValue(result.value())); } } @@ -138,11 +140,11 @@ bool ParsedDataPresenter::Succeeded() { return success_; } -scoped_ptr<Value> ParsedDataPresenter::Result() { +scoped_ptr<base::Value> ParsedDataPresenter::Result() { if (!success_) - return scoped_ptr<Value>(); + return scoped_ptr<base::Value>(); - return dictionary_.PassAs<Value>(); + return dictionary_.PassAs<base::Value>(); } // static @@ -154,7 +156,7 @@ scoped_ptr<ParsedDataPresenter> ParsedDataPresenter::CreateForTests() { ParsedDataPresenter::ParsedDataPresenter(const std::string& form_type) : parser_(FormDataParser::CreateFromContentTypeHeader(&form_type)), success_(parser_.get() != NULL), - dictionary_(success_ ? new DictionaryValue() : NULL) { + dictionary_(success_ ? new base::DictionaryValue() : NULL) { } void ParsedDataPresenter::Abort() { diff --git a/chrome/browser/extensions/api/web_request/web_request_api.cc b/chrome/browser/extensions/api/web_request/web_request_api.cc index e4461ee..f3abdcb 100644 --- a/chrome/browser/extensions/api/web_request/web_request_api.cc +++ b/chrome/browser/extensions/api/web_request/web_request_api.cc @@ -195,7 +195,7 @@ void ExtractRequestInfoDetails(net::URLRequest* request, // Extracts from |request| information for the keys requestId, url, method, // frameId, tabId, type, and timeStamp and writes these into |out| to be passed // on to extensions. -void ExtractRequestInfo(net::URLRequest* request, DictionaryValue* out) { +void ExtractRequestInfo(net::URLRequest* request, base::DictionaryValue* out) { bool is_main_frame = false; int64 frame_id = -1; bool parent_is_main_frame = false; @@ -228,13 +228,13 @@ void ExtractRequestInfo(net::URLRequest* request, DictionaryValue* out) { // Extracts the body from |request| and writes the data into |out|. void ExtractRequestInfoBody(const net::URLRequest* request, - DictionaryValue* out) { + base::DictionaryValue* out) { const net::UploadDataStream* upload_data = request->get_upload(); if (!upload_data || (request->method() != "POST" && request->method() != "PUT")) return; // Need to exit without "out->Set(keys::kRequestBodyKey, ...);" . - DictionaryValue* requestBody = new DictionaryValue(); + base::DictionaryValue* requestBody = new base::DictionaryValue(); out->Set(keys::kRequestBodyKey, requestBody); // Get the data presenters, ordered by how specific they are. @@ -268,7 +268,7 @@ void ExtractRequestInfoBody(const net::URLRequest* request, // Converts a HttpHeaders dictionary to a |name|, |value| pair. Returns // true if successful. -bool FromHeaderDictionary(const DictionaryValue* header_value, +bool FromHeaderDictionary(const base::DictionaryValue* header_value, std::string* name, std::string* value) { if (!header_value->GetString(keys::kHeaderNameKey, name)) @@ -284,7 +284,7 @@ bool FromHeaderDictionary(const DictionaryValue* header_value, return false; } } else if (header_value->HasKey(keys::kHeaderBinaryValueKey)) { - const ListValue* list = NULL; + const base::ListValue* list = NULL; if (!header_value->GetList(keys::kHeaderBinaryValueKey, &list) || !helpers::CharListToString(list, value)) { return false; @@ -295,9 +295,9 @@ bool FromHeaderDictionary(const DictionaryValue* header_value, // Converts the |name|, |value| pair of a http header to a HttpHeaders // dictionary. Ownership is passed to the caller. -DictionaryValue* ToHeaderDictionary(const std::string& name, - const std::string& value) { - DictionaryValue* header = new DictionaryValue(); +base::DictionaryValue* ToHeaderDictionary(const std::string& name, + const std::string& value) { + base::DictionaryValue* header = new base::DictionaryValue(); header->SetString(keys::kHeaderNameKey, name); if (IsStringUTF8(value)) { header->SetString(keys::kHeaderValueKey, value); @@ -310,8 +310,9 @@ DictionaryValue* ToHeaderDictionary(const std::string& name, // Creates a list of HttpHeaders (see the extension API JSON). If |headers| is // NULL, the list is empty. Ownership is passed to the caller. -ListValue* GetResponseHeadersList(const net::HttpResponseHeaders* headers) { - ListValue* headers_value = new ListValue(); +base::ListValue* GetResponseHeadersList( + const net::HttpResponseHeaders* headers) { + base::ListValue* headers_value = new base::ListValue(); if (headers) { void* iter = NULL; std::string name; @@ -322,17 +323,18 @@ ListValue* GetResponseHeadersList(const net::HttpResponseHeaders* headers) { return headers_value; } -ListValue* GetRequestHeadersList(const net::HttpRequestHeaders& headers) { - ListValue* headers_value = new ListValue(); +base::ListValue* GetRequestHeadersList(const net::HttpRequestHeaders& headers) { + base::ListValue* headers_value = new base::ListValue(); for (net::HttpRequestHeaders::Iterator it(headers); it.GetNext(); ) headers_value->Append(ToHeaderDictionary(it.name(), it.value())); return headers_value; } -// Creates a StringValue with the status line of |headers|. If |headers| is -// NULL, an empty string is returned. Ownership is passed to the caller. -StringValue* GetStatusLine(net::HttpResponseHeaders* headers) { - return new StringValue(headers ? headers->GetStatusLine() : std::string()); +// Creates a base::StringValue with the status line of |headers|. If |headers| +// is NULL, an empty string is returned. Ownership is passed to the caller. +base::StringValue* GetStatusLine(net::HttpResponseHeaders* headers) { + return new base::StringValue( + headers ? headers->GetStatusLine() : std::string()); } void RemoveEventListenerOnUI( @@ -372,7 +374,7 @@ void SendOnMessageEventOnUI( if (!g_browser_process->profile_manager()->IsValidProfile(profile)) return; - scoped_ptr<base::ListValue> event_args(new ListValue); + scoped_ptr<base::ListValue> event_args(new base::ListValue); event_args->Append(event_argument.release()); extensions::EventRouter* event_router = @@ -540,13 +542,13 @@ struct ExtensionWebRequestEventRouter::BlockedRequest { }; bool ExtensionWebRequestEventRouter::RequestFilter::InitFromValue( - const DictionaryValue& value, std::string* error) { + const base::DictionaryValue& value, std::string* error) { if (!value.HasKey("urls")) return false; - for (DictionaryValue::Iterator it(value); !it.IsAtEnd(); it.Advance()) { + for (base::DictionaryValue::Iterator it(value); !it.IsAtEnd(); it.Advance()) { if (it.key() == "urls") { - const ListValue* urls_value = NULL; + const base::ListValue* urls_value = NULL; if (!it.value().GetAsList(&urls_value)) return false; for (size_t i = 0; i < urls_value->GetSize(); ++i) { @@ -564,7 +566,7 @@ bool ExtensionWebRequestEventRouter::RequestFilter::InitFromValue( urls.AddPattern(pattern); } } else if (it.key() == "types") { - const ListValue* types_value = NULL; + const base::ListValue* types_value = NULL; if (!it.value().GetAsList(&types_value)) return false; for (size_t i = 0; i < types_value->GetSize(); ++i) { @@ -590,7 +592,7 @@ bool ExtensionWebRequestEventRouter::RequestFilter::InitFromValue( // static bool ExtensionWebRequestEventRouter::ExtraInfoSpec::InitFromValue( - const ListValue& value, int* extra_info_spec) { + const base::ListValue& value, int* extra_info_spec) { *extra_info_spec = 0; for (size_t i = 0; i < value.GetSize(); ++i) { std::string str; @@ -697,8 +699,8 @@ int ExtensionWebRequestEventRouter::OnBeforeRequest( &extra_info_spec); if (!listeners.empty() && !GetAndSetSignaled(request->identifier(), kOnBeforeRequest)) { - ListValue args; - DictionaryValue* dict = new DictionaryValue(); + base::ListValue args; + base::DictionaryValue* dict = new base::DictionaryValue(); ExtractRequestInfo(request, dict); if (extra_info_spec & ExtraInfoSpec::REQUEST_BODY) ExtractRequestInfoBody(request, dict); @@ -754,8 +756,8 @@ int ExtensionWebRequestEventRouter::OnBeforeSendHeaders( &extra_info_spec); if (!listeners.empty() && !GetAndSetSignaled(request->identifier(), kOnBeforeSendHeaders)) { - ListValue args; - DictionaryValue* dict = new DictionaryValue(); + base::ListValue args; + base::DictionaryValue* dict = new base::DictionaryValue(); ExtractRequestInfo(request, dict); if (extra_info_spec & ExtraInfoSpec::REQUEST_HEADERS) dict->Set(keys::kRequestHeadersKey, GetRequestHeadersList(*headers)); @@ -809,8 +811,8 @@ void ExtensionWebRequestEventRouter::OnSendHeaders( if (listeners.empty()) return; - ListValue args; - DictionaryValue* dict = new DictionaryValue(); + base::ListValue args; + base::DictionaryValue* dict = new base::DictionaryValue(); ExtractRequestInfo(request, dict); if (extra_info_spec & ExtraInfoSpec::REQUEST_HEADERS) dict->Set(keys::kRequestHeadersKey, GetRequestHeadersList(headers)); @@ -847,8 +849,8 @@ int ExtensionWebRequestEventRouter::OnHeadersReceived( if (!listeners.empty() && !GetAndSetSignaled(request->identifier(), kOnHeadersReceived)) { - ListValue args; - DictionaryValue* dict = new DictionaryValue(); + base::ListValue args; + base::DictionaryValue* dict = new base::DictionaryValue(); ExtractRequestInfo(request, dict); dict->SetString(keys::kStatusLineKey, original_response_headers->GetStatusLine()); @@ -908,15 +910,15 @@ ExtensionWebRequestEventRouter::OnAuthRequired( if (listeners.empty()) return net::NetworkDelegate::AUTH_REQUIRED_RESPONSE_NO_ACTION; - ListValue args; - DictionaryValue* dict = new DictionaryValue(); + base::ListValue args; + base::DictionaryValue* dict = new base::DictionaryValue(); ExtractRequestInfo(request, dict); dict->SetBoolean(keys::kIsProxyKey, auth_info.is_proxy); if (!auth_info.scheme.empty()) dict->SetString(keys::kSchemeKey, auth_info.scheme); if (!auth_info.realm.empty()) dict->SetString(keys::kRealmKey, auth_info.realm); - DictionaryValue* challenger = new DictionaryValue(); + base::DictionaryValue* challenger = new base::DictionaryValue(); challenger->SetString(keys::kHostKey, auth_info.challenger.host()); challenger->SetInteger(keys::kPortKey, auth_info.challenger.port()); dict->Set(keys::kChallengerKey, challenger); @@ -970,8 +972,8 @@ void ExtensionWebRequestEventRouter::OnBeforeRedirect( std::string response_ip = request->GetSocketAddress().host(); - ListValue args; - DictionaryValue* dict = new DictionaryValue(); + base::ListValue args; + base::DictionaryValue* dict = new base::DictionaryValue(); ExtractRequestInfo(request, dict); dict->SetString(keys::kRedirectUrlKey, new_location.spec()); dict->SetInteger(keys::kStatusCodeKey, http_status_code); @@ -1016,8 +1018,8 @@ void ExtensionWebRequestEventRouter::OnResponseStarted( std::string response_ip = request->GetSocketAddress().host(); - ListValue args; - DictionaryValue* dict = new DictionaryValue(); + base::ListValue args; + base::DictionaryValue* dict = new base::DictionaryValue(); ExtractRequestInfo(request, dict); if (!response_ip.empty()) dict->SetString(keys::kIpKey, response_ip); @@ -1068,8 +1070,8 @@ void ExtensionWebRequestEventRouter::OnCompleted(void* profile, std::string response_ip = request->GetSocketAddress().host(); - ListValue args; - DictionaryValue* dict = new DictionaryValue(); + base::ListValue args; + base::DictionaryValue* dict = new base::DictionaryValue(); ExtractRequestInfo(request, dict); dict->SetInteger(keys::kStatusCodeKey, response_code); if (!response_ip.empty()) @@ -1117,8 +1119,8 @@ void ExtensionWebRequestEventRouter::OnErrorOccurred( if (listeners.empty()) return; - ListValue args; - DictionaryValue* dict = new DictionaryValue(); + base::ListValue args; + base::DictionaryValue* dict = new base::DictionaryValue(); ExtractRequestInfo(request, dict); if (started) { std::string response_ip = request->GetSocketAddress().host(); @@ -1152,15 +1154,15 @@ bool ExtensionWebRequestEventRouter::DispatchEvent( void* profile_id, net::URLRequest* request, const std::vector<const EventListener*>& listeners, - const ListValue& args) { + const base::ListValue& args) { // TODO(mpcomplete): Consider consolidating common (extension_id,json_args) // pairs into a single message sent to a list of sub_event_names. int num_handlers_blocking = 0; for (std::vector<const EventListener*>::const_iterator it = listeners.begin(); it != listeners.end(); ++it) { // Filter out the optional keys that this listener didn't request. - scoped_ptr<ListValue> args_filtered(args.DeepCopy()); - DictionaryValue* dict = NULL; + scoped_ptr<base::ListValue> args_filtered(args.DeepCopy()); + base::DictionaryValue* dict = NULL; CHECK(args_filtered->GetDictionary(0, &dict) && dict); if (!((*it)->extra_info_spec & ExtraInfoSpec::REQUEST_HEADERS)) dict->Remove(keys::kRequestHeadersKey, NULL); @@ -1563,8 +1565,8 @@ helpers::EventResponseDelta* CalculateDelta( return NULL; } -Value* SerializeResponseHeaders(const helpers::ResponseHeaders& headers) { - scoped_ptr<ListValue> serialized_headers(new ListValue()); +base::Value* SerializeResponseHeaders(const helpers::ResponseHeaders& headers) { + scoped_ptr<base::ListValue> serialized_headers(new base::ListValue()); for (helpers::ResponseHeaders::const_iterator i = headers.begin(); i != headers.end(); ++i) { serialized_headers->Append(ToHeaderDictionary(i->first, i->second)); @@ -1573,17 +1575,17 @@ Value* SerializeResponseHeaders(const helpers::ResponseHeaders& headers) { } // Convert a RequestCookieModifications/ResponseCookieModifications object to a -// ListValue which summarizes the changes made. This is templated since the -// two types (request/response) are different but contain essentially the same -// fields. +// base::ListValue which summarizes the changes made. This is templated since +// the two types (request/response) are different but contain essentially the +// same fields. template<typename CookieType> -ListValue* SummarizeCookieModifications( +base::ListValue* SummarizeCookieModifications( const std::vector<linked_ptr<CookieType> >& modifications) { - scoped_ptr<ListValue> cookie_modifications(new ListValue()); + scoped_ptr<base::ListValue> cookie_modifications(new base::ListValue()); for (typename std::vector<linked_ptr<CookieType> >::const_iterator i = modifications.begin(); i != modifications.end(); ++i) { - scoped_ptr<DictionaryValue> summary(new DictionaryValue()); + scoped_ptr<base::DictionaryValue> summary(new base::DictionaryValue()); const CookieType& mod = *i->get(); switch (mod.type) { case helpers::ADD: @@ -1622,10 +1624,10 @@ ListValue* SummarizeCookieModifications( // Converts an EventResponseDelta object to a dictionary value suitable for the // activity log. -scoped_ptr<DictionaryValue> SummarizeResponseDelta( +scoped_ptr<base::DictionaryValue> SummarizeResponseDelta( const std::string& event_name, const helpers::EventResponseDelta& delta) { - scoped_ptr<DictionaryValue> details(new DictionaryValue()); + scoped_ptr<base::DictionaryValue> details(new base::DictionaryValue()); if (delta.cancel) { details->SetBoolean(activitylog::kCancelKey, true); } @@ -1633,7 +1635,7 @@ scoped_ptr<DictionaryValue> SummarizeResponseDelta( details->SetString(activitylog::kNewUrlKey, delta.new_url.spec()); } - scoped_ptr<ListValue> modified_headers(new ListValue()); + scoped_ptr<base::ListValue> modified_headers(new base::ListValue()); net::HttpRequestHeaders::Iterator iter(delta.modified_request_headers); while (iter.GetNext()) { modified_headers->Append(ToHeaderDictionary(iter.name(), iter.value())); @@ -1643,7 +1645,7 @@ scoped_ptr<DictionaryValue> SummarizeResponseDelta( modified_headers.release()); } - scoped_ptr<ListValue> deleted_headers(new ListValue()); + scoped_ptr<base::ListValue> deleted_headers(new base::ListValue()); deleted_headers->AppendStrings(delta.deleted_request_headers); if (!deleted_headers->empty()) { details->Set(activitylog::kDeletedRequestHeadersKey, @@ -1677,7 +1679,7 @@ void LogExtensionActivity(void* profile_id, const std::string& extension_id, const GURL& url, const std::string& api_call, - scoped_ptr<DictionaryValue> details) { + scoped_ptr<base::DictionaryValue> details) { if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, @@ -2135,7 +2137,7 @@ void ClearCacheQuotaHeuristic::OnPageLoad(Bucket* bucket) { bool WebRequestAddEventListener::RunImpl() { // Argument 0 is the callback, which we don't use here. ExtensionWebRequestEventRouter::RequestFilter filter; - DictionaryValue* value = NULL; + base::DictionaryValue* value = NULL; error_.clear(); EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(1, &value)); // Failure + an empty error string means a fatal error. @@ -2146,7 +2148,7 @@ bool WebRequestAddEventListener::RunImpl() { int extra_info_spec = 0; if (HasOptionalArgument(2)) { - ListValue* value = NULL; + base::ListValue* value = NULL; EXTENSION_FUNCTION_VALIDATE(args_->GetList(2, &value)); EXTENSION_FUNCTION_VALIDATE( ExtensionWebRequestEventRouter::ExtraInfoSpec::InitFromValue( @@ -2227,7 +2229,7 @@ bool WebRequestEventHandled::RunImpl() { scoped_ptr<ExtensionWebRequestEventRouter::EventResponse> response; if (HasOptionalArgument(3)) { - DictionaryValue* value = NULL; + base::DictionaryValue* value = NULL; EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(3, &value)); if (!value->empty()) { @@ -2262,12 +2264,12 @@ bool WebRequestEventHandled::RunImpl() { } if (value->HasKey("requestHeaders")) { - ListValue* request_headers_value = NULL; + base::ListValue* request_headers_value = NULL; response->request_headers.reset(new net::HttpRequestHeaders()); EXTENSION_FUNCTION_VALIDATE(value->GetList(keys::kRequestHeadersKey, &request_headers_value)); for (size_t i = 0; i < request_headers_value->GetSize(); ++i) { - DictionaryValue* header_value = NULL; + base::DictionaryValue* header_value = NULL; std::string name; std::string value; EXTENSION_FUNCTION_VALIDATE( @@ -2281,11 +2283,11 @@ bool WebRequestEventHandled::RunImpl() { if (value->HasKey("responseHeaders")) { scoped_ptr<helpers::ResponseHeaders> response_headers( new helpers::ResponseHeaders()); - ListValue* response_headers_value = NULL; + base::ListValue* response_headers_value = NULL; EXTENSION_FUNCTION_VALIDATE(value->GetList(keys::kResponseHeadersKey, &response_headers_value)); for (size_t i = 0; i < response_headers_value->GetSize(); ++i) { - DictionaryValue* header_value = NULL; + base::DictionaryValue* header_value = NULL; std::string name; std::string value; EXTENSION_FUNCTION_VALIDATE( @@ -2298,7 +2300,7 @@ bool WebRequestEventHandled::RunImpl() { } if (value->HasKey(keys::kAuthCredentialsKey)) { - DictionaryValue* credentials_value = NULL; + base::DictionaryValue* credentials_value = NULL; EXTENSION_FUNCTION_VALIDATE(value->GetDictionary( keys::kAuthCredentialsKey, &credentials_value)); diff --git a/chrome/browser/extensions/api/web_request/web_request_api_helpers.cc b/chrome/browser/extensions/api/web_request/web_request_api_helpers.cc index 19638b7..84df350 100644 --- a/chrome/browser/extensions/api/web_request/web_request_api_helpers.cc +++ b/chrome/browser/extensions/api/web_request/web_request_api_helpers.cc @@ -213,7 +213,7 @@ net::NetLog::ParametersCallback CreateNetLogExtensionIdCallback( // Creates NetLog parameters to indicate that an extension modified a request. // Caller takes ownership of returned value. -Value* NetLogModificationCallback( +base::Value* NetLogModificationCallback( const EventResponseDelta* delta, net::NetLog::LogLevel log_level) { base::DictionaryValue* dict = new base::DictionaryValue(); diff --git a/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc b/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc index d5dfb49..fde07f9 100644 --- a/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc +++ b/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc @@ -117,14 +117,14 @@ bool HasWarning(const ExtensionWarningSet& warnings, // Parses the JSON data attached to the |message| and tries to return it. // |param| must outlive |out|. Returns NULL on failure. void GetPartOfMessageArguments(IPC::Message* message, - const DictionaryValue** out, + const base::DictionaryValue** out, ExtensionMsg_MessageInvoke::Param* param) { ASSERT_EQ(ExtensionMsg_MessageInvoke::ID, message->type()); ASSERT_TRUE(ExtensionMsg_MessageInvoke::Read(message, param)); ASSERT_GE(param->d.GetSize(), 2u); - const Value* value = NULL; + const base::Value* value = NULL; ASSERT_TRUE(param->d.Get(1, &value)); - const ListValue* list = NULL; + const base::ListValue* list = NULL; ASSERT_TRUE(value->GetAsList(&list)); ASSERT_EQ(1u, list->GetSize()); ASSERT_TRUE(list->GetDictionary(0, out)); @@ -481,7 +481,7 @@ namespace { // Create the numerical representation of |values|, strings passed as // extraInfoSpec by the event handler. Returns true on success, otherwise false. bool GenerateInfoSpec(const std::string& values, int* result) { - // Create a ListValue of strings. + // Create a base::ListValue of strings. std::vector<std::string> split_values; base::ListValue list_value; size_t num_values = Tokenize(values, ",", &split_values); @@ -579,11 +579,11 @@ TEST_F(ExtensionWebRequestTest, AccessRequestBodyData) { // Contents of formData. const char kFormData[] = "{\"A\":[\"test text\"],\"B\":[\"\"],\"C\":[\"test password\"]}"; - scoped_ptr<const Value> form_data(base::JSONReader::Read(kFormData)); + scoped_ptr<const base::Value> form_data(base::JSONReader::Read(kFormData)); ASSERT_TRUE(form_data.get() != NULL); - ASSERT_TRUE(form_data->GetType() == Value::TYPE_DICTIONARY); + ASSERT_TRUE(form_data->GetType() == base::Value::TYPE_DICTIONARY); // Contents of raw. - ListValue raw; + base::ListValue raw; extensions::subtle::AppendKeyValuePair( keys::kRequestBodyRawBytesKey, BinaryValue::CreateWithCopiedBuffer(kPlainBlock1, kPlainBlock1Length), @@ -597,7 +597,7 @@ TEST_F(ExtensionWebRequestTest, AccessRequestBodyData) { BinaryValue::CreateWithCopiedBuffer(kPlainBlock2, kPlainBlock2Length), &raw); // Summary. - const Value* const kExpected[] = { + const base::Value* const kExpected[] = { form_data.get(), NULL, &raw, @@ -672,11 +672,11 @@ TEST_F(ExtensionWebRequestTest, AccessRequestBodyData) { SCOPED_TRACE(testing::Message("iteration number ") << test); EXPECT_NE(i, ipc_sender_.sent_end()); message = (i++)->get(); - const DictionaryValue* details; + const base::DictionaryValue* details; ExtensionMsg_MessageInvoke::Param param; GetPartOfMessageArguments(message, &details, ¶m); ASSERT_TRUE(details != NULL); - const Value* result = NULL; + const base::Value* result = NULL; if (kExpected[test]) { EXPECT_TRUE(details->Get(*(kPath[test]), &result)); EXPECT_TRUE(kExpected[test]->Equals(result)); @@ -732,7 +732,7 @@ TEST_F(ExtensionWebRequestTest, NoAccessRequestBodyData) { SCOPED_TRACE(testing::Message("iteration number ") << test); EXPECT_NE(i, ipc_sender_.sent_end()); IPC::Message* message = i->get(); - const DictionaryValue* details = NULL; + const base::DictionaryValue* details = NULL; ExtensionMsg_MessageInvoke::Param param; GetPartOfMessageArguments(message, &details, ¶m); ASSERT_TRUE(details != NULL); @@ -919,7 +919,7 @@ TEST_P(ExtensionWebRequestHeaderModificationTest, TestModifications) { continue; ExtensionMsg_MessageInvoke::Param message_tuple; ExtensionMsg_MessageInvoke::Read(message, &message_tuple); - ListValue& args = message_tuple.d; + base::ListValue& args = message_tuple.d; std::string event_name; if (!args.GetString(0, &event_name) || @@ -927,19 +927,19 @@ TEST_P(ExtensionWebRequestHeaderModificationTest, TestModifications) { continue; } - ListValue* event_arg = NULL; + base::ListValue* event_arg = NULL; ASSERT_TRUE(args.GetList(1, &event_arg)); - DictionaryValue* event_arg_dict = NULL; + base::DictionaryValue* event_arg_dict = NULL; ASSERT_TRUE(event_arg->GetDictionary(0, &event_arg_dict)); - ListValue* request_headers = NULL; + base::ListValue* request_headers = NULL; ASSERT_TRUE(event_arg_dict->GetList(keys::kRequestHeadersKey, &request_headers)); net::HttpRequestHeaders observed_headers; for (size_t j = 0; j < request_headers->GetSize(); ++j) { - DictionaryValue* header = NULL; + base::DictionaryValue* header = NULL; ASSERT_TRUE(request_headers->GetDictionary(j, &header)); std::string key; std::string value; @@ -1168,7 +1168,7 @@ TEST(ExtensionWebRequestHelpersTest, } TEST(ExtensionWebRequestHelpersTest, TestStringToCharList) { - ListValue list_value; + base::ListValue list_value; list_value.Append(new base::FundamentalValue('1')); list_value.Append(new base::FundamentalValue('2')); list_value.Append(new base::FundamentalValue('3')); @@ -1178,7 +1178,7 @@ TEST(ExtensionWebRequestHelpersTest, TestStringToCharList) { unsigned char char_value[] = {'1', '2', '3', 0xFE, 0xD1}; std::string string_value(reinterpret_cast<char *>(char_value), 5); - scoped_ptr<ListValue> converted_list(StringToCharList(string_value)); + scoped_ptr<base::ListValue> converted_list(StringToCharList(string_value)); EXPECT_TRUE(list_value.Equals(converted_list.get())); std::string converted_string; diff --git a/chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_api.cc b/chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_api.cc index 602e857..4725c5d 100644 --- a/chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_api.cc +++ b/chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_api.cc @@ -90,7 +90,7 @@ void WebrtcAudioPrivateEventService::SignalEvent() { if (router->ExtensionHasEventListener(extension_id, kEventName) && (*it)->HasAPIPermission("webrtcAudioPrivate")) { scoped_ptr<Event> event( - new Event(kEventName, make_scoped_ptr(new ListValue()).Pass())); + new Event(kEventName, make_scoped_ptr(new base::ListValue()).Pass())); router->DispatchEventToExtension(extension_id, event.Pass()); } } diff --git a/chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_browsertest.cc b/chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_browsertest.cc index 60e5aef..563efca 100644 --- a/chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_browsertest.cc +++ b/chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_browsertest.cc @@ -78,7 +78,7 @@ class WebrtcAudioPrivateTest : public AudioWaitingExtensionTest { protected: std::string InvokeGetActiveSink(int tab_id) { - ListValue parameters; + base::ListValue parameters; parameters.AppendInteger(tab_id); std::string parameter_string; JSONWriter::Write(¶meters, ¶meter_string); @@ -210,7 +210,7 @@ IN_PROC_BROWSER_TEST_F(WebrtcAudioPrivateTest, GetActiveSinkNoMediaStream) { IN_PROC_BROWSER_TEST_F(WebrtcAudioPrivateTest, SetActiveSinkNoMediaStream) { WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents(); int tab_id = ExtensionTabUtil::GetTabId(tab); - ListValue parameters; + base::ListValue parameters; parameters.AppendInteger(tab_id); parameters.AppendString("no such id"); std::string parameter_string; @@ -256,7 +256,7 @@ IN_PROC_BROWSER_TEST_F(WebrtcAudioPrivateTest, GetAndSetWithMediaStream) { ++it) { std::string target_device(it->unique_id); - ListValue parameters; + base::ListValue parameters; parameters.AppendInteger(tab_id); parameters.AppendString(target_device); std::string parameter_string; @@ -300,7 +300,7 @@ IN_PROC_BROWSER_TEST_F(WebrtcAudioPrivateTest, GetAssociatedSink) { raw_device_id, &source_id_in_origin); - ListValue parameters; + base::ListValue parameters; parameters.AppendString(origin.spec()); parameters.AppendString(source_id_in_origin); std::string parameter_string; diff --git a/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_apitest.cc b/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_apitest.cc index cf471c6..f320eaf 100644 --- a/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_apitest.cc +++ b/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_apitest.cc @@ -45,7 +45,7 @@ IN_PROC_BROWSER_TEST_F(WebrtcLoggingPrivateApiTest, TestStartStopDiscard) { content::WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents(); - ListValue parameters; + base::ListValue parameters; parameters.AppendInteger(extensions::ExtensionTabUtil::GetTabId(contents)); parameters.AppendString(contents->GetURL().GetOrigin().spec()); std::string parameter_string; @@ -134,15 +134,15 @@ IN_PROC_BROWSER_TEST_F(WebrtcLoggingPrivateApiTest, TestStartStopUpload) { content::WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents(); - ListValue parameters; + base::ListValue parameters; parameters.AppendInteger(extensions::ExtensionTabUtil::GetTabId(contents)); parameters.AppendString(contents->GetURL().GetOrigin().spec()); - DictionaryValue* meta_data_entry = new DictionaryValue(); + base::DictionaryValue* meta_data_entry = new base::DictionaryValue(); meta_data_entry->SetString("key", "app_session_id"); meta_data_entry->SetString("value", kTestLoggingSessionId); - ListValue* meta_data = new ListValue(); + base::ListValue* meta_data = new base::ListValue(); meta_data->Append(meta_data_entry); - meta_data_entry = new DictionaryValue(); + meta_data_entry = new base::DictionaryValue(); meta_data_entry->SetString("key", "url"); meta_data_entry->SetString("value", kTestLoggingUrl); meta_data->Append(meta_data_entry); diff --git a/chrome/browser/extensions/browser_extension_window_controller.cc b/chrome/browser/extensions/browser_extension_window_controller.cc index 0c11941..98c3a1c 100644 --- a/chrome/browser/extensions/browser_extension_window_controller.cc +++ b/chrome/browser/extensions/browser_extension_window_controller.cc @@ -41,14 +41,15 @@ std::string BrowserExtensionWindowController::GetWindowTypeText() const { base::DictionaryValue* BrowserExtensionWindowController::CreateWindowValue() const { - DictionaryValue* result = extensions::WindowController::CreateWindowValue(); + base::DictionaryValue* result = + extensions::WindowController::CreateWindowValue(); return result; } base::DictionaryValue* BrowserExtensionWindowController::CreateWindowValueWithTabs( const extensions::Extension* extension) const { - DictionaryValue* result = CreateWindowValue(); + base::DictionaryValue* result = CreateWindowValue(); result->Set(keys::kTabsKey, extensions::ExtensionTabUtil::CreateTabList(browser_, extension)); @@ -59,7 +60,7 @@ BrowserExtensionWindowController::CreateWindowValueWithTabs( base::DictionaryValue* BrowserExtensionWindowController::CreateTabValue( const extensions::Extension* extension, int tab_index) const { TabStripModel* tab_strip = browser_->tab_strip_model(); - DictionaryValue* result = extensions::ExtensionTabUtil::CreateTabValue( + base::DictionaryValue* result = extensions::ExtensionTabUtil::CreateTabValue( tab_strip->GetWebContentsAt(tab_index), tab_strip, tab_index); return result; } diff --git a/chrome/browser/extensions/bundle_installer.cc b/chrome/browser/extensions/bundle_installer.cc index 52b5ef8..3b29cd5 100644 --- a/chrome/browser/extensions/bundle_installer.cc +++ b/chrome/browser/extensions/bundle_installer.cc @@ -44,7 +44,7 @@ AutoApproveForTest g_auto_approve_for_test = DO_NOT_SKIP; // Creates a dummy extension and sets the manifest's name to the item's // localized name. scoped_refptr<Extension> CreateDummyExtension(const BundleInstaller::Item& item, - DictionaryValue* manifest) { + base::DictionaryValue* manifest) { // We require localized names so we can have nice error messages when we can't // parse an extension manifest. CHECK(!item.localized_name.empty()); @@ -297,9 +297,9 @@ void BundleInstaller::ShowInstalledBubbleIfDone() { void BundleInstaller::OnWebstoreParseSuccess( const std::string& id, const SkBitmap& icon, - DictionaryValue* manifest) { + base::DictionaryValue* manifest) { dummy_extensions_.push_back(CreateDummyExtension(items_[id], manifest)); - parsed_manifests_[id] = linked_ptr<DictionaryValue>(manifest); + parsed_manifests_[id] = linked_ptr<base::DictionaryValue>(manifest); ShowPromptIfDoneParsing(); } diff --git a/chrome/browser/extensions/chrome_app_api_browsertest.cc b/chrome/browser/extensions/chrome_app_api_browsertest.cc index da09d33..b0ace91 100644 --- a/chrome/browser/extensions/chrome_app_api_browsertest.cc +++ b/chrome/browser/extensions/chrome_app_api_browsertest.cc @@ -143,8 +143,8 @@ IN_PROC_BROWSER_TEST_F(ChromeAppAPITest, MAYBE_IsInstalled) { browser()->tab_strip_model()->GetActiveWebContents(), kGetAppDetails, &result)); - scoped_ptr<DictionaryValue> app_details( - static_cast<DictionaryValue*>(base::JSONReader::Read(result))); + scoped_ptr<base::DictionaryValue> app_details( + static_cast<base::DictionaryValue*>(base::JSONReader::Read(result))); // extension->manifest() does not contain the id. app_details->Remove("id", NULL); EXPECT_TRUE(app_details.get()); @@ -222,8 +222,8 @@ IN_PROC_BROWSER_TEST_F(ChromeAppAPITest, GetDetailsForFrame) { kGetDetailsForFrame, &json)); - scoped_ptr<DictionaryValue> app_details( - static_cast<DictionaryValue*>(base::JSONReader::Read(json))); + scoped_ptr<base::DictionaryValue> app_details( + static_cast<base::DictionaryValue*>(base::JSONReader::Read(json))); // extension->manifest() does not contain the id. app_details->Remove("id", NULL); EXPECT_TRUE(app_details.get()); diff --git a/chrome/browser/extensions/chrome_app_sorting.cc b/chrome/browser/extensions/chrome_app_sorting.cc index 62e9901..be210e2 100644 --- a/chrome/browser/extensions/chrome_app_sorting.cc +++ b/chrome/browser/extensions/chrome_app_sorting.cc @@ -310,7 +310,7 @@ void ChromeAppSorting::SetAppLaunchOrdinal( extension_id, page_ordinal, GetAppLaunchOrdinal(extension_id)); AddOrdinalMapping(extension_id, page_ordinal, new_app_launch_ordinal); - Value* new_value = new_app_launch_ordinal.IsValid() ? + base::Value* new_value = new_app_launch_ordinal.IsValid() ? new base::StringValue(new_app_launch_ordinal.ToInternalValue()) : NULL; @@ -389,7 +389,7 @@ void ChromeAppSorting::SetPageOrdinal( extension_id, GetPageOrdinal(extension_id), app_launch_ordinal); AddOrdinalMapping(extension_id, new_page_ordinal, app_launch_ordinal); - Value* new_value = new_page_ordinal.IsValid() ? + base::Value* new_value = new_page_ordinal.IsValid() ? new base::StringValue(new_page_ordinal.ToInternalValue()) : NULL; diff --git a/chrome/browser/extensions/chrome_app_sorting_unittest.cc b/chrome/browser/extensions/chrome_app_sorting_unittest.cc index d5737f8..b405214 100644 --- a/chrome/browser/extensions/chrome_app_sorting_unittest.cc +++ b/chrome/browser/extensions/chrome_app_sorting_unittest.cc @@ -623,7 +623,7 @@ TEST_F(ChromeAppSortingPageOrdinalMapping, class ChromeAppSortingPreinstalledAppsBase : public PrefsPrepopulatedTestBase { public: ChromeAppSortingPreinstalledAppsBase() { - DictionaryValue simple_dict; + base::DictionaryValue simple_dict; simple_dict.SetString(keys::kVersion, "1.0.0.0"); simple_dict.SetString(keys::kName, "unused"); simple_dict.SetString(keys::kApp, "true"); @@ -802,7 +802,7 @@ class ChromeAppSortingDefaultOrdinalsBase : public ChromeAppSortingTest { protected: scoped_refptr<Extension> CreateApp(const std::string& name) { - DictionaryValue simple_dict; + base::DictionaryValue simple_dict; simple_dict.SetString(keys::kVersion, "1.0.0.0"); simple_dict.SetString(keys::kName, name); simple_dict.SetString(keys::kApp, "true"); diff --git a/chrome/browser/extensions/component_loader.h b/chrome/browser/extensions/component_loader.h index cb5f956..415e084 100644 --- a/chrome/browser/extensions/component_loader.h +++ b/chrome/browser/extensions/component_loader.h @@ -84,7 +84,8 @@ class ComponentLoader { // Parse the given JSON manifest. Returns NULL if it cannot be parsed, or if // if the result is not a DictionaryValue. - DictionaryValue* ParseManifest(const std::string& manifest_contents) const; + base::DictionaryValue* ParseManifest( + const std::string& manifest_contents) const; // Clear the list of registered extensions. void ClearAllRegistered(); @@ -95,11 +96,11 @@ class ComponentLoader { private: // Information about a registered component extension. struct ComponentExtensionInfo { - ComponentExtensionInfo(const DictionaryValue* manifest, + ComponentExtensionInfo(const base::DictionaryValue* manifest, const base::FilePath& root_directory); // The parsed contents of the extensions's manifest file. - const DictionaryValue* manifest; + const base::DictionaryValue* manifest; // Directory where the extension is stored. base::FilePath root_directory; @@ -108,7 +109,7 @@ class ComponentLoader { std::string extension_id; }; - std::string Add(const DictionaryValue* parsed_manifest, + std::string Add(const base::DictionaryValue* parsed_manifest, const base::FilePath& root_directory); // Loads a registered component extension. diff --git a/chrome/browser/extensions/component_loader_unittest.cc b/chrome/browser/extensions/component_loader_unittest.cc index 0296218..670b7c6 100644 --- a/chrome/browser/extensions/component_loader_unittest.cc +++ b/chrome/browser/extensions/component_loader_unittest.cc @@ -129,7 +129,7 @@ class ComponentLoaderTest : public testing::Test { }; TEST_F(ComponentLoaderTest, ParseManifest) { - scoped_ptr<DictionaryValue> manifest; + scoped_ptr<base::DictionaryValue> manifest; // Test invalid JSON. manifest.reset( diff --git a/chrome/browser/extensions/convert_user_script.cc b/chrome/browser/extensions/convert_user_script.cc index 9725a64..0aa8910 100644 --- a/chrome/browser/extensions/convert_user_script.cc +++ b/chrome/browser/extensions/convert_user_script.cc @@ -65,7 +65,7 @@ scoped_refptr<Extension> ConvertUserScriptToExtension( } // Create the manifest - scoped_ptr<DictionaryValue> root(new DictionaryValue); + scoped_ptr<base::DictionaryValue> root(new base::DictionaryValue); std::string script_name; if (!script.name().empty() && !script.name_space().empty()) script_name = script.name_space() + "/" + script.name(); @@ -136,7 +136,7 @@ scoped_refptr<Extension> ConvertUserScriptToExtension( for (size_t i = 0; i < script.exclude_globs().size(); ++i) excludes->Append(new base::StringValue(script.exclude_globs().at(i))); - DictionaryValue* content_script = new DictionaryValue(); + base::DictionaryValue* content_script = new base::DictionaryValue(); content_script->Set(keys::kMatches, matches); content_script->Set(keys::kExcludeMatches, exclude_matches); content_script->Set(keys::kIncludeGlobs, includes); diff --git a/chrome/browser/extensions/convert_web_app.cc b/chrome/browser/extensions/convert_web_app.cc index f150fa5..54fe5dd 100644 --- a/chrome/browser/extensions/convert_web_app.cc +++ b/chrome/browser/extensions/convert_web_app.cc @@ -102,7 +102,7 @@ scoped_refptr<Extension> ConvertWebAppToExtension( } // Create the manifest - scoped_ptr<DictionaryValue> root(new DictionaryValue); + scoped_ptr<base::DictionaryValue> root(new base::DictionaryValue); if (!web_app.is_bookmark_app) root->SetString(keys::kPublicKey, GenerateKey(web_app.manifest_url)); else @@ -120,7 +120,7 @@ scoped_refptr<Extension> ConvertWebAppToExtension( root->SetString(keys::kLaunchContainer, web_app.launch_container); // Add the icons. - DictionaryValue* icons = new DictionaryValue(); + base::DictionaryValue* icons = new base::DictionaryValue(); root->Set(keys::kIcons, icons); for (size_t i = 0; i < web_app.icons.size(); ++i) { std::string size = base::StringPrintf("%i", web_app.icons[i].width); diff --git a/chrome/browser/extensions/crx_installer.cc b/chrome/browser/extensions/crx_installer.cc index 818fa8f..50aa891 100644 --- a/chrome/browser/extensions/crx_installer.cc +++ b/chrome/browser/extensions/crx_installer.cc @@ -429,11 +429,12 @@ void CrxInstaller::OnUnpackFailure(const base::string16& error_message) { ReportFailureFromFileThread(CrxInstallerError(error_message)); } -void CrxInstaller::OnUnpackSuccess(const base::FilePath& temp_dir, - const base::FilePath& extension_dir, - const DictionaryValue* original_manifest, - const Extension* extension, - const SkBitmap& install_icon) { +void CrxInstaller::OnUnpackSuccess( + const base::FilePath& temp_dir, + const base::FilePath& extension_dir, + const base::DictionaryValue* original_manifest, + const Extension* extension, + const SkBitmap& install_icon) { DCHECK(installer_task_runner_->RunsTasksOnCurrentThread()); UMA_HISTOGRAM_ENUMERATION("Extensions.UnpackSuccessInstallSource", @@ -452,7 +453,7 @@ void CrxInstaller::OnUnpackSuccess(const base::FilePath& temp_dir, if (original_manifest) original_manifest_.reset(new Manifest( Manifest::INVALID_LOCATION, - scoped_ptr<DictionaryValue>(original_manifest->DeepCopy()))); + scoped_ptr<base::DictionaryValue>(original_manifest->DeepCopy()))); // We don't have to delete the unpack dir explicity since it is a child of // the temp dir. diff --git a/chrome/browser/extensions/default_apps.cc b/chrome/browser/extensions/default_apps.cc index 4d01de3..b3cd3eb 100644 --- a/chrome/browser/extensions/default_apps.cc +++ b/chrome/browser/extensions/default_apps.cc @@ -161,7 +161,7 @@ void Provider::VisitRegisteredExtension() { void Provider::SetPrefs(base::DictionaryValue* prefs) { if (is_migration_) { std::set<std::string> new_default_apps; - for (DictionaryValue::Iterator i(*prefs); !i.IsAtEnd(); i.Advance()) { + for (base::DictionaryValue::Iterator i(*prefs); !i.IsAtEnd(); i.Advance()) { if (!IsOldDefaultApp(i.key())) new_default_apps.insert(i.key()); } diff --git a/chrome/browser/extensions/extension_action_icon_factory_unittest.cc b/chrome/browser/extensions/extension_action_icon_factory_unittest.cc index e8816bb..45a085a 100644 --- a/chrome/browser/extensions/extension_action_icon_factory_unittest.cc +++ b/chrome/browser/extensions/extension_action_icon_factory_unittest.cc @@ -110,9 +110,9 @@ class ExtensionActionIconFactoryTest int error_code = 0; std::string error; JSONFileValueSerializer serializer(test_file.AppendASCII("manifest.json")); - scoped_ptr<DictionaryValue> valid_value( - static_cast<DictionaryValue*>(serializer.Deserialize(&error_code, - &error))); + scoped_ptr<base::DictionaryValue> valid_value( + static_cast<base::DictionaryValue*>(serializer.Deserialize(&error_code, + &error))); EXPECT_EQ(0, error_code) << error; if (error_code != 0) return NULL; diff --git a/chrome/browser/extensions/extension_apitest.cc b/chrome/browser/extensions/extension_apitest.cc index 7c671ba..a317bac 100644 --- a/chrome/browser/extensions/extension_apitest.cc +++ b/chrome/browser/extensions/extension_apitest.cc @@ -207,7 +207,7 @@ void ExtensionApiTest::ResultCatcher::Observe( void ExtensionApiTest::SetUpInProcessBrowserTestFixture() { DCHECK(!test_config_.get()) << "Previous test did not clear config state."; - test_config_.reset(new DictionaryValue()); + test_config_.reset(new base::DictionaryValue()); test_config_->SetString(kTestDataDirectory, net::FilePathToFileURL(test_data_dir_).spec()); test_config_->SetInteger(kTestWebSocketPort, 0); diff --git a/chrome/browser/extensions/extension_apitest.h b/chrome/browser/extensions/extension_apitest.h index d069cae..9586f96 100644 --- a/chrome/browser/extensions/extension_apitest.h +++ b/chrome/browser/extensions/extension_apitest.h @@ -196,7 +196,7 @@ class ExtensionApiTest : public ExtensionBrowserTest { // Hold details of the test, set in C++, which can be accessed by // javascript using chrome.test.getConfig(). - scoped_ptr<DictionaryValue> test_config_; + scoped_ptr<base::DictionaryValue> test_config_; // Hold the test WebSocket server. scoped_ptr<net::SpawnedTestServer> websocket_server_; diff --git a/chrome/browser/extensions/extension_function_dispatcher.cc b/chrome/browser/extensions/extension_function_dispatcher.cc index 3f54f5b..22a0ae6 100644 --- a/chrome/browser/extensions/extension_function_dispatcher.cc +++ b/chrome/browser/extensions/extension_function_dispatcher.cc @@ -253,7 +253,7 @@ void ExtensionFunctionDispatcher::DispatchOnIOThread( extension_info_map->process_map(), g_global_io_data.Get().api.get(), browser_context, callback)); - scoped_ptr<ListValue> args(params.arguments.DeepCopy()); + scoped_ptr<base::ListValue> args(params.arguments.DeepCopy()); if (!function.get()) return; @@ -354,7 +354,7 @@ void ExtensionFunctionDispatcher::DispatchWithCallbackInternal( extensions::ExtensionAPI::GetSharedInstance(), browser_context_, callback)); - scoped_ptr<ListValue> args(params.arguments.DeepCopy()); + scoped_ptr<base::ListValue> args(params.arguments.DeepCopy()); if (!function.get()) return; @@ -513,7 +513,7 @@ ExtensionFunction* ExtensionFunctionDispatcher::CreateExtensionFunction( // static void ExtensionFunctionDispatcher::SendAccessDenied( const ExtensionFunction::ResponseCallback& callback) { - ListValue empty_list; + base::ListValue empty_list; callback.Run(ExtensionFunction::FAILED, empty_list, "Access to extension API denied."); } diff --git a/chrome/browser/extensions/extension_function_util.cc b/chrome/browser/extensions/extension_function_util.cc index cc1d3fc..4ff22af 100644 --- a/chrome/browser/extensions/extension_function_util.cc +++ b/chrome/browser/extensions/extension_function_util.cc @@ -7,14 +7,14 @@ namespace extensions { bool ReadOneOrMoreIntegers(base::Value* value, std::vector<int>* result) { - if (value->IsType(Value::TYPE_INTEGER)) { + if (value->IsType(base::Value::TYPE_INTEGER)) { int v = -1; if (!value->GetAsInteger(&v)) return false; result->push_back(v); return true; - } else if (value->IsType(Value::TYPE_LIST)) { + } else if (value->IsType(base::Value::TYPE_LIST)) { base::ListValue* values = static_cast<base::ListValue*>(value); for (size_t i = 0; i < values->GetSize(); ++i) { int v = -1; diff --git a/chrome/browser/extensions/extension_icon_image_unittest.cc b/chrome/browser/extensions/extension_icon_image_unittest.cc index da1e354..53bda30 100644 --- a/chrome/browser/extensions/extension_icon_image_unittest.cc +++ b/chrome/browser/extensions/extension_icon_image_unittest.cc @@ -153,9 +153,9 @@ class ExtensionIconImageTest : public testing::Test, int error_code = 0; std::string error; JSONFileValueSerializer serializer(test_file.AppendASCII("app.json")); - scoped_ptr<DictionaryValue> valid_value( - static_cast<DictionaryValue*>(serializer.Deserialize(&error_code, - &error))); + scoped_ptr<base::DictionaryValue> valid_value( + static_cast<base::DictionaryValue*>(serializer.Deserialize(&error_code, + &error))); EXPECT_EQ(0, error_code) << error; if (error_code != 0) return NULL; diff --git a/chrome/browser/extensions/extension_icon_manager_unittest.cc b/chrome/browser/extensions/extension_icon_manager_unittest.cc index 8fcf7f9..07b142e 100644 --- a/chrome/browser/extensions/extension_icon_manager_unittest.cc +++ b/chrome/browser/extensions/extension_icon_manager_unittest.cc @@ -109,8 +109,8 @@ TEST_F(ExtensionIconManagerTest, LoadRemoveLoad) { "extensions/image_loading_tracker/app.json"); JSONFileValueSerializer serializer(manifest_path); - scoped_ptr<DictionaryValue> manifest( - static_cast<DictionaryValue*>(serializer.Deserialize(NULL, NULL))); + scoped_ptr<base::DictionaryValue> manifest( + static_cast<base::DictionaryValue*>(serializer.Deserialize(NULL, NULL))); ASSERT_TRUE(manifest.get() != NULL); std::string error; @@ -151,8 +151,8 @@ TEST_F(ExtensionIconManagerTest, LoadComponentExtensionResource) { "extensions/file_manager/app.json"); JSONFileValueSerializer serializer(manifest_path); - scoped_ptr<DictionaryValue> manifest( - static_cast<DictionaryValue*>(serializer.Deserialize(NULL, NULL))); + scoped_ptr<base::DictionaryValue> manifest( + static_cast<base::DictionaryValue*>(serializer.Deserialize(NULL, NULL))); ASSERT_TRUE(manifest.get() != NULL); std::string error; diff --git a/chrome/browser/extensions/extension_install_prompt.cc b/chrome/browser/extensions/extension_install_prompt.cc index 6690ae2..db6c471 100644 --- a/chrome/browser/extensions/extension_install_prompt.cc +++ b/chrome/browser/extensions/extension_install_prompt.cc @@ -494,13 +494,13 @@ ExtensionInstallPrompt::ShowParams::ShowParams( // static scoped_refptr<Extension> ExtensionInstallPrompt::GetLocalizedExtensionForDisplay( - const DictionaryValue* manifest, + const base::DictionaryValue* manifest, int flags, const std::string& id, const std::string& localized_name, const std::string& localized_description, std::string* error) { - scoped_ptr<DictionaryValue> localized_manifest; + scoped_ptr<base::DictionaryValue> localized_manifest; if (!localized_name.empty() || !localized_description.empty()) { localized_manifest.reset(manifest->DeepCopy()); if (!localized_name.empty()) { diff --git a/chrome/browser/extensions/extension_messages_apitest.cc b/chrome/browser/extensions/extension_messages_apitest.cc index 1cbbf0b..dc4bd16 100644 --- a/chrome/browser/extensions/extension_messages_apitest.cc +++ b/chrome/browser/extensions/extension_messages_apitest.cc @@ -52,7 +52,7 @@ class MessageSender : public content::NotificationObserver { static scoped_ptr<base::ListValue> BuildEventArguments( const bool last_message, const std::string& data) { - DictionaryValue* event = new DictionaryValue(); + base::DictionaryValue* event = new base::DictionaryValue(); event->SetBoolean("lastMessage", last_message); event->SetString("data", data); scoped_ptr<base::ListValue> arguments(new base::ListValue()); diff --git a/chrome/browser/extensions/extension_override_apitest.cc b/chrome/browser/extensions/extension_override_apitest.cc index 13a330d..db21578 100644 --- a/chrome/browser/extensions/extension_override_apitest.cc +++ b/chrome/browser/extensions/extension_override_apitest.cc @@ -23,7 +23,7 @@ class ExtensionOverrideTest : public ExtensionApiTest { protected: bool CheckHistoryOverridesContainsNoDupes() { // There should be no duplicate entries in the preferences. - const DictionaryValue* overrides = + const base::DictionaryValue* overrides = browser()->profile()->GetPrefs()->GetDictionary( ExtensionWebUI::kExtensionURLOverrides); diff --git a/chrome/browser/extensions/extension_pref_store.cc b/chrome/browser/extensions/extension_pref_store.cc index 67beed1..281e0e1 100644 --- a/chrome/browser/extensions/extension_pref_store.cc +++ b/chrome/browser/extensions/extension_pref_store.cc @@ -21,7 +21,7 @@ void ExtensionPrefStore::OnInitializationCompleted() { void ExtensionPrefStore::OnPrefValueChanged(const std::string& key) { CHECK(extension_pref_value_map_); - const Value *winner = + const base::Value *winner = extension_pref_value_map_->GetEffectivePrefValue(key, incognito_pref_store_, NULL); diff --git a/chrome/browser/extensions/extension_pref_value_map.cc b/chrome/browser/extensions/extension_pref_value_map.cc index a796bd3..bcc4380 100644 --- a/chrome/browser/extensions/extension_pref_value_map.cc +++ b/chrome/browser/extensions/extension_pref_value_map.cc @@ -48,7 +48,7 @@ void ExtensionPrefValueMap::Shutdown() { void ExtensionPrefValueMap::SetExtensionPref(const std::string& ext_id, const std::string& key, ExtensionPrefsScope scope, - Value* value) { + base::Value* value) { PrefValueMap* prefs = GetExtensionPrefValueMap(ext_id, scope); if (prefs->SetValue(key, value)) @@ -217,7 +217,7 @@ void ExtensionPrefValueMap::GetExtensionControlledKeys( out->insert(i->first); } -const Value* ExtensionPrefValueMap::GetEffectivePrefValue( +const base::Value* ExtensionPrefValueMap::GetEffectivePrefValue( const std::string& key, bool incognito, bool* from_incognito) const { @@ -226,7 +226,7 @@ const Value* ExtensionPrefValueMap::GetEffectivePrefValue( if (winner == entries_.end()) return NULL; - const Value* value = NULL; + const base::Value* value = NULL; const std::string& ext_id = winner->first; // First search for incognito session only preferences. @@ -280,7 +280,7 @@ ExtensionPrefValueMap::GetEffectivePrefValueController( if (install_time < winners_install_time) continue; - const Value* value = NULL; + const base::Value* value = NULL; const PrefValueMap* prefs = GetExtensionPrefValueMap( ext_id, extensions::kExtensionPrefsScopeRegular); if (prefs->GetValue(key, &value)) { diff --git a/chrome/browser/extensions/extension_pref_value_map_unittest.cc b/chrome/browser/extensions/extension_pref_value_map_unittest.cc index c4d367f..4b8db2f 100644 --- a/chrome/browser/extensions/extension_pref_value_map_unittest.cc +++ b/chrome/browser/extensions/extension_pref_value_map_unittest.cc @@ -22,7 +22,7 @@ const char kPref3[] = "path3"; const char kPref4[] = "path4"; } // namespace -static Value* CreateVal(const char* str) { +static base::Value* CreateVal(const char* str) { return new base::StringValue(str); } @@ -44,7 +44,8 @@ class ExtensionPrefValueMapTestBase : public BASECLASS { // Returns an empty string if the key is not set. std::string GetValue(const char * key, bool incognito) const { - const Value *value = epvm_.GetEffectivePrefValue(key, incognito, NULL); + const base::Value *value = + epvm_.GetEffectivePrefValue(key, incognito, NULL); std::string string_value; if (value) value->GetAsString(&string_value); diff --git a/chrome/browser/extensions/extension_prefs.cc b/chrome/browser/extensions/extension_prefs.cc index bf2dfee..f609af4 100644 --- a/chrome/browser/extensions/extension_prefs.cc +++ b/chrome/browser/extensions/extension_prefs.cc @@ -189,12 +189,12 @@ class ScopedExtensionPrefUpdate : public DictionaryPrefUpdate { } // DictionaryPrefUpdate overrides: - virtual DictionaryValue* Get() OVERRIDE { - DictionaryValue* dict = DictionaryPrefUpdate::Get(); - DictionaryValue* extension = NULL; + virtual base::DictionaryValue* Get() OVERRIDE { + base::DictionaryValue* dict = DictionaryPrefUpdate::Get(); + base::DictionaryValue* extension = NULL; if (!dict->GetDictionary(extension_id_, &extension)) { // Extension pref does not exist, create it. - extension = new DictionaryValue(); + extension = new base::DictionaryValue(); dict->SetWithoutPathExpansion(extension_id_, extension); } return extension; @@ -210,10 +210,10 @@ std::string JoinPrefs(const std::string& parent, const char* child) { return parent + "." + child; } -// Checks if kPrefBlacklist is set to true in the DictionaryValue. +// Checks if kPrefBlacklist is set to true in the base::DictionaryValue. // Return false if the value is false or kPrefBlacklist does not exist. // This is used to decide if an extension is blacklisted. -bool IsBlacklistBitSet(const DictionaryValue* ext) { +bool IsBlacklistBitSet(const base::DictionaryValue* ext) { bool bool_value; return ext->GetBoolean(kPrefBlacklist, &bool_value) && bool_value; } @@ -254,9 +254,9 @@ ExtensionPrefs::ScopedUpdate<T, type_enum_value>::~ScopedUpdate() { template <typename T, base::Value::Type type_enum_value> T* ExtensionPrefs::ScopedUpdate<T, type_enum_value>::Get() { - DictionaryValue* dict = update_.Get(); - DictionaryValue* extension = NULL; - Value* key_value = NULL; + base::DictionaryValue* dict = update_.Get(); + base::DictionaryValue* extension = NULL; + base::Value* key_value = NULL; if (!dict->GetDictionary(extension_id_, &extension) || !extension->Get(key_, &key_value)) { return NULL; @@ -268,9 +268,9 @@ T* ExtensionPrefs::ScopedUpdate<T, type_enum_value>::Get() { template <typename T, base::Value::Type type_enum_value> T* ExtensionPrefs::ScopedUpdate<T, type_enum_value>::Create() { - DictionaryValue* dict = update_.Get(); - DictionaryValue* extension = NULL; - Value* key_value = NULL; + base::DictionaryValue* dict = update_.Get(); + base::DictionaryValue* extension = NULL; + base::Value* key_value = NULL; T* value_as_t = NULL; if (!dict->GetDictionary(extension_id_, &extension)) { extension = new base::DictionaryValue; @@ -287,9 +287,10 @@ T* ExtensionPrefs::ScopedUpdate<T, type_enum_value>::Create() { } // Explicit instantiations for Dictionary and List value types. -template class ExtensionPrefs::ScopedUpdate<DictionaryValue, - Value::TYPE_DICTIONARY>; -template class ExtensionPrefs::ScopedUpdate<ListValue, Value::TYPE_LIST>; +template class ExtensionPrefs::ScopedUpdate<base::DictionaryValue, + base::Value::TYPE_DICTIONARY>; +template class ExtensionPrefs::ScopedUpdate<base::ListValue, + base::Value::TYPE_LIST>; // // ExtensionPrefs @@ -348,14 +349,15 @@ static base::FilePath::StringType MakePathRelative(const base::FilePath& parent, } void ExtensionPrefs::MakePathsRelative() { - const DictionaryValue* dict = prefs_->GetDictionary(prefs::kExtensionsPref); + const base::DictionaryValue* dict = + prefs_->GetDictionary(prefs::kExtensionsPref); if (!dict || dict->empty()) return; // Collect all extensions ids with absolute paths in |absolute_keys|. std::set<std::string> absolute_keys; - for (DictionaryValue::Iterator i(*dict); !i.IsAtEnd(); i.Advance()) { - const DictionaryValue* extension_dict = NULL; + for (base::DictionaryValue::Iterator i(*dict); !i.IsAtEnd(); i.Advance()) { + const base::DictionaryValue* extension_dict = NULL; if (!i.value().GetAsDictionary(&extension_dict)) continue; int location_value; @@ -377,10 +379,10 @@ void ExtensionPrefs::MakePathsRelative() { // Fix these paths. DictionaryPrefUpdate update(prefs_, prefs::kExtensionsPref); - DictionaryValue* update_dict = update.Get(); + base::DictionaryValue* update_dict = update.Get(); for (std::set<std::string>::iterator i = absolute_keys.begin(); i != absolute_keys.end(); ++i) { - DictionaryValue* extension_dict = NULL; + base::DictionaryValue* extension_dict = NULL; if (!update_dict->GetDictionaryWithoutPathExpansion(*i, &extension_dict)) { NOTREACHED() << "Control should never reach here for extension " << *i; continue; @@ -393,11 +395,11 @@ void ExtensionPrefs::MakePathsRelative() { } } -const DictionaryValue* ExtensionPrefs::GetExtensionPref( +const base::DictionaryValue* ExtensionPrefs::GetExtensionPref( const std::string& extension_id) const { - const DictionaryValue* extensions = + const base::DictionaryValue* extensions = prefs_->GetDictionary(prefs::kExtensionsPref); - const DictionaryValue* extension_dict = NULL; + const base::DictionaryValue* extension_dict = NULL; if (!extensions || !extensions->GetDictionary(extension_id, &extension_dict)) { return NULL; @@ -407,7 +409,7 @@ const DictionaryValue* ExtensionPrefs::GetExtensionPref( void ExtensionPrefs::UpdateExtensionPref(const std::string& extension_id, const std::string& key, - Value* data_value) { + base::Value* data_value) { if (!Extension::IdIsValid(extension_id)) { NOTREACHED() << "Invalid extension_id " << extension_id; return; @@ -423,14 +425,14 @@ void ExtensionPrefs::DeleteExtensionPrefs(const std::string& extension_id) { extension_pref_value_map_->UnregisterExtension(extension_id); content_settings_store_->UnregisterExtension(extension_id); DictionaryPrefUpdate update(prefs_, prefs::kExtensionsPref); - DictionaryValue* dict = update.Get(); + base::DictionaryValue* dict = update.Get(); dict->Remove(extension_id, NULL); } bool ExtensionPrefs::ReadPrefAsBoolean(const std::string& extension_id, const std::string& pref_key, bool* out_value) const { - const DictionaryValue* ext = GetExtensionPref(extension_id); + const base::DictionaryValue* ext = GetExtensionPref(extension_id); if (!ext || !ext->GetBoolean(pref_key, out_value)) return false; @@ -440,7 +442,7 @@ bool ExtensionPrefs::ReadPrefAsBoolean(const std::string& extension_id, bool ExtensionPrefs::ReadPrefAsInteger(const std::string& extension_id, const std::string& pref_key, int* out_value) const { - const DictionaryValue* ext = GetExtensionPref(extension_id); + const base::DictionaryValue* ext = GetExtensionPref(extension_id); if (!ext || !ext->GetInteger(pref_key, out_value)) return false; @@ -450,7 +452,7 @@ bool ExtensionPrefs::ReadPrefAsInteger(const std::string& extension_id, bool ExtensionPrefs::ReadPrefAsString(const std::string& extension_id, const std::string& pref_key, std::string* out_value) const { - const DictionaryValue* ext = GetExtensionPref(extension_id); + const base::DictionaryValue* ext = GetExtensionPref(extension_id); if (!ext || !ext->GetString(pref_key, out_value)) return false; @@ -459,9 +461,9 @@ bool ExtensionPrefs::ReadPrefAsString(const std::string& extension_id, bool ExtensionPrefs::ReadPrefAsList(const std::string& extension_id, const std::string& pref_key, - const ListValue** out_value) const { - const DictionaryValue* ext = GetExtensionPref(extension_id); - const ListValue* out = NULL; + const base::ListValue** out_value) const { + const base::DictionaryValue* ext = GetExtensionPref(extension_id); + const base::ListValue* out = NULL; if (!ext || !ext->GetList(pref_key, &out)) return false; if (out_value) @@ -473,9 +475,9 @@ bool ExtensionPrefs::ReadPrefAsList(const std::string& extension_id, bool ExtensionPrefs::ReadPrefAsDictionary( const std::string& extension_id, const std::string& pref_key, - const DictionaryValue** out_value) const { - const DictionaryValue* ext = GetExtensionPref(extension_id); - const DictionaryValue* out = NULL; + const base::DictionaryValue** out_value) const { + const base::DictionaryValue* ext = GetExtensionPref(extension_id); + const base::DictionaryValue* out = NULL; if (!ext || !ext->GetDictionary(pref_key, &out)) return false; if (out_value) @@ -493,7 +495,7 @@ bool ExtensionPrefs::ReadPrefAsURLPatternSet(const std::string& extension_id, const std::string& pref_key, URLPatternSet* result, int valid_schemes) { - const ListValue* value = NULL; + const base::ListValue* value = NULL; if (!ReadPrefAsList(extension_id, pref_key, &value)) return false; @@ -524,7 +526,7 @@ PermissionSet* ExtensionPrefs::ReadPrefAsPermissionSet( // Retrieve the API permissions. Please refer SetExtensionPrefPermissionSet() // for api_values format. APIPermissionSet apis; - const ListValue* api_values = NULL; + const base::ListValue* api_values = NULL; std::string api_pref = JoinPrefs(pref_key, kPrefAPIs); if (ReadPrefAsList(extension_id, api_pref, &api_values)) { APIPermissionSet::ParseFromJSON(api_values, @@ -535,7 +537,7 @@ PermissionSet* ExtensionPrefs::ReadPrefAsPermissionSet( // Retrieve the Manifest Keys permissions. Please refer to // |SetExtensionPrefPermissionSet| for manifest_permissions_values format. ManifestPermissionSet manifest_permissions; - const ListValue* manifest_permissions_values = NULL; + const base::ListValue* manifest_permissions_values = NULL; std::string manifest_permission_pref = JoinPrefs(pref_key, kPrefManifestPermissions); if (ReadPrefAsList(extension_id, manifest_permission_pref, @@ -569,13 +571,13 @@ PermissionSet* ExtensionPrefs::ReadPrefAsPermissionSet( // ... // ] template<typename T> -static ListValue* CreatePermissionList(const T& permissions) { - ListValue* values = new ListValue(); +static base::ListValue* CreatePermissionList(const T& permissions) { + base::ListValue* values = new base::ListValue(); for (typename T::const_iterator i = permissions.begin(); i != permissions.end(); ++i) { - scoped_ptr<Value> detail(i->ToValue()); + scoped_ptr<base::Value> detail(i->ToValue()); if (detail) { - DictionaryValue* tmp = new DictionaryValue(); + base::DictionaryValue* tmp = new base::DictionaryValue(); tmp->Set(i->name(), detail.release()); values->Append(tmp); } else { @@ -590,12 +592,12 @@ void ExtensionPrefs::SetExtensionPrefPermissionSet( const std::string& pref_key, const PermissionSet* new_value) { std::string api_pref = JoinPrefs(pref_key, kPrefAPIs); - ListValue* api_values = CreatePermissionList(new_value->apis()); + base::ListValue* api_values = CreatePermissionList(new_value->apis()); UpdateExtensionPref(extension_id, api_pref, api_values); std::string manifest_permissions_pref = JoinPrefs(pref_key, kPrefManifestPermissions); - ListValue* manifest_permissions_values = CreatePermissionList( + base::ListValue* manifest_permissions_values = CreatePermissionList( new_value->manifest_permissions()); UpdateExtensionPref(extension_id, manifest_permissions_pref, @@ -673,7 +675,7 @@ void ExtensionPrefs::SetWipeoutAcknowledged( const std::string& extension_id, bool value) { UpdateExtensionPref(extension_id, kPrefWipeoutAcknowledged, - value ? Value::CreateBooleanValue(value) : NULL); + value ? base::Value::CreateBooleanValue(value) : NULL); } bool ExtensionPrefs::SetAlertSystemFirstRun() { @@ -738,18 +740,21 @@ void ExtensionPrefs::ClearDisableReasons(const std::string& extension_id) { std::set<std::string> ExtensionPrefs::GetBlacklistedExtensions() { std::set<std::string> ids; - const DictionaryValue* extensions = + const base::DictionaryValue* extensions = prefs_->GetDictionary(prefs::kExtensionsPref); if (!extensions) return ids; - for (DictionaryValue::Iterator it(*extensions); !it.IsAtEnd(); it.Advance()) { - if (!it.value().IsType(Value::TYPE_DICTIONARY)) { + for (base::DictionaryValue::Iterator it(*extensions); + !it.IsAtEnd(); it.Advance()) { + if (!it.value().IsType(base::Value::TYPE_DICTIONARY)) { NOTREACHED() << "Invalid pref for extension " << it.key(); continue; } - if (IsBlacklistBitSet(static_cast<const DictionaryValue*>(&it.value()))) + if (IsBlacklistBitSet( + static_cast<const base::DictionaryValue*>(&it.value()))) { ids.insert(it.key()); + } } return ids; @@ -775,21 +780,21 @@ void ExtensionPrefs::SetExtensionBlacklisted(const std::string& extension_id, new base::FundamentalValue(true)); } else { UpdateExtensionPref(extension_id, kPrefBlacklist, NULL); - const DictionaryValue* dict = GetExtensionPref(extension_id); + const base::DictionaryValue* dict = GetExtensionPref(extension_id); if (dict && dict->empty()) DeleteExtensionPrefs(extension_id); } } bool ExtensionPrefs::IsExtensionBlacklisted(const std::string& id) const { - const DictionaryValue* ext_prefs = GetExtensionPref(id); + const base::DictionaryValue* ext_prefs = GetExtensionPref(id); return ext_prefs && IsBlacklistBitSet(ext_prefs); } namespace { // Serializes |time| as a string value mapped to |key| in |dictionary|. -void SaveTime(DictionaryValue* dictionary, +void SaveTime(base::DictionaryValue* dictionary, const char* key, const base::Time& time) { if (!dictionary) @@ -800,7 +805,7 @@ void SaveTime(DictionaryValue* dictionary, // The opposite of SaveTime. If |key| is not found, this returns an empty Time // (is_null() will return true). -base::Time ReadTime(const DictionaryValue* dictionary, const char* key) { +base::Time ReadTime(const base::DictionaryValue* dictionary, const char* key) { if (!dictionary) return base::Time(); std::string string_value; @@ -850,7 +855,7 @@ void ExtensionPrefs::SetLastActivePingDay(const std::string& extension_id, } bool ExtensionPrefs::GetActiveBit(const std::string& extension_id) { - const DictionaryValue* dictionary = GetExtensionPref(extension_id); + const base::DictionaryValue* dictionary = GetExtensionPref(extension_id); bool result = false; if (dictionary && dictionary->GetBoolean(kActiveBit, &result)) return result; @@ -872,25 +877,25 @@ void ExtensionPrefs::MigratePermissions(const ExtensionIdList& extension_ids) { // full_access bit is present. This bit was always present in the previous // scheme and is never present now. bool full_access; - const DictionaryValue* ext = GetExtensionPref(*ext_id); + const base::DictionaryValue* ext = GetExtensionPref(*ext_id); if (!ext || !ext->GetBoolean(kPrefOldGrantedFullAccess, &full_access)) continue; // Remove the full access bit (empty list will get trimmed). UpdateExtensionPref( - *ext_id, kPrefOldGrantedFullAccess, new ListValue()); + *ext_id, kPrefOldGrantedFullAccess, new base::ListValue()); // Add the plugin permission if the full access bit was set. if (full_access) { - const ListValue* apis = NULL; - ListValue* new_apis = NULL; + const base::ListValue* apis = NULL; + base::ListValue* new_apis = NULL; std::string granted_apis = JoinPrefs(kPrefGrantedPermissions, kPrefAPIs); if (ext->GetList(kPrefOldGrantedAPIs, &apis)) new_apis = apis->DeepCopy(); else - new_apis = new ListValue(); + new_apis = new base::ListValue(); std::string plugin_name = info->GetByID( APIPermission::kPlugin)->name(); @@ -904,7 +909,7 @@ void ExtensionPrefs::MigratePermissions(const ExtensionIdList& extension_ids) { // does not matter how we treat the old effective hosts as long as the // new effective hosts will be the same, so we move them to explicit // host permissions. - const ListValue* hosts = NULL; + const base::ListValue* hosts = NULL; std::string explicit_hosts = JoinPrefs(kPrefGrantedPermissions, kPrefExplicitHosts); if (ext->GetList(kPrefOldGrantedHosts, &hosts)) { @@ -912,7 +917,7 @@ void ExtensionPrefs::MigratePermissions(const ExtensionIdList& extension_ids) { *ext_id, explicit_hosts, hosts->DeepCopy()); // We can get rid of the old one by setting it to an empty list. - UpdateExtensionPref(*ext_id, kPrefOldGrantedHosts, new ListValue()); + UpdateExtensionPref(*ext_id, kPrefOldGrantedHosts, new base::ListValue()); } } } @@ -1001,12 +1006,12 @@ void ExtensionPrefs::SetActivePermissions( void ExtensionPrefs::SetExtensionRunning(const std::string& extension_id, bool is_running) { - Value* value = new base::FundamentalValue(is_running); + base::Value* value = new base::FundamentalValue(is_running); UpdateExtensionPref(extension_id, kPrefRunning, value); } bool ExtensionPrefs::IsExtensionRunning(const std::string& extension_id) { - const DictionaryValue* extension = GetExtensionPref(extension_id); + const base::DictionaryValue* extension = GetExtensionPref(extension_id); if (!extension) return false; bool running = false; @@ -1016,12 +1021,12 @@ bool ExtensionPrefs::IsExtensionRunning(const std::string& extension_id) { void ExtensionPrefs::SetIsActive(const std::string& extension_id, bool is_active) { - Value* value = new base::FundamentalValue(is_active); + base::Value* value = new base::FundamentalValue(is_active); UpdateExtensionPref(extension_id, kIsActive, value); } bool ExtensionPrefs::IsActive(const std::string& extension_id) { - const DictionaryValue* extension = GetExtensionPref(extension_id); + const base::DictionaryValue* extension = GetExtensionPref(extension_id); if (!extension) return false; bool is_active = false; @@ -1051,13 +1056,13 @@ void ExtensionPrefs::SetAllowFileAccess(const std::string& extension_id, bool ExtensionPrefs::HasAllowFileAccessSetting( const std::string& extension_id) const { - const DictionaryValue* ext = GetExtensionPref(extension_id); + const base::DictionaryValue* ext = GetExtensionPref(extension_id); return ext && ext->HasKey(kPrefAllowFileAccess); } bool ExtensionPrefs::DoesExtensionHaveState( const std::string& id, Extension::State check_state) const { - const DictionaryValue* extension = GetExtensionPref(id); + const base::DictionaryValue* extension = GetExtensionPref(id); int state = -1; if (!extension || !extension->GetInteger(kPrefState, &state)) return false; @@ -1105,7 +1110,7 @@ void ExtensionPrefs::OnExtensionInstalled( bool blacklisted_for_malware, const syncer::StringOrdinal& page_ordinal) { ScopedExtensionPrefUpdate update(prefs_, extension->id()); - DictionaryValue* extension_dict = update.Get(); + base::DictionaryValue* extension_dict = update.Get(); const base::Time install_time = time_provider_->GetCurrentTime(); PopulateExtensionInfoPrefs(extension, install_time, initial_state, blacklisted_for_malware, extension_dict); @@ -1144,7 +1149,7 @@ void ExtensionPrefs::SetExtensionState(const std::string& extension_id, } std::string ExtensionPrefs::GetVersionString(const std::string& extension_id) { - const DictionaryValue* extension = GetExtensionPref(extension_id); + const base::DictionaryValue* extension = GetExtensionPref(extension_id); if (!extension) return std::string(); @@ -1156,11 +1161,11 @@ std::string ExtensionPrefs::GetVersionString(const std::string& extension_id) { void ExtensionPrefs::UpdateManifest(const Extension* extension) { if (!Manifest::IsUnpackedLocation(extension->location())) { - const DictionaryValue* extension_dict = + const base::DictionaryValue* extension_dict = GetExtensionPref(extension->id()); if (!extension_dict) return; - const DictionaryValue* old_manifest = NULL; + const base::DictionaryValue* old_manifest = NULL; bool update_required = !extension_dict->GetDictionary(kPrefManifest, &old_manifest) || !extension->manifest()->value()->Equals(old_manifest); @@ -1173,7 +1178,7 @@ void ExtensionPrefs::UpdateManifest(const Extension* extension) { base::FilePath ExtensionPrefs::GetExtensionPath( const std::string& extension_id) { - const DictionaryValue* dict = GetExtensionPref(extension_id); + const base::DictionaryValue* dict = GetExtensionPref(extension_id); if (!dict) return base::FilePath(); @@ -1186,7 +1191,7 @@ base::FilePath ExtensionPrefs::GetExtensionPath( scoped_ptr<ExtensionInfo> ExtensionPrefs::GetInstalledInfoHelper( const std::string& extension_id, - const DictionaryValue* extension) const { + const base::DictionaryValue* extension) const { int location_value; if (!extension->GetInteger(kPrefLocation, &location_value)) return scoped_ptr<ExtensionInfo>(); @@ -1212,7 +1217,7 @@ scoped_ptr<ExtensionInfo> ExtensionPrefs::GetInstalledInfoHelper( return scoped_ptr<ExtensionInfo>(); } - const DictionaryValue* manifest = NULL; + const base::DictionaryValue* manifest = NULL; if (!Manifest::IsUnpackedLocation(location) && !extension->GetDictionary(kPrefManifest, &manifest)) { LOG(WARNING) << "Missing manifest for extension " << extension_id; @@ -1225,8 +1230,8 @@ scoped_ptr<ExtensionInfo> ExtensionPrefs::GetInstalledInfoHelper( scoped_ptr<ExtensionInfo> ExtensionPrefs::GetInstalledExtensionInfo( const std::string& extension_id) const { - const DictionaryValue* ext = NULL; - const DictionaryValue* extensions = + const base::DictionaryValue* ext = NULL; + const base::DictionaryValue* extensions = prefs_->GetDictionary(prefs::kExtensionsPref); if (!extensions || !extensions->GetDictionaryWithoutPathExpansion(extension_id, &ext)) @@ -1251,9 +1256,9 @@ scoped_ptr<ExtensionPrefs::ExtensionsInfo> ExtensionPrefs::GetInstalledExtensionsInfo() const { scoped_ptr<ExtensionsInfo> extensions_info(new ExtensionsInfo); - const DictionaryValue* extensions = + const base::DictionaryValue* extensions = prefs_->GetDictionary(prefs::kExtensionsPref); - for (DictionaryValue::Iterator extension_id(*extensions); + for (base::DictionaryValue::Iterator extension_id(*extensions); !extension_id.IsAtEnd(); extension_id.Advance()) { if (!Extension::IdIsValid(extension_id.key())) continue; @@ -1271,11 +1276,11 @@ scoped_ptr<ExtensionPrefs::ExtensionsInfo> ExtensionPrefs::GetUninstalledExtensionsInfo() const { scoped_ptr<ExtensionsInfo> extensions_info(new ExtensionsInfo); - const DictionaryValue* extensions = + const base::DictionaryValue* extensions = prefs_->GetDictionary(prefs::kExtensionsPref); - for (DictionaryValue::Iterator extension_id(*extensions); + for (base::DictionaryValue::Iterator extension_id(*extensions); !extension_id.IsAtEnd(); extension_id.Advance()) { - const DictionaryValue* ext = NULL; + const base::DictionaryValue* ext = NULL; if (!Extension::IdIsValid(extension_id.key()) || !IsExternalExtensionUninstalled(extension_id.key()) || !extension_id.value().GetAsDictionary(&ext)) @@ -1296,7 +1301,7 @@ void ExtensionPrefs::SetDelayedInstallInfo( bool blacklisted_for_malware, DelayReason delay_reason, const syncer::StringOrdinal& page_ordinal) { - DictionaryValue* extension_dict = new DictionaryValue(); + base::DictionaryValue* extension_dict = new base::DictionaryValue(); PopulateExtensionInfoPrefs(extension, time_provider_->GetCurrentTime(), initial_state, blacklisted_for_malware, extension_dict); @@ -1329,8 +1334,8 @@ bool ExtensionPrefs::FinishDelayedInstallInfo( const std::string& extension_id) { CHECK(Extension::IdIsValid(extension_id)); ScopedExtensionPrefUpdate update(prefs_, extension_id); - DictionaryValue* extension_dict = update.Get(); - DictionaryValue* pending_install_dict = NULL; + base::DictionaryValue* extension_dict = update.Get(); + base::DictionaryValue* pending_install_dict = NULL; if (!extension_dict->GetDictionary(kDelayedInstallInfo, &pending_install_dict)) { return false; @@ -1356,7 +1361,7 @@ bool ExtensionPrefs::FinishDelayedInstallInfo( base::Int64ToString(install_time.ToInternalValue()))); // Commit the delayed install data. - for (DictionaryValue::Iterator it(*pending_install_dict); !it.IsAtEnd(); + for (base::DictionaryValue::Iterator it(*pending_install_dict); !it.IsAtEnd(); it.Advance()) { extension_dict->Set(it.key(), it.value().DeepCopy()); } @@ -1367,12 +1372,12 @@ bool ExtensionPrefs::FinishDelayedInstallInfo( scoped_ptr<ExtensionInfo> ExtensionPrefs::GetDelayedInstallInfo( const std::string& extension_id) const { - const DictionaryValue* extension_prefs = + const base::DictionaryValue* extension_prefs = GetExtensionPref(extension_id); if (!extension_prefs) return scoped_ptr<ExtensionInfo>(); - const DictionaryValue* ext = NULL; + const base::DictionaryValue* ext = NULL; if (!extension_prefs->GetDictionary(kDelayedInstallInfo, &ext)) return scoped_ptr<ExtensionInfo>(); @@ -1381,12 +1386,12 @@ scoped_ptr<ExtensionInfo> ExtensionPrefs::GetDelayedInstallInfo( ExtensionPrefs::DelayReason ExtensionPrefs::GetDelayedInstallReason( const std::string& extension_id) const { - const DictionaryValue* extension_prefs = + const base::DictionaryValue* extension_prefs = GetExtensionPref(extension_id); if (!extension_prefs) return DELAY_REASON_NONE; - const DictionaryValue* ext = NULL; + const base::DictionaryValue* ext = NULL; if (!extension_prefs->GetDictionary(kDelayedInstallInfo, &ext)) return DELAY_REASON_NONE; @@ -1401,9 +1406,9 @@ scoped_ptr<ExtensionPrefs::ExtensionsInfo> ExtensionPrefs:: GetAllDelayedInstallInfo() const { scoped_ptr<ExtensionsInfo> extensions_info(new ExtensionsInfo); - const DictionaryValue* extensions = + const base::DictionaryValue* extensions = prefs_->GetDictionary(prefs::kExtensionsPref); - for (DictionaryValue::Iterator extension_id(*extensions); + for (base::DictionaryValue::Iterator extension_id(*extensions); !extension_id.IsAtEnd(); extension_id.Advance()) { if (!Extension::IdIsValid(extension_id.key())) continue; @@ -1427,7 +1432,7 @@ void ExtensionPrefs::SetAppDraggedByUser(const std::string& extension_id) { bool ExtensionPrefs::IsFromWebStore( const std::string& extension_id) const { - const DictionaryValue* dictionary = GetExtensionPref(extension_id); + const base::DictionaryValue* dictionary = GetExtensionPref(extension_id); bool result = false; if (dictionary && dictionary->GetBoolean(kPrefFromWebStore, &result)) return result; @@ -1436,7 +1441,7 @@ bool ExtensionPrefs::IsFromWebStore( bool ExtensionPrefs::IsFromBookmark( const std::string& extension_id) const { - const DictionaryValue* dictionary = GetExtensionPref(extension_id); + const base::DictionaryValue* dictionary = GetExtensionPref(extension_id); bool result = false; if (dictionary && dictionary->GetBoolean(kPrefFromBookmark, &result)) return result; @@ -1461,7 +1466,7 @@ int ExtensionPrefs::GetCreationFlags(const std::string& extension_id) const { int ExtensionPrefs::GetDelayedInstallCreationFlags( const std::string& extension_id) const { int creation_flags = Extension::NO_FLAGS; - const DictionaryValue* delayed_info = NULL; + const base::DictionaryValue* delayed_info = NULL; if (ReadPrefAsDictionary(extension_id, kDelayedInstallInfo, &delayed_info)) { delayed_info->GetInteger(kPrefCreationFlags, &creation_flags); } @@ -1470,7 +1475,7 @@ int ExtensionPrefs::GetDelayedInstallCreationFlags( bool ExtensionPrefs::WasInstalledByDefault( const std::string& extension_id) const { - const DictionaryValue* dictionary = GetExtensionPref(extension_id); + const base::DictionaryValue* dictionary = GetExtensionPref(extension_id); bool result = false; if (dictionary && dictionary->GetBoolean(kPrefWasInstalledByDefault, &result)) @@ -1480,7 +1485,7 @@ bool ExtensionPrefs::WasInstalledByDefault( base::Time ExtensionPrefs::GetInstallTime( const std::string& extension_id) const { - const DictionaryValue* extension = GetExtensionPref(extension_id); + const base::DictionaryValue* extension = GetExtensionPref(extension_id); if (!extension) { NOTREACHED(); return base::Time(); @@ -1496,7 +1501,7 @@ base::Time ExtensionPrefs::GetInstallTime( base::Time ExtensionPrefs::GetLastLaunchTime( const std::string& extension_id) const { - const DictionaryValue* extension = GetExtensionPref(extension_id); + const base::DictionaryValue* extension = GetExtensionPref(extension_id); if (!extension) return base::Time(); @@ -1532,17 +1537,17 @@ ExtensionIdList ExtensionPrefs::GetExtensionsFrom( const PrefService* pref_service) { ExtensionIdList result; - const DictionaryValue* extension_prefs = NULL; - const Value* extension_prefs_value = + const base::DictionaryValue* extension_prefs = NULL; + const base::Value* extension_prefs_value = pref_service->GetUserPrefValue(prefs::kExtensionsPref); if (!extension_prefs_value || !extension_prefs_value->GetAsDictionary(&extension_prefs)) { return result; // Empty set } - for (DictionaryValue::Iterator it(*extension_prefs); !it.IsAtEnd(); + for (base::DictionaryValue::Iterator it(*extension_prefs); !it.IsAtEnd(); it.Advance()) { - const DictionaryValue* ext = NULL; + const base::DictionaryValue* ext = NULL; if (!it.value().GetAsDictionary(&ext)) { NOTREACHED() << "Invalid pref for extension " << it.key(); continue; @@ -1611,7 +1616,8 @@ bool ExtensionPrefs::HasIncognitoPrefValue(const std::string& pref_key) { URLPatternSet ExtensionPrefs::GetAllowedInstallSites() { URLPatternSet result; - const ListValue* list = prefs_->GetList(prefs::kExtensionAllowedInstallSites); + const base::ListValue* list = + prefs_->GetList(prefs::kExtensionAllowedInstallSites); CHECK(list); for (size_t i = 0; i < list->GetSize(); ++i) { @@ -1630,13 +1636,13 @@ URLPatternSet ExtensionPrefs::GetAllowedInstallSites() { return result; } -const DictionaryValue* ExtensionPrefs::GetGeometryCache( +const base::DictionaryValue* ExtensionPrefs::GetGeometryCache( const std::string& extension_id) const { - const DictionaryValue* extension_prefs = GetExtensionPref(extension_id); + const base::DictionaryValue* extension_prefs = GetExtensionPref(extension_id); if (!extension_prefs) return NULL; - const DictionaryValue* ext = NULL; + const base::DictionaryValue* ext = NULL; if (!extension_prefs->GetDictionary(kPrefGeometryCache, &ext)) return NULL; @@ -1645,15 +1651,16 @@ const DictionaryValue* ExtensionPrefs::GetGeometryCache( void ExtensionPrefs::SetGeometryCache( const std::string& extension_id, - scoped_ptr<DictionaryValue> cache) { + scoped_ptr<base::DictionaryValue> cache) { UpdateExtensionPref(extension_id, kPrefGeometryCache, cache.release()); } -const DictionaryValue* ExtensionPrefs::GetInstallSignature() { +const base::DictionaryValue* ExtensionPrefs::GetInstallSignature() { return prefs_->GetDictionary(kInstallSignature); } -void ExtensionPrefs::SetInstallSignature(const DictionaryValue* signature) { +void ExtensionPrefs::SetInstallSignature( + const base::DictionaryValue* signature) { if (signature) { prefs_->Set(kInstallSignature, *signature); DVLOG(1) << "SetInstallSignature - saving"; @@ -1757,8 +1764,8 @@ bool ExtensionPrefs::GetUserExtensionPrefIntoContainer( ExtensionIdContainer* id_container_out) { DCHECK(id_container_out->empty()); - const Value* user_pref_value = prefs_->GetUserPrefValue(pref); - const ListValue* user_pref_as_list; + const base::Value* user_pref_value = prefs_->GetUserPrefValue(pref); + const base::ListValue* user_pref_as_list; if (!user_pref_value || !user_pref_value->GetAsList(&user_pref_as_list)) return false; @@ -1781,7 +1788,7 @@ void ExtensionPrefs::SetExtensionPrefFromContainer( const char* pref, const ExtensionIdContainer& strings) { ListPrefUpdate update(prefs_, pref); - ListValue* list_of_values = update.Get(); + base::ListValue* list_of_values = update.Get(); list_of_values->Clear(); for (typename ExtensionIdContainer::const_iterator iter = strings.begin(); iter != strings.end(); ++iter) { @@ -1794,7 +1801,7 @@ void ExtensionPrefs::PopulateExtensionInfoPrefs( const base::Time install_time, Extension::State initial_state, bool blacklisted_for_malware, - DictionaryValue* extension_dict) { + base::DictionaryValue* extension_dict) { // Leave the state blank for component extensions so that old chrome versions // loading new profiles do not fail in GetInstalledExtensionInfo. Older // Chrome versions would only check for an omitted state. @@ -1834,27 +1841,29 @@ void ExtensionPrefs::FinishExtensionInfoPrefs( const base::Time install_time, bool needs_sort_ordinal, const syncer::StringOrdinal& suggested_page_ordinal, - DictionaryValue* extension_dict) { + base::DictionaryValue* extension_dict) { // Reinitializes various preferences with empty dictionaries. - if (!extension_dict->HasKey(pref_names::kPrefPreferences)) - extension_dict->Set(pref_names::kPrefPreferences, new DictionaryValue); + if (!extension_dict->HasKey(pref_names::kPrefPreferences)) { + extension_dict->Set(pref_names::kPrefPreferences, + new base::DictionaryValue); + } if (!extension_dict->HasKey(pref_names::kPrefIncognitoPreferences)) { extension_dict->Set(pref_names::kPrefIncognitoPreferences, - new DictionaryValue); + new base::DictionaryValue); } if (!extension_dict->HasKey(pref_names::kPrefRegularOnlyPreferences)) { extension_dict->Set(pref_names::kPrefRegularOnlyPreferences, - new DictionaryValue); + new base::DictionaryValue); } if (!extension_dict->HasKey(pref_names::kPrefContentSettings)) - extension_dict->Set(pref_names::kPrefContentSettings, new ListValue); + extension_dict->Set(pref_names::kPrefContentSettings, new base::ListValue); if (!extension_dict->HasKey(pref_names::kPrefIncognitoContentSettings)) { extension_dict->Set(pref_names::kPrefIncognitoContentSettings, - new ListValue); + new base::ListValue); } // If this point has been reached, any pending installs should be considered diff --git a/chrome/browser/extensions/extension_prefs.h b/chrome/browser/extensions/extension_prefs.h index eb4227b..465c02f 100644 --- a/chrome/browser/extensions/extension_prefs.h +++ b/chrome/browser/extensions/extension_prefs.h @@ -496,7 +496,7 @@ class ExtensionPrefs : public ExtensionScopedPrefs, // Used for verification of installed extension ids. For the Set method, pass // null to remove the preference. const base::DictionaryValue* GetInstallSignature(); - void SetInstallSignature(const DictionaryValue* signature); + void SetInstallSignature(const base::DictionaryValue* signature); private: friend class ExtensionPrefsBlacklistedExtensions; // Unit test. diff --git a/chrome/browser/extensions/extension_prefs_unittest.cc b/chrome/browser/extensions/extension_prefs_unittest.cc index 04c0b98..a7338b9 100644 --- a/chrome/browser/extensions/extension_prefs_unittest.cc +++ b/chrome/browser/extensions/extension_prefs_unittest.cc @@ -473,7 +473,7 @@ class ExtensionPrefsDelayedInstallInfo : public ExtensionPrefsTest { public: // Sets idle install information for one test extension. void SetIdleInfo(std::string id, int num) { - DictionaryValue manifest; + base::DictionaryValue manifest; manifest.SetString(manifest_keys::kName, "test"); manifest.SetString(manifest_keys::kVersion, "1." + base::IntToString(num)); base::FilePath path = @@ -584,7 +584,7 @@ TEST_F(ExtensionPrefsDelayedInstallInfo, DelayedInstallInfo) {} class ExtensionPrefsFinishDelayedInstallInfo : public ExtensionPrefsTest { public: virtual void Initialize() OVERRIDE { - DictionaryValue dictionary; + base::DictionaryValue dictionary; dictionary.SetString(manifest_keys::kName, "test"); dictionary.SetString(manifest_keys::kVersion, "0.1"); dictionary.SetString(manifest_keys::kBackgroundPage, "background.html"); @@ -594,10 +594,10 @@ class ExtensionPrefsFinishDelayedInstallInfo : public ExtensionPrefsTest { // Set idle info - DictionaryValue manifest; + base::DictionaryValue manifest; manifest.SetString(manifest_keys::kName, "test"); manifest.SetString(manifest_keys::kVersion, "0.2"); - scoped_ptr<ListValue> scripts(new ListValue); + scoped_ptr<base::ListValue> scripts(new base::ListValue); scripts->AppendString("test.js"); manifest.Set(manifest_keys::kBackgroundScripts, scripts.release()); base::FilePath path = @@ -620,7 +620,7 @@ class ExtensionPrefsFinishDelayedInstallInfo : public ExtensionPrefsTest { virtual void Verify() OVERRIDE { EXPECT_FALSE(prefs()->GetDelayedInstallInfo(id_)); - const DictionaryValue* manifest; + const base::DictionaryValue* manifest; ASSERT_TRUE(prefs()->ReadPrefAsDictionary(id_, "manifest", &manifest)); ASSERT_TRUE(manifest); std::string value; @@ -629,7 +629,7 @@ class ExtensionPrefsFinishDelayedInstallInfo : public ExtensionPrefsTest { EXPECT_TRUE(manifest->GetString(manifest_keys::kVersion, &value)); EXPECT_EQ("0.2", value); EXPECT_FALSE(manifest->GetString(manifest_keys::kBackgroundPage, &value)); - const ListValue* scripts; + const base::ListValue* scripts; ASSERT_TRUE(manifest->GetList(manifest_keys::kBackgroundScripts, &scripts)); EXPECT_EQ(1u, scripts->GetSize()); } @@ -735,7 +735,7 @@ TEST_F(ExtensionPrefsFlags, ExtensionPrefsFlags) {} PrefsPrepopulatedTestBase::PrefsPrepopulatedTestBase() : ExtensionPrefsTest() { - DictionaryValue simple_dict; + base::DictionaryValue simple_dict; std::string error; simple_dict.SetString(manifest_keys::kVersion, "1.0.0.0"); diff --git a/chrome/browser/extensions/extension_protocols_unittest.cc b/chrome/browser/extensions/extension_protocols_unittest.cc index 9d95461..74e52bc 100644 --- a/chrome/browser/extensions/extension_protocols_unittest.cc +++ b/chrome/browser/extensions/extension_protocols_unittest.cc @@ -29,7 +29,7 @@ namespace extensions { scoped_refptr<Extension> CreateTestExtension(const std::string& name, bool incognito_split_mode) { - DictionaryValue manifest; + base::DictionaryValue manifest; manifest.SetString("name", name); manifest.SetString("version", "1"); manifest.SetInteger("manifest_version", 2); @@ -48,7 +48,7 @@ scoped_refptr<Extension> CreateTestExtension(const std::string& name, } scoped_refptr<Extension> CreateWebStoreExtension() { - DictionaryValue manifest; + base::DictionaryValue manifest; manifest.SetString("name", "WebStore"); manifest.SetString("version", "1"); manifest.SetString("icons.16", "webstore_icon_16.png"); @@ -66,7 +66,7 @@ scoped_refptr<Extension> CreateWebStoreExtension() { } scoped_refptr<Extension> CreateTestResponseHeaderExtension() { - DictionaryValue manifest; + base::DictionaryValue manifest; manifest.SetString("name", "An extension with web-accessible resources"); manifest.SetString("version", "2"); diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc index 8b931f13..df6d91c 100644 --- a/chrome/browser/extensions/extension_service.cc +++ b/chrome/browser/extensions/extension_service.cc @@ -2475,9 +2475,9 @@ bool ExtensionService::OnExternalExtensionFileFound( return true; } -scoped_ptr<DictionaryValue> ExtensionService::GetExtensionInfo( +scoped_ptr<base::DictionaryValue> ExtensionService::GetExtensionInfo( const std::string& extension_id) const { - scoped_ptr<DictionaryValue> dictionary(new DictionaryValue); + scoped_ptr<base::DictionaryValue> dictionary(new base::DictionaryValue); const extensions::Extension* extension = registry_->enabled_extensions().GetByID(extension_id); if (extension) { diff --git a/chrome/browser/extensions/extension_service.h b/chrome/browser/extensions/extension_service.h index f8d86c1..8545283 100644 --- a/chrome/browser/extensions/extension_service.h +++ b/chrome/browser/extensions/extension_service.h @@ -466,7 +466,7 @@ class ExtensionService // Sets the name, id and icon resource path of the given extension into the // returned dictionary. Returns an empty dictionary if the given extension id // is not found. - scoped_ptr<DictionaryValue> GetExtensionInfo( + scoped_ptr<base::DictionaryValue> GetExtensionInfo( const std::string& extension_id) const; // Notify the frontend that there was an error loading an extension. diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc index 2700d22..dc16b72 100644 --- a/chrome/browser/extensions/extension_service_unittest.cc +++ b/chrome/browser/extensions/extension_service_unittest.cc @@ -339,14 +339,14 @@ class MockProviderVisitor // We also parse the file into a dictionary to compare what we get back // from the provider. JSONStringValueSerializer serializer(json_data); - Value* json_value = serializer.Deserialize(NULL, NULL); + base::Value* json_value = serializer.Deserialize(NULL, NULL); - if (!json_value || !json_value->IsType(Value::TYPE_DICTIONARY)) { + if (!json_value || !json_value->IsType(base::Value::TYPE_DICTIONARY)) { NOTREACHED() << "Unable to deserialize json data"; return -1; } else { - DictionaryValue* external_extensions = - static_cast<DictionaryValue*>(json_value); + base::DictionaryValue* external_extensions = + static_cast<base::DictionaryValue*>(json_value); prefs_.reset(external_extensions); } @@ -367,7 +367,7 @@ class MockProviderVisitor EXPECT_EQ(expected_creation_flags_, creation_flags); ++ids_found_; - DictionaryValue* pref; + base::DictionaryValue* pref; // This tests is to make sure that the provider only notifies us of the // values we gave it. So if the id we doesn't exist in our internal // dictionary then something is wrong. @@ -407,7 +407,7 @@ class MockProviderVisitor int creation_flags, bool mark_acknowledged) OVERRIDE { ++ids_found_; - DictionaryValue* pref; + base::DictionaryValue* pref; // This tests is to make sure that the provider only notifies us of the // values we gave it. So if the id we doesn't exist in our internal // dictionary then something is wrong. @@ -442,7 +442,7 @@ class MockProviderVisitor base::FilePath fake_base_path_; int expected_creation_flags_; scoped_ptr<extensions::ExternalProviderImpl> provider_; - scoped_ptr<DictionaryValue> prefs_; + scoped_ptr<base::DictionaryValue> prefs_; scoped_ptr<TestingProfile> profile_; DISALLOW_COPY_AND_ASSIGN(MockProviderVisitor); @@ -1011,7 +1011,7 @@ class ExtensionServiceTest } size_t GetPrefKeyCount() { - const DictionaryValue* dict = + const base::DictionaryValue* dict = profile_->GetPrefs()->GetDictionary("extensions.settings"); if (!dict) { ADD_FAILURE(); @@ -1073,14 +1073,14 @@ class ExtensionServiceTest msg += expected_val ? "true" : "false"; PrefService* prefs = profile_->GetPrefs(); - const DictionaryValue* dict = + const base::DictionaryValue* dict = prefs->GetDictionary("extensions.settings"); if (!dict) { return testing::AssertionFailure() << "extension.settings does not exist " << msg; } - const DictionaryValue* pref = NULL; + const base::DictionaryValue* pref = NULL; if (!dict->GetDictionary(extension_id, &pref)) { return testing::AssertionFailure() << "extension pref does not exist " << msg; @@ -1094,15 +1094,15 @@ class ExtensionServiceTest return expected_val == val ? testing::AssertionSuccess() - : testing::AssertionFailure() << "Value is incorrect " << msg; + : testing::AssertionFailure() << "base::Value is incorrect " << msg; } bool IsPrefExist(const std::string& extension_id, const std::string& pref_path) { - const DictionaryValue* dict = + const base::DictionaryValue* dict = profile_->GetPrefs()->GetDictionary("extensions.settings"); if (dict == NULL) return false; - const DictionaryValue* pref = NULL; + const base::DictionaryValue* pref = NULL; if (!dict->GetDictionary(extension_id, &pref)) { return false; } @@ -1127,10 +1127,10 @@ class ExtensionServiceTest msg += base::IntToString(expected_val); PrefService* prefs = profile_->GetPrefs(); - const DictionaryValue* dict = + const base::DictionaryValue* dict = prefs->GetDictionary("extensions.settings"); ASSERT_TRUE(dict != NULL) << msg; - const DictionaryValue* pref = NULL; + const base::DictionaryValue* pref = NULL; ASSERT_TRUE(dict->GetDictionary(extension_id, &pref)) << msg; EXPECT_TRUE(pref != NULL) << msg; int val; @@ -1148,10 +1148,10 @@ class ExtensionServiceTest msg += " == "; msg += expected_val; - const DictionaryValue* dict = + const base::DictionaryValue* dict = profile_->GetPrefs()->GetDictionary("extensions.settings"); ASSERT_TRUE(dict != NULL) << msg; - const DictionaryValue* pref = NULL; + const base::DictionaryValue* pref = NULL; std::string manifest_path = extension_id + ".manifest"; ASSERT_TRUE(dict->GetDictionary(manifest_path, &pref)) << msg; EXPECT_TRUE(pref != NULL) << msg; @@ -1162,12 +1162,12 @@ class ExtensionServiceTest void SetPref(const std::string& extension_id, const std::string& pref_path, - Value* value, + base::Value* value, const std::string& msg) { DictionaryPrefUpdate update(profile_->GetPrefs(), "extensions.settings"); - DictionaryValue* dict = update.Get(); + base::DictionaryValue* dict = update.Get(); ASSERT_TRUE(dict != NULL) << msg; - DictionaryValue* pref = NULL; + base::DictionaryValue* pref = NULL; ASSERT_TRUE(dict->GetDictionary(extension_id, &pref)) << msg; EXPECT_TRUE(pref != NULL) << msg; pref->Set(pref_path, value); @@ -1203,9 +1203,9 @@ class ExtensionServiceTest msg += extension_id + " " + pref_path; DictionaryPrefUpdate update(profile_->GetPrefs(), "extensions.settings"); - DictionaryValue* dict = update.Get(); + base::DictionaryValue* dict = update.Get(); ASSERT_TRUE(dict != NULL) << msg; - DictionaryValue* pref = NULL; + base::DictionaryValue* pref = NULL; ASSERT_TRUE(dict->GetDictionary(extension_id, &pref)) << msg; EXPECT_TRUE(pref != NULL) << msg; pref->Remove(pref_path, NULL); @@ -1217,7 +1217,7 @@ class ExtensionServiceTest std::string msg = " while setting: "; msg += extension_id + " " + pref_path; - ListValue* list_value = new ListValue(); + base::ListValue* list_value = new base::ListValue(); for (std::set<std::string>::const_iterator iter = value.begin(); iter != value.end(); ++iter) list_value->Append(new base::StringValue(*iter)); @@ -1466,7 +1466,7 @@ TEST_F(ExtensionServiceTest, CleanupOnStartup) { // Simulate that one of them got partially deleted by clearing its pref. { DictionaryPrefUpdate update(profile_->GetPrefs(), "extensions.settings"); - DictionaryValue* dict = update.Get(); + base::DictionaryValue* dict = update.Get(); ASSERT_TRUE(dict != NULL); dict->Remove("behllobkkfkfnphdnhnkndlbkcpglgmj", NULL); } @@ -2157,7 +2157,7 @@ TEST_F(ExtensionServiceTest, GrantedAPIAndHostPermissions) { // the extension's granted api permissions preference. (This simulates // updating the browser to a version which recognizes a new API permission). SetPref(extension_id, "granted_permissions.api", - new ListValue(), "granted_permissions.api"); + new base::ListValue(), "granted_permissions.api"); service_->ReloadExtensionsForTest(); EXPECT_EQ(1u, service_->disabled_extensions()->size()); @@ -2193,7 +2193,7 @@ TEST_F(ExtensionServiceTest, GrantedAPIAndHostPermissions) { host_permissions.insert("https://*.google.com/*"); host_permissions.insert("http://*.google.com.hk/*"); - ListValue* api_permissions = new ListValue(); + base::ListValue* api_permissions = new base::ListValue(); api_permissions->Append( new base::StringValue("tabs")); SetPref(extension_id, "granted_permissions.api", @@ -3023,7 +3023,7 @@ TEST_F(ExtensionServiceTest, LoadExtensionsCanDowngrade) { ASSERT_FALSE(base::PathExists(manifest_path)); // Start with version 2.0. - DictionaryValue manifest; + base::DictionaryValue manifest; manifest.SetString("version", "2.0"); manifest.SetString("name", "LOAD Downgrade Test"); manifest.SetInteger("manifest_version", 2); @@ -3544,7 +3544,7 @@ TEST_F(ExtensionServiceTest, BlacklistedByPolicyWillNotInstall) { { ListPrefUpdate update(profile_->GetPrefs(), prefs::kExtensionInstallDenyList); - ListValue* blacklist = update.Get(); + base::ListValue* blacklist = update.Get(); blacklist->Append(new base::StringValue("*")); } @@ -3557,7 +3557,7 @@ TEST_F(ExtensionServiceTest, BlacklistedByPolicyWillNotInstall) { { ListPrefUpdate update(profile_->GetPrefs(), prefs::kExtensionInstallAllowList); - ListValue* whitelist = update.Get(); + base::ListValue* whitelist = update.Get(); whitelist->Append(new base::StringValue(good_crx)); } @@ -3578,7 +3578,7 @@ TEST_F(ExtensionServiceTest, BlacklistedByPolicyRemovedIfRunning) { { // Scope for pref update notification. PrefService* prefs = profile_->GetPrefs(); ListPrefUpdate update(prefs, prefs::kExtensionInstallDenyList); - ListValue* blacklist = update.Get(); + base::ListValue* blacklist = update.Get(); ASSERT_TRUE(blacklist != NULL); // Blacklist this extension. @@ -3598,7 +3598,7 @@ TEST_F(ExtensionServiceTest, ComponentExtensionWhitelisted) { { ListPrefUpdate update(profile_->GetPrefs(), prefs::kExtensionInstallDenyList); - ListValue* blacklist = update.Get(); + base::ListValue* blacklist = update.Get(); blacklist->Append(new base::StringValue("*")); } @@ -3627,7 +3627,7 @@ TEST_F(ExtensionServiceTest, ComponentExtensionWhitelisted) { { ListPrefUpdate update(profile_->GetPrefs(), prefs::kExtensionInstallDenyList); - ListValue* blacklist = update.Get(); + base::ListValue* blacklist = update.Get(); blacklist->Append(new base::StringValue(good0)); } base::RunLoop().RunUntilIdle(); @@ -3643,7 +3643,7 @@ TEST_F(ExtensionServiceTest, PolicyInstalledExtensionsWhitelisted) { // Blacklist everything. ListPrefUpdate blacklist_update(profile_->GetPrefs(), prefs::kExtensionInstallDenyList); - ListValue* blacklist = blacklist_update.Get(); + base::ListValue* blacklist = blacklist_update.Get(); blacklist->AppendString("*"); // Mark good.crx for force-installation. @@ -3677,7 +3677,7 @@ TEST_F(ExtensionServiceTest, PolicyInstalledExtensionsWhitelisted) { { ListPrefUpdate update(profile_->GetPrefs(), prefs::kExtensionInstallDenyList); - ListValue* blacklist = update.Get(); + base::ListValue* blacklist = update.Get(); blacklist->Append(new base::StringValue(good0)); } base::RunLoop().RunUntilIdle(); @@ -3707,7 +3707,7 @@ TEST_F(ExtensionServiceTest, ManagementPolicyProhibitsLoadFromPrefs) { // Create a fake extension to be loaded as though it were read from prefs. base::FilePath path = data_dir_.AppendASCII("management") .AppendASCII("simple_extension"); - DictionaryValue manifest; + base::DictionaryValue manifest; manifest.SetString(keys::kName, "simple_extension"); manifest.SetString(keys::kVersion, "1"); // UNPACKED is for extensions loaded from a directory. We use it here, even diff --git a/chrome/browser/extensions/extension_special_storage_policy_unittest.cc b/chrome/browser/extensions/extension_special_storage_policy_unittest.cc index 104cbcb..2eedcb0 100644 --- a/chrome/browser/extensions/extension_special_storage_policy_unittest.cc +++ b/chrome/browser/extensions/extension_special_storage_policy_unittest.cc @@ -102,7 +102,7 @@ class ExtensionSpecialStoragePolicyTest : public testing::Test { #elif defined(OS_POSIX) base::FilePath path(FILE_PATH_LITERAL("/foo")); #endif - DictionaryValue manifest; + base::DictionaryValue manifest; manifest.SetString(keys::kName, "Protected"); manifest.SetString(keys::kVersion, "1"); manifest.SetString(keys::kLaunchWebURL, "http://explicit/protected/start"); @@ -124,7 +124,7 @@ class ExtensionSpecialStoragePolicyTest : public testing::Test { #elif defined(OS_POSIX) base::FilePath path(FILE_PATH_LITERAL("/bar")); #endif - DictionaryValue manifest; + base::DictionaryValue manifest; manifest.SetString(keys::kName, "Unlimited"); manifest.SetString(keys::kVersion, "1"); manifest.SetString(keys::kLaunchWebURL, "http://explicit/unlimited/start"); @@ -149,7 +149,7 @@ class ExtensionSpecialStoragePolicyTest : public testing::Test { #elif defined(OS_POSIX) base::FilePath path(FILE_PATH_LITERAL("/app")); #endif - DictionaryValue manifest; + base::DictionaryValue manifest; manifest.SetString(keys::kName, "App"); manifest.SetString(keys::kVersion, "1"); manifest.SetString(keys::kPlatformAppBackgroundPage, "background.html"); diff --git a/chrome/browser/extensions/extension_tab_util.cc b/chrome/browser/extensions/extension_tab_util.cc index fcba218..246a56f 100644 --- a/chrome/browser/extensions/extension_tab_util.cc +++ b/chrome/browser/extensions/extension_tab_util.cc @@ -83,7 +83,7 @@ int ExtensionTabUtil::GetWindowIdOfTab(const WebContents* web_contents) { return SessionID::IdForWindowContainingTab(web_contents); } -DictionaryValue* ExtensionTabUtil::CreateTabValue( +base::DictionaryValue* ExtensionTabUtil::CreateTabValue( const WebContents* contents, TabStripModel* tab_strip, int tab_index, @@ -95,7 +95,8 @@ DictionaryValue* ExtensionTabUtil::CreateTabValue( (!extension || controller->IsVisibleToExtension(extension))) { return controller->CreateTabValue(extension, tab_index); } - DictionaryValue *result = CreateTabValue(contents, tab_strip, tab_index); + base::DictionaryValue *result = + CreateTabValue(contents, tab_strip, tab_index); ScrubTabValueForExtension(contents, extension, result); return result; } @@ -115,7 +116,7 @@ base::ListValue* ExtensionTabUtil::CreateTabList( return tab_list; } -DictionaryValue* ExtensionTabUtil::CreateTabValue( +base::DictionaryValue* ExtensionTabUtil::CreateTabValue( const WebContents* contents, TabStripModel* tab_strip, int tab_index) { @@ -128,7 +129,7 @@ DictionaryValue* ExtensionTabUtil::CreateTabValue( if (!tab_strip) ExtensionTabUtil::GetTabStripModel(contents, &tab_strip, &tab_index); - DictionaryValue* result = new DictionaryValue(); + base::DictionaryValue* result = new base::DictionaryValue(); bool is_loading = contents->IsLoading(); result->SetInteger(keys::kIdKey, GetTabId(contents)); result->SetInteger(keys::kIndexKey, tab_index); @@ -168,9 +169,10 @@ DictionaryValue* ExtensionTabUtil::CreateTabValue( return result; } -void ExtensionTabUtil::ScrubTabValueForExtension(const WebContents* contents, - const Extension* extension, - DictionaryValue* tab_info) { +void ExtensionTabUtil::ScrubTabValueForExtension( + const WebContents* contents, + const Extension* extension, + base::DictionaryValue* tab_info) { bool has_permission = extension && PermissionsData::HasAPIPermissionForTab( |