diff options
Diffstat (limited to 'chrome/browser/sync')
17 files changed, 212 insertions, 195 deletions
diff --git a/chrome/browser/sync/about_sync_util.cc b/chrome/browser/sync/about_sync_util.cc index 3ef918f..88d852d 100644 --- a/chrome/browser/sync/about_sync_util.cc +++ b/chrome/browser/sync/about_sync_util.cc @@ -27,10 +27,10 @@ namespace { // Creates a 'section' for display on about:sync, consisting of a title and a // list of fields. Returns a pointer to the new section. Note that // |parent_list|, not the caller, owns the newly added section. -ListValue* AddSection(ListValue* parent_list, - const std::string& title) { - DictionaryValue* section = new DictionaryValue(); - ListValue* section_contents = new ListValue(); +base::ListValue* AddSection(base::ListValue* parent_list, + const std::string& title) { + base::DictionaryValue* section = new base::DictionaryValue(); + base::ListValue* section_contents = new base::ListValue(); section->SetString("title", title); section->Set("data", section_contents); section->SetBoolean("is_sensitive", false); @@ -40,10 +40,10 @@ ListValue* AddSection(ListValue* parent_list, // Same as AddSection, but for data that should be elided when dumped into text // form and posted in a public forum (e.g. unique identifiers). -ListValue* AddSensitiveSection(ListValue* parent_list, - const std::string& title) { - DictionaryValue* section = new DictionaryValue(); - ListValue* section_contents = new ListValue(); +base::ListValue* AddSensitiveSection(base::ListValue* parent_list, + const std::string& title) { + base::DictionaryValue* section = new base::DictionaryValue(); + base::ListValue* section_contents = new base::ListValue(); section->SetString("title", title); section->Set("data", section_contents); section->SetBoolean("is_sensitive", true); @@ -60,17 +60,18 @@ ListValue* AddSensitiveSection(ListValue* parent_list, class StringSyncStat { public: - StringSyncStat(ListValue* section, const std::string& key); + StringSyncStat(base::ListValue* section, const std::string& key); void SetValue(const std::string& value); void SetValue(const base::string16& value); private: // Owned by the |section| passed in during construction. - DictionaryValue* stat_; + base::DictionaryValue* stat_; }; -StringSyncStat::StringSyncStat(ListValue* section, const std::string& key) { - stat_ = new DictionaryValue(); +StringSyncStat::StringSyncStat(base::ListValue* section, + const std::string& key) { + stat_ = new base::DictionaryValue(); stat_->SetString("stat_name", key); stat_->SetString("stat_value", "Uninitialized"); stat_->SetBoolean("is_valid", false); @@ -89,16 +90,16 @@ void StringSyncStat::SetValue(const base::string16& value) { class BoolSyncStat { public: - BoolSyncStat(ListValue* section, const std::string& key); + BoolSyncStat(base::ListValue* section, const std::string& key); void SetValue(bool value); private: // Owned by the |section| passed in during construction. - DictionaryValue* stat_; + base::DictionaryValue* stat_; }; -BoolSyncStat::BoolSyncStat(ListValue* section, const std::string& key) { - stat_ = new DictionaryValue(); +BoolSyncStat::BoolSyncStat(base::ListValue* section, const std::string& key) { + stat_ = new base::DictionaryValue(); stat_->SetString("stat_name", key); stat_->SetBoolean("stat_value", false); stat_->SetBoolean("is_valid", false); @@ -112,16 +113,16 @@ void BoolSyncStat::SetValue(bool value) { class IntSyncStat { public: - IntSyncStat(ListValue* section, const std::string& key); + IntSyncStat(base::ListValue* section, const std::string& key); void SetValue(int value); private: // Owned by the |section| passed in during construction. - DictionaryValue* stat_; + base::DictionaryValue* stat_; }; -IntSyncStat::IntSyncStat(ListValue* section, const std::string& key) { - stat_ = new DictionaryValue(); +IntSyncStat::IntSyncStat(base::ListValue* section, const std::string& key) { + stat_ = new base::DictionaryValue(); stat_->SetString("stat_name", key); stat_->SetInteger("stat_value", 0); stat_->SetBoolean("is_valid", false); @@ -207,27 +208,30 @@ namespace sync_ui_util { // its contents. Most of the message consists of simple fields in about:sync // which are grouped into sections and populated with the help of the SyncStat // classes defined above. -scoped_ptr<DictionaryValue> ConstructAboutInformation( +scoped_ptr<base::DictionaryValue> ConstructAboutInformation( ProfileSyncService* service) { - scoped_ptr<DictionaryValue> about_info(new DictionaryValue()); - ListValue* stats_list = new ListValue(); // 'details': A list of sections. + scoped_ptr<base::DictionaryValue> about_info(new base::DictionaryValue()); + + // 'details': A list of sections. + base::ListValue* stats_list = new base::ListValue(); // The following lines define the sections and their fields. For each field, // a class is instantiated, which allows us to reference the fields in // 'setter' code later on in this function. - ListValue* section_summary = AddSection(stats_list, "Summary"); + base::ListValue* section_summary = AddSection(stats_list, "Summary"); StringSyncStat summary_string(section_summary, "Summary"); - ListValue* section_version = AddSection(stats_list, "Version Info"); + base::ListValue* section_version = AddSection(stats_list, "Version Info"); StringSyncStat client_version(section_version, "Client Version"); StringSyncStat server_url(section_version, "Server URL"); - ListValue* section_identity = AddSensitiveSection(stats_list, kIdentityTitle); + base::ListValue* section_identity = + AddSensitiveSection(stats_list, kIdentityTitle); StringSyncStat sync_id(section_identity, "Sync Client ID"); StringSyncStat invalidator_id(section_identity, "Invalidator Client ID"); StringSyncStat username(section_identity, "Username"); - ListValue* section_credentials = AddSection(stats_list, "Credentials"); + base::ListValue* section_credentials = AddSection(stats_list, "Credentials"); StringSyncStat request_token_time(section_credentials, "Requested Token"); StringSyncStat receive_token_time(section_credentials, "Received Token"); StringSyncStat token_request_status(section_credentials, @@ -235,7 +239,7 @@ scoped_ptr<DictionaryValue> ConstructAboutInformation( StringSyncStat next_token_request(section_credentials, "Next Token Request"); - ListValue* section_local = AddSection(stats_list, "Local State"); + base::ListValue* section_local = AddSection(stats_list, "Local State"); StringSyncStat server_connection(section_local, "Server Connection"); StringSyncStat last_synced(section_local, "Last Synced"); @@ -246,13 +250,13 @@ scoped_ptr<DictionaryValue> ConstructAboutInformation( BoolSyncStat is_syncing(section_local, "Syncing"); BoolSyncStat is_token_available(section_local, "Sync Token Available"); - ListValue* section_network = AddSection(stats_list, "Network"); + base::ListValue* section_network = AddSection(stats_list, "Network"); BoolSyncStat is_throttled(section_network, "Throttled"); StringSyncStat retry_time(section_network, "Retry time (maybe stale)"); BoolSyncStat are_notifications_enabled(section_network, "Notifications Enabled"); - ListValue* section_encryption = AddSection(stats_list, "Encryption"); + base::ListValue* section_encryption = AddSection(stats_list, "Encryption"); BoolSyncStat is_using_explicit_passphrase(section_encryption, "Explicit Passphrase"); BoolSyncStat is_passphrase_required(section_encryption, @@ -270,14 +274,14 @@ scoped_ptr<DictionaryValue> ConstructAboutInformation( StringSyncStat passphrase_time(section_encryption, "Passphrase Time"); - ListValue* section_last_session = AddSection( + base::ListValue* section_last_session = AddSection( stats_list, "Status from Last Completed Session"); StringSyncStat session_source(section_last_session, "Sync Source"); StringSyncStat get_key_result(section_last_session, "GetKey Step Result"); StringSyncStat download_result(section_last_session, "Download Step Result"); StringSyncStat commit_result(section_last_session, "Commit Step Result"); - ListValue* section_counters = AddSection(stats_list, "Running Totals"); + base::ListValue* section_counters = AddSection(stats_list, "Running Totals"); IntSyncStat notifications_received(section_counters, "Notifications Received"); IntSyncStat empty_get_updates(section_counters, "Cycles Without Updates"); @@ -298,7 +302,7 @@ scoped_ptr<DictionaryValue> ConstructAboutInformation( IntSyncStat conflicts_resolved_server_wins(section_counters, "Conflicts Resolved: Server Wins"); - ListValue *section_this_cycle = AddSection(stats_list, + base::ListValue *section_this_cycle = AddSection(stats_list, "Transient Counters (this cycle)"); IntSyncStat encryption_conflicts(section_this_cycle, "Encryption Conflicts"); IntSyncStat hierarchy_conflicts(section_this_cycle, "Hierarchy Conflicts"); @@ -306,13 +310,13 @@ scoped_ptr<DictionaryValue> ConstructAboutInformation( IntSyncStat committed_items(section_this_cycle, "Committed Items"); IntSyncStat updates_remaining(section_this_cycle, "Updates Remaining"); - ListValue* section_that_cycle = AddSection( + base::ListValue* section_that_cycle = AddSection( stats_list, "Transient Counters (last cycle of last completed session)"); IntSyncStat updates_downloaded(section_that_cycle, "Updates Downloaded"); IntSyncStat committed_count(section_that_cycle, "Committed Count"); IntSyncStat entries(section_that_cycle, "Entries"); - ListValue* section_nudge_info = AddSection( + base::ListValue* section_nudge_info = AddSection( stats_list, "Nudge Source Counters"); IntSyncStat nudge_source_notification( section_nudge_info, "Server Invalidations"); @@ -474,7 +478,7 @@ scoped_ptr<DictionaryValue> ConstructAboutInformation( // NOTE: We won't bother showing any of the following values unless // actionable_error_detected is set. - ListValue* actionable_error = new ListValue(); + base::ListValue* actionable_error = new base::ListValue(); about_info->Set("actionable_error", actionable_error); StringSyncStat error_type(actionable_error, "Error Type"); diff --git a/chrome/browser/sync/about_sync_util_unittest.cc b/chrome/browser/sync/about_sync_util_unittest.cc index dc89b27..bf5befe 100644 --- a/chrome/browser/sync/about_sync_util_unittest.cc +++ b/chrome/browser/sync/about_sync_util_unittest.cc @@ -41,7 +41,8 @@ TEST(SyncUIUtilTestAbout, ConstructAboutInformationWithUnrecoverableErrorTest) { EXPECT_CALL(service, GetLastSyncedTimeString()) .WillOnce(Return(str)); - scoped_ptr<DictionaryValue> strings(ConstructAboutInformation(&service)); + scoped_ptr<base::DictionaryValue> strings( + ConstructAboutInformation(&service)); EXPECT_TRUE(strings->HasKey("unrecoverable_error_detected")); } diff --git a/chrome/browser/sync/glue/extensions_activity_monitor_unittest.cc b/chrome/browser/sync/glue/extensions_activity_monitor_unittest.cc index 9afdb3e..33bf971 100644 --- a/chrome/browser/sync/glue/extensions_activity_monitor_unittest.cc +++ b/chrome/browser/sync/glue/extensions_activity_monitor_unittest.cc @@ -33,7 +33,7 @@ scoped_refptr<Extension> MakeExtension(const std::string& name) { EXPECT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &path)); path = path.AppendASCII(name); - DictionaryValue value; + base::DictionaryValue value; value.SetString(keys::kVersion, "1.0.0.0"); value.SetString(keys::kName, name); std::string error; diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc index 3fa370e..cd62155 100644 --- a/chrome/browser/sync/profile_sync_service.cc +++ b/chrome/browser/sync/profile_sync_service.cc @@ -1840,8 +1840,8 @@ void ProfileSyncService::GetModelSafeRoutingInfo( } } -Value* ProfileSyncService::GetTypeStatusMap() const { - scoped_ptr<ListValue> result(new ListValue()); +base::Value* ProfileSyncService::GetTypeStatusMap() const { + scoped_ptr<base::ListValue> result(new base::ListValue()); if (!backend_.get() || !backend_initialized_) { return result.release(); @@ -1866,7 +1866,8 @@ Value* ProfileSyncService::GetTypeStatusMap() const { SyncBackendHost::Status detailed_status = backend_->GetDetailedStatus(); ModelTypeSet &throttled_types(detailed_status.throttled_types); ModelTypeSet registered = GetRegisteredDataTypes(); - scoped_ptr<DictionaryValue> type_status_header(new DictionaryValue()); + scoped_ptr<base::DictionaryValue> type_status_header( + new base::DictionaryValue()); type_status_header->SetString("name", "Model Type"); type_status_header->SetString("status", "header"); @@ -1875,11 +1876,11 @@ Value* ProfileSyncService::GetTypeStatusMap() const { type_status_header->SetString("num_live", "Live Entries"); result->Append(type_status_header.release()); - scoped_ptr<DictionaryValue> type_status; + scoped_ptr<base::DictionaryValue> type_status; for (ModelTypeSet::Iterator it = registered.First(); it.Good(); it.Inc()) { ModelType type = it.Get(); - type_status.reset(new DictionaryValue()); + type_status.reset(new base::DictionaryValue()); type_status->SetString("name", ModelTypeToString(type)); if (error_map.find(type) != error_map.end()) { diff --git a/chrome/browser/sync/profile_sync_service.h b/chrome/browser/sync/profile_sync_service.h index 23736e6..cd0f7c7 100644 --- a/chrome/browser/sync/profile_sync_service.h +++ b/chrome/browser/sync/profile_sync_service.h @@ -551,7 +551,7 @@ class ProfileSyncService // This function is used by sync_ui_util.cc to help populate the about:sync // page. It returns a ListValue rather than a DictionaryValue in part to make // it easier to iterate over its elements when constructing that page. - Value* GetTypeStatusMap() const; + base::Value* GetTypeStatusMap() const; // Overridden by tests. // TODO(zea): Remove these and have the dtc's call directly into the SBH. diff --git a/chrome/browser/sync/profile_sync_service_android.cc b/chrome/browser/sync/profile_sync_service_android.cc index e93d81a..c0ce961 100644 --- a/chrome/browser/sync/profile_sync_service_android.cc +++ b/chrome/browser/sync/profile_sync_service_android.cc @@ -457,7 +457,7 @@ ScopedJavaLocalRef<jstring> ProfileSyncServiceAndroid::GetAboutInfoForTest( JNIEnv* env, jobject) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - scoped_ptr<DictionaryValue> about_info = + scoped_ptr<base::DictionaryValue> about_info = sync_ui_util::ConstructAboutInformation(sync_service_); std::string about_info_json; base::JSONWriter::Write(about_info.get(), &about_info_json); diff --git a/chrome/browser/sync/profile_sync_service_preference_unittest.cc b/chrome/browser/sync/profile_sync_service_preference_unittest.cc index b5a6dd1..6aca47d 100644 --- a/chrome/browser/sync/profile_sync_service_preference_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_preference_unittest.cc @@ -54,7 +54,7 @@ using testing::_; using testing::Invoke; using testing::Return; -typedef std::map<const std::string, const Value*> PreferenceValues; +typedef std::map<const std::string, const base::Value*> PreferenceValues; ACTION_P(CreateAndSaveChangeProcessor, change_processor) { syncer::UserShare* user_share = arg0->GetUserShare(); @@ -80,7 +80,7 @@ class ProfileSyncServicePreferenceTest : public AbstractProfileSyncServiceTest, public syncer::DataTypeDebugInfoListener { public: - int64 SetSyncedValue(const std::string& name, const Value& value) { + int64 SetSyncedValue(const std::string& name, const base::Value& value) { syncer::WriteTransaction trans(FROM_HERE, sync_service_->GetUserShare()); syncer::ReadNode root(&trans); if (root.InitByTagLookup(syncer::ModelTypeToRootTag( @@ -206,14 +206,14 @@ class ProfileSyncServicePreferenceTest return true; } - const Value& GetPreferenceValue(const std::string& name) { + const base::Value& GetPreferenceValue(const std::string& name) { const PrefService::Preference* preference = prefs_->FindPreference(name.c_str()); return *preference->GetValue(); } // Caller gets ownership of the returned value. - const Value* GetSyncedValue(const std::string& name) { + const base::Value* GetSyncedValue(const std::string& name) { syncer::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare()); syncer::ReadNode node(&trans); @@ -229,7 +229,7 @@ class ProfileSyncServicePreferenceTest } int64 WriteSyncedValue(const std::string& name, - const Value& value, + const base::Value& value, syncer::WriteNode* node) { syncer::SyncData sync_data; if (!pref_sync_service_->CreatePrefSyncData(name, @@ -249,7 +249,7 @@ class ProfileSyncServicePreferenceTest return pref_sync_service_->IsPrefSynced(pref_name); } - std::string ValueString(const Value& value) { + std::string ValueString(const base::Value& value) { std::string serialized; JSONStringValueSerializer json(&serialized); json.Serialize(value); @@ -329,7 +329,7 @@ TEST_F(ProfileSyncServicePreferenceTest, CreatePrefSyncData) { preference()); EXPECT_EQ(std::string(prefs::kHomePage), specifics.name()); - scoped_ptr<Value> value(base::JSONReader::Read(specifics.value())); + scoped_ptr<base::Value> value(base::JSONReader::Read(specifics.value())); EXPECT_TRUE(pref->GetValue()->Equals(value.get())); } @@ -350,15 +350,15 @@ TEST_F(ProfileSyncServicePreferenceTest, ModelAssociationEmptyCloud) { prefs_->SetString(prefs::kHomePage, example_url0_); { ListPrefUpdate update(prefs_, prefs::kURLsToRestoreOnStartup); - ListValue* url_list = update.Get(); - url_list->Append(Value::CreateStringValue(example_url0_)); - url_list->Append(Value::CreateStringValue(example_url1_)); + base::ListValue* url_list = update.Get(); + url_list->Append(base::Value::CreateStringValue(example_url0_)); + url_list->Append(base::Value::CreateStringValue(example_url1_)); } CreateRootHelper create_root(this, syncer::PREFERENCES); ASSERT_TRUE(StartSyncService(create_root.callback(), false)); ASSERT_TRUE(create_root.success()); - scoped_ptr<const Value> value(GetSyncedValue(prefs::kHomePage)); + scoped_ptr<const base::Value> value(GetSyncedValue(prefs::kHomePage)); ASSERT_TRUE(value.get()); EXPECT_TRUE(GetPreferenceValue(prefs::kHomePage).Equals(value.get())); value.reset(GetSyncedValue(prefs::kURLsToRestoreOnStartup)); @@ -371,36 +371,36 @@ TEST_F(ProfileSyncServicePreferenceTest, ModelAssociationCloudHasData) { prefs_->SetString(prefs::kHomePage, example_url0_); { ListPrefUpdate update(prefs_, prefs::kURLsToRestoreOnStartup); - ListValue* url_list = update.Get(); - url_list->Append(Value::CreateStringValue(example_url0_)); - url_list->Append(Value::CreateStringValue(example_url1_)); + base::ListValue* url_list = update.Get(); + url_list->Append(base::Value::CreateStringValue(example_url0_)); + url_list->Append(base::Value::CreateStringValue(example_url1_)); } PreferenceValues cloud_data; STLValueDeleter<PreferenceValues> cloud_data_deleter(&cloud_data); - cloud_data[prefs::kHomePage] = Value::CreateStringValue(example_url1_); - ListValue* urls_to_restore = new ListValue; - urls_to_restore->Append(Value::CreateStringValue(example_url1_)); - urls_to_restore->Append(Value::CreateStringValue(example_url2_)); + cloud_data[prefs::kHomePage] = base::Value::CreateStringValue(example_url1_); + base::ListValue* urls_to_restore = new base::ListValue; + urls_to_restore->Append(base::Value::CreateStringValue(example_url1_)); + urls_to_restore->Append(base::Value::CreateStringValue(example_url2_)); cloud_data[prefs::kURLsToRestoreOnStartup] = urls_to_restore; cloud_data[prefs::kDefaultCharset] = - Value::CreateStringValue(non_default_charset_value_); + base::Value::CreateStringValue(non_default_charset_value_); AddPreferenceEntriesHelper helper(this, cloud_data); ASSERT_TRUE(StartSyncService(helper.callback(), false)); ASSERT_TRUE(helper.success()); - scoped_ptr<const Value> value(GetSyncedValue(prefs::kHomePage)); + scoped_ptr<const base::Value> value(GetSyncedValue(prefs::kHomePage)); ASSERT_TRUE(value.get()); std::string string_value; EXPECT_TRUE(value->GetAsString(&string_value)); EXPECT_EQ(example_url1_, string_value); EXPECT_EQ(example_url1_, prefs_->GetString(prefs::kHomePage)); - scoped_ptr<ListValue> expected_urls(new ListValue); - expected_urls->Append(Value::CreateStringValue(example_url1_)); - expected_urls->Append(Value::CreateStringValue(example_url2_)); - expected_urls->Append(Value::CreateStringValue(example_url0_)); + scoped_ptr<base::ListValue> expected_urls(new base::ListValue); + expected_urls->Append(base::Value::CreateStringValue(example_url1_)); + expected_urls->Append(base::Value::CreateStringValue(example_url2_)); + expected_urls->Append(base::Value::CreateStringValue(example_url0_)); value.reset(GetSyncedValue(prefs::kURLsToRestoreOnStartup)); ASSERT_TRUE(value.get()); EXPECT_TRUE(value->Equals(expected_urls.get())); @@ -421,9 +421,9 @@ TEST_F(ProfileSyncServicePreferenceTest, ModelAssociationMigrateOldData) { PreferenceValues cloud_data; STLValueDeleter<PreferenceValues> cloud_data_deleter(&cloud_data); - ListValue* urls_to_restore = new ListValue; - urls_to_restore->Append(Value::CreateStringValue(example_url1_)); - urls_to_restore->Append(Value::CreateStringValue(example_url2_)); + base::ListValue* urls_to_restore = new base::ListValue; + urls_to_restore->Append(base::Value::CreateStringValue(example_url1_)); + urls_to_restore->Append(base::Value::CreateStringValue(example_url2_)); cloud_data[prefs::kURLsToRestoreOnStartupOld] = urls_to_restore; AddPreferenceEntriesHelper helper(this, cloud_data); @@ -431,19 +431,20 @@ TEST_F(ProfileSyncServicePreferenceTest, ModelAssociationMigrateOldData) { ASSERT_TRUE(helper.success()); // Expect that the new preference data contains the old pref's values. - scoped_ptr<ListValue> expected_urls(new ListValue); - expected_urls->Append(Value::CreateStringValue(example_url1_)); - expected_urls->Append(Value::CreateStringValue(example_url2_)); + scoped_ptr<base::ListValue> expected_urls(new base::ListValue); + expected_urls->Append(base::Value::CreateStringValue(example_url1_)); + expected_urls->Append(base::Value::CreateStringValue(example_url2_)); ASSERT_TRUE(HasSyncData(prefs::kURLsToRestoreOnStartup)); - scoped_ptr<const Value> value(GetSyncedValue(prefs::kURLsToRestoreOnStartup)); + scoped_ptr<const base::Value> value( + GetSyncedValue(prefs::kURLsToRestoreOnStartup)); ASSERT_TRUE(value.get()); EXPECT_TRUE(value->Equals(expected_urls.get())); EXPECT_TRUE(GetPreferenceValue(prefs::kURLsToRestoreOnStartup). Equals(expected_urls.get())); // The old preference value should be the same. - expected_urls.reset(new ListValue); + expected_urls.reset(new base::ListValue); value.reset(GetSyncedValue(prefs::kURLsToRestoreOnStartupOld)); ASSERT_TRUE(value.get()); EXPECT_TRUE(GetPreferenceValue(prefs::kURLsToRestoreOnStartupOld). @@ -457,24 +458,24 @@ TEST_F(ProfileSyncServicePreferenceTest, prefs_->SetString(prefs::kHomePage, example_url0_); { ListPrefUpdate update(prefs_, prefs::kURLsToRestoreOnStartup); - ListValue* url_list = update.Get(); - url_list->Append(Value::CreateStringValue(example_url0_)); - url_list->Append(Value::CreateStringValue(example_url1_)); + base::ListValue* url_list = update.Get(); + url_list->Append(base::Value::CreateStringValue(example_url0_)); + url_list->Append(base::Value::CreateStringValue(example_url1_)); } PreferenceValues cloud_data; STLValueDeleter<PreferenceValues> cloud_data_deleter(&cloud_data); - cloud_data[prefs::kHomePage] = Value::CreateStringValue(example_url1_); - ListValue* urls_to_restore = new ListValue; - urls_to_restore->Append(Value::CreateStringValue(example_url1_)); - urls_to_restore->Append(Value::CreateStringValue(example_url2_)); + cloud_data[prefs::kHomePage] = base::Value::CreateStringValue(example_url1_); + base::ListValue* urls_to_restore = new base::ListValue; + urls_to_restore->Append(base::Value::CreateStringValue(example_url1_)); + urls_to_restore->Append(base::Value::CreateStringValue(example_url2_)); cloud_data[prefs::kURLsToRestoreOnStartupOld] = urls_to_restore; AddPreferenceEntriesHelper helper(this, cloud_data); ASSERT_TRUE(StartSyncService(helper.callback(), false)); ASSERT_TRUE(helper.success()); - scoped_ptr<const Value> value(GetSyncedValue(prefs::kHomePage)); + scoped_ptr<const base::Value> value(GetSyncedValue(prefs::kHomePage)); ASSERT_TRUE(value.get()); std::string string_value; EXPECT_TRUE(value->GetAsString(&string_value)); @@ -482,10 +483,10 @@ TEST_F(ProfileSyncServicePreferenceTest, EXPECT_EQ(example_url1_, prefs_->GetString(prefs::kHomePage)); // Expect that the new preference data contains the merged old prefs values. - scoped_ptr<ListValue> expected_urls(new ListValue); - expected_urls->Append(Value::CreateStringValue(example_url1_)); - expected_urls->Append(Value::CreateStringValue(example_url2_)); - expected_urls->Append(Value::CreateStringValue(example_url0_)); + scoped_ptr<base::ListValue> expected_urls(new base::ListValue); + expected_urls->Append(base::Value::CreateStringValue(example_url1_)); + expected_urls->Append(base::Value::CreateStringValue(example_url2_)); + expected_urls->Append(base::Value::CreateStringValue(example_url0_)); ASSERT_TRUE(HasSyncData(prefs::kURLsToRestoreOnStartup)); value.reset(GetSyncedValue(prefs::kURLsToRestoreOnStartup)); @@ -495,7 +496,7 @@ TEST_F(ProfileSyncServicePreferenceTest, Equals(expected_urls.get())); // The old preference name should also contain the merged sync data. - expected_urls.reset(new ListValue); + expected_urls.reset(new base::ListValue); value.reset(GetSyncedValue(prefs::kURLsToRestoreOnStartupOld)); ASSERT_TRUE(value.get()); EXPECT_TRUE(GetPreferenceValue(prefs::kURLsToRestoreOnStartupOld). @@ -509,24 +510,24 @@ TEST_F(ProfileSyncServicePreferenceTest, prefs_->SetString(prefs::kHomePage, example_url0_); { ListPrefUpdate update(prefs_, prefs::kURLsToRestoreOnStartupOld); - ListValue* url_list = update.Get(); - url_list->Append(Value::CreateStringValue(example_url0_)); - url_list->Append(Value::CreateStringValue(example_url1_)); + base::ListValue* url_list = update.Get(); + url_list->Append(base::Value::CreateStringValue(example_url0_)); + url_list->Append(base::Value::CreateStringValue(example_url1_)); } PreferenceValues cloud_data; STLValueDeleter<PreferenceValues> cloud_data_deleter(&cloud_data); - cloud_data[prefs::kHomePage] = Value::CreateStringValue(example_url1_); - ListValue* urls_to_restore = new ListValue; - urls_to_restore->Append(Value::CreateStringValue(example_url1_)); - urls_to_restore->Append(Value::CreateStringValue(example_url2_)); + cloud_data[prefs::kHomePage] = base::Value::CreateStringValue(example_url1_); + base::ListValue* urls_to_restore = new base::ListValue; + urls_to_restore->Append(base::Value::CreateStringValue(example_url1_)); + urls_to_restore->Append(base::Value::CreateStringValue(example_url2_)); cloud_data[prefs::kURLsToRestoreOnStartup] = urls_to_restore; AddPreferenceEntriesHelper helper(this, cloud_data); ASSERT_TRUE(StartSyncService(helper.callback(), false)); ASSERT_TRUE(helper.success()); - scoped_ptr<const Value> value(GetSyncedValue(prefs::kHomePage)); + scoped_ptr<const base::Value> value(GetSyncedValue(prefs::kHomePage)); ASSERT_TRUE(value.get()); std::string string_value; EXPECT_TRUE(value->GetAsString(&string_value)); @@ -534,9 +535,9 @@ TEST_F(ProfileSyncServicePreferenceTest, EXPECT_EQ(example_url1_, prefs_->GetString(prefs::kHomePage)); // Expect that the cloud data under the new migrated preference name sticks. - scoped_ptr<ListValue> expected_urls(new ListValue); - expected_urls->Append(Value::CreateStringValue(example_url1_)); - expected_urls->Append(Value::CreateStringValue(example_url2_)); + scoped_ptr<base::ListValue> expected_urls(new base::ListValue); + expected_urls->Append(base::Value::CreateStringValue(example_url1_)); + expected_urls->Append(base::Value::CreateStringValue(example_url2_)); ASSERT_TRUE(HasSyncData(prefs::kURLsToRestoreOnStartup)); value.reset(GetSyncedValue(prefs::kURLsToRestoreOnStartup)); @@ -546,9 +547,9 @@ TEST_F(ProfileSyncServicePreferenceTest, Equals(expected_urls.get())); // The old preference data should still be here, though not synced. - expected_urls.reset(new ListValue); - expected_urls->Append(Value::CreateStringValue(example_url0_)); - expected_urls->Append(Value::CreateStringValue(example_url1_)); + expected_urls.reset(new base::ListValue); + expected_urls->Append(base::Value::CreateStringValue(example_url0_)); + expected_urls->Append(base::Value::CreateStringValue(example_url1_)); value.reset(GetSyncedValue(prefs::kURLsToRestoreOnStartupOld)); ASSERT_FALSE(value.get()); @@ -563,24 +564,24 @@ TEST_F(ProfileSyncServicePreferenceTest, prefs_->SetString(prefs::kHomePage, example_url0_); { ListPrefUpdate update_old(prefs_, prefs::kURLsToRestoreOnStartupOld); - ListValue* url_list_old = update_old.Get(); - url_list_old->Append(Value::CreateStringValue(example_url0_)); - url_list_old->Append(Value::CreateStringValue(example_url1_)); + base::ListValue* url_list_old = update_old.Get(); + url_list_old->Append(base::Value::CreateStringValue(example_url0_)); + url_list_old->Append(base::Value::CreateStringValue(example_url1_)); ListPrefUpdate update(prefs_, prefs::kURLsToRestoreOnStartup); - ListValue* url_list = update.Get(); - url_list->Append(Value::CreateStringValue(example_url1_)); - url_list->Append(Value::CreateStringValue(example_url2_)); + base::ListValue* url_list = update.Get(); + url_list->Append(base::Value::CreateStringValue(example_url1_)); + url_list->Append(base::Value::CreateStringValue(example_url2_)); } PreferenceValues cloud_data; STLValueDeleter<PreferenceValues> cloud_data_deleter(&cloud_data); - cloud_data[prefs::kHomePage] = Value::CreateStringValue(example_url1_); + cloud_data[prefs::kHomePage] = base::Value::CreateStringValue(example_url1_); AddPreferenceEntriesHelper helper(this, cloud_data); ASSERT_TRUE(StartSyncService(helper.callback(), false)); ASSERT_TRUE(helper.success()); - scoped_ptr<const Value> value(GetSyncedValue(prefs::kHomePage)); + scoped_ptr<const base::Value> value(GetSyncedValue(prefs::kHomePage)); ASSERT_TRUE(value.get()); std::string string_value; EXPECT_TRUE(value->GetAsString(&string_value)); @@ -588,9 +589,9 @@ TEST_F(ProfileSyncServicePreferenceTest, EXPECT_EQ(example_url1_, prefs_->GetString(prefs::kHomePage)); // Expect that the cloud data under the new migrated preference name sticks. - scoped_ptr<ListValue> expected_urls(new ListValue); - expected_urls->Append(Value::CreateStringValue(example_url1_)); - expected_urls->Append(Value::CreateStringValue(example_url2_)); + scoped_ptr<base::ListValue> expected_urls(new base::ListValue); + expected_urls->Append(base::Value::CreateStringValue(example_url1_)); + expected_urls->Append(base::Value::CreateStringValue(example_url2_)); ASSERT_TRUE(HasSyncData(prefs::kURLsToRestoreOnStartup)); value.reset(GetSyncedValue(prefs::kURLsToRestoreOnStartup)); @@ -620,10 +621,11 @@ TEST_F(ProfileSyncServicePreferenceTest, UpdatedPreferenceWithDefaultValue) { ASSERT_TRUE(StartSyncService(create_root.callback(), false)); ASSERT_TRUE(create_root.success()); - scoped_ptr<Value> expected(Value::CreateStringValue(example_url0_)); + scoped_ptr<base::Value> expected( + base::Value::CreateStringValue(example_url0_)); profile_->GetPrefs()->Set(prefs::kHomePage, *expected); - scoped_ptr<const Value> actual(GetSyncedValue(prefs::kHomePage)); + scoped_ptr<const base::Value> actual(GetSyncedValue(prefs::kHomePage)); ASSERT_TRUE(actual.get()); EXPECT_TRUE(expected->Equals(actual.get())); } @@ -634,10 +636,11 @@ TEST_F(ProfileSyncServicePreferenceTest, UpdatedPreferenceWithValue) { ASSERT_TRUE(StartSyncService(create_root.callback(), false)); ASSERT_TRUE(create_root.success()); - scoped_ptr<Value> expected(Value::CreateStringValue(example_url1_)); + scoped_ptr<base::Value> expected( + base::Value::CreateStringValue(example_url1_)); profile_->GetPrefs()->Set(prefs::kHomePage, *expected); - scoped_ptr<const Value> actual(GetSyncedValue(prefs::kHomePage)); + scoped_ptr<const base::Value> actual(GetSyncedValue(prefs::kHomePage)); ASSERT_TRUE(actual.get()); EXPECT_TRUE(expected->Equals(actual.get())); } @@ -648,7 +651,8 @@ TEST_F(ProfileSyncServicePreferenceTest, UpdatedSyncNodeActionUpdate) { ASSERT_TRUE(StartSyncService(create_root.callback(), false)); ASSERT_TRUE(create_root.success()); - scoped_ptr<Value> expected(Value::CreateStringValue(example_url1_)); + scoped_ptr<base::Value> expected( + base::Value::CreateStringValue(example_url1_)); int64 node_id = SetSyncedValue(prefs::kHomePage, *expected); ASSERT_NE(node_id, syncer::kInvalidId); { @@ -660,7 +664,7 @@ TEST_F(ProfileSyncServicePreferenceTest, UpdatedSyncNodeActionUpdate) { } change_processor_->CommitChangesFromSyncModel(); - const Value& actual = GetPreferenceValue(prefs::kHomePage); + const base::Value& actual = GetPreferenceValue(prefs::kHomePage); EXPECT_TRUE(expected->Equals(&actual)); } @@ -669,7 +673,8 @@ TEST_F(ProfileSyncServicePreferenceTest, UpdatedSyncNodeActionAdd) { ASSERT_TRUE(StartSyncService(create_root.callback(), false)); ASSERT_TRUE(create_root.success()); - scoped_ptr<Value> expected(Value::CreateStringValue(example_url0_)); + scoped_ptr<base::Value> expected( + base::Value::CreateStringValue(example_url0_)); int64 node_id = SetSyncedValue(prefs::kHomePage, *expected); ASSERT_NE(node_id, syncer::kInvalidId); { @@ -681,7 +686,7 @@ TEST_F(ProfileSyncServicePreferenceTest, UpdatedSyncNodeActionAdd) { } change_processor_->CommitChangesFromSyncModel(); - const Value& actual = GetPreferenceValue(prefs::kHomePage); + const base::Value& actual = GetPreferenceValue(prefs::kHomePage); EXPECT_TRUE(expected->Equals(&actual)); EXPECT_EQ(1U, pref_sync_service_->registered_preferences().count(prefs::kHomePage)); @@ -692,7 +697,8 @@ TEST_F(ProfileSyncServicePreferenceTest, UpdatedSyncNodeUnknownPreference) { ASSERT_TRUE(StartSyncService(create_root.callback(), false)); ASSERT_TRUE(create_root.success()); - scoped_ptr<Value> expected(Value::CreateStringValue(example_url0_)); + scoped_ptr<base::Value> expected( + base::Value::CreateStringValue(example_url0_)); int64 node_id = SetSyncedValue("unknown preference", *expected); ASSERT_NE(node_id, syncer::kInvalidId); { @@ -710,8 +716,8 @@ TEST_F(ProfileSyncServicePreferenceTest, UpdatedSyncNodeUnknownPreference) { TEST_F(ProfileSyncServicePreferenceTest, ManagedPreferences) { // Make the homepage preference managed. - scoped_ptr<Value> managed_value( - Value::CreateStringValue("http://example.com")); + scoped_ptr<base::Value> managed_value( + base::Value::CreateStringValue("http://example.com")); prefs_->SetManagedPref(prefs::kHomePage, managed_value->DeepCopy()); CreateRootHelper create_root(this, syncer::PREFERENCES); @@ -719,15 +725,15 @@ TEST_F(ProfileSyncServicePreferenceTest, ManagedPreferences) { ASSERT_TRUE(create_root.success()); // Changing the homepage preference should not sync anything. - scoped_ptr<Value> user_value( - Value::CreateStringValue("http://chromium..com")); + scoped_ptr<base::Value> user_value( + base::Value::CreateStringValue("http://chromium..com")); prefs_->SetUserPref(prefs::kHomePage, user_value->DeepCopy()); EXPECT_EQ(NULL, GetSyncedValue(prefs::kHomePage)); // An incoming sync transaction should change the user value, not the managed // value. - scoped_ptr<Value> sync_value( - Value::CreateStringValue("http://crbug.com")); + scoped_ptr<base::Value> sync_value( + base::Value::CreateStringValue("http://crbug.com")); int64 node_id = SetSyncedValue(prefs::kHomePage, *sync_value); ASSERT_NE(node_id, syncer::kInvalidId); { @@ -748,40 +754,40 @@ TEST_F(ProfileSyncServicePreferenceTest, ManagedPreferences) { // managed preferences. TEST_F(ProfileSyncServicePreferenceTest, ManagedListPreferences) { // Make the list of urls to restore on startup managed. - ListValue managed_value; - managed_value.Append(Value::CreateStringValue(example_url0_)); - managed_value.Append(Value::CreateStringValue(example_url1_)); + base::ListValue managed_value; + managed_value.Append(base::Value::CreateStringValue(example_url0_)); + managed_value.Append(base::Value::CreateStringValue(example_url1_)); prefs_->SetManagedPref(prefs::kURLsToRestoreOnStartup, managed_value.DeepCopy()); // Set a cloud version. PreferenceValues cloud_data; STLValueDeleter<PreferenceValues> cloud_data_deleter(&cloud_data); - ListValue* urls_to_restore = new ListValue; - urls_to_restore->Append(Value::CreateStringValue(example_url1_)); - urls_to_restore->Append(Value::CreateStringValue(example_url2_)); + base::ListValue* urls_to_restore = new base::ListValue; + urls_to_restore->Append(base::Value::CreateStringValue(example_url1_)); + urls_to_restore->Append(base::Value::CreateStringValue(example_url2_)); cloud_data[prefs::kURLsToRestoreOnStartup] = urls_to_restore; // Start sync and verify the synced value didn't get merged. AddPreferenceEntriesHelper helper(this, cloud_data); ASSERT_TRUE(StartSyncService(helper.callback(), false)); ASSERT_TRUE(helper.success()); - scoped_ptr<const Value> actual( + scoped_ptr<const base::Value> actual( GetSyncedValue(prefs::kURLsToRestoreOnStartup)); EXPECT_TRUE(cloud_data[prefs::kURLsToRestoreOnStartup]->Equals(actual.get())); // Changing the user's urls to restore on startup pref should not sync // anything. - ListValue user_value; - user_value.Append(Value::CreateStringValue("http://chromium.org")); + base::ListValue user_value; + user_value.Append(base::Value::CreateStringValue("http://chromium.org")); prefs_->SetUserPref(prefs::kURLsToRestoreOnStartup, user_value.DeepCopy()); actual.reset(GetSyncedValue(prefs::kURLsToRestoreOnStartup)); EXPECT_TRUE(cloud_data[prefs::kURLsToRestoreOnStartup]->Equals(actual.get())); // An incoming sync transaction should change the user value, not the managed // value. - ListValue sync_value; - sync_value.Append(Value::CreateStringValue("http://crbug.com")); + base::ListValue sync_value; + sync_value.Append(base::Value::CreateStringValue("http://crbug.com")); int64 node_id = SetSyncedValue(prefs::kURLsToRestoreOnStartup, sync_value); ASSERT_NE(node_id, syncer::kInvalidId); { @@ -804,16 +810,16 @@ TEST_F(ProfileSyncServicePreferenceTest, DynamicManagedPreferences) { ASSERT_TRUE(StartSyncService(create_root.callback(), false)); ASSERT_TRUE(create_root.success()); - scoped_ptr<Value> initial_value( - Value::CreateStringValue("http://example.com/initial")); + scoped_ptr<base::Value> initial_value( + base::Value::CreateStringValue("http://example.com/initial")); profile_->GetPrefs()->Set(prefs::kHomePage, *initial_value); - scoped_ptr<const Value> actual(GetSyncedValue(prefs::kHomePage)); + scoped_ptr<const base::Value> actual(GetSyncedValue(prefs::kHomePage)); ASSERT_TRUE(actual.get()); EXPECT_TRUE(initial_value->Equals(actual.get())); // Switch kHomePage to managed and set a different value. - scoped_ptr<Value> managed_value( - Value::CreateStringValue("http://example.com/managed")); + scoped_ptr<base::Value> managed_value( + base::Value::CreateStringValue("http://example.com/managed")); profile_->GetTestingPrefService()->SetManagedPref( prefs::kHomePage, managed_value->DeepCopy()); @@ -833,21 +839,21 @@ TEST_F(ProfileSyncServicePreferenceTest, ASSERT_TRUE(StartSyncService(create_root.callback(), false)); ASSERT_TRUE(create_root.success()); - scoped_ptr<Value> initial_value( - Value::CreateStringValue("http://example.com/initial")); + scoped_ptr<base::Value> initial_value( + base::Value::CreateStringValue("http://example.com/initial")); profile_->GetPrefs()->Set(prefs::kHomePage, *initial_value); - scoped_ptr<const Value> actual(GetSyncedValue(prefs::kHomePage)); + scoped_ptr<const base::Value> actual(GetSyncedValue(prefs::kHomePage)); EXPECT_TRUE(initial_value->Equals(actual.get())); // Switch kHomePage to managed and set a different value. - scoped_ptr<Value> managed_value( - Value::CreateStringValue("http://example.com/managed")); + scoped_ptr<base::Value> managed_value( + base::Value::CreateStringValue("http://example.com/managed")); profile_->GetTestingPrefService()->SetManagedPref( prefs::kHomePage, managed_value->DeepCopy()); // Change the sync value. - scoped_ptr<Value> sync_value( - Value::CreateStringValue("http://example.com/sync")); + scoped_ptr<base::Value> sync_value( + base::Value::CreateStringValue("http://example.com/sync")); int64 node_id = SetSyncedValue(prefs::kHomePage, *sync_value); ASSERT_NE(node_id, syncer::kInvalidId); { @@ -880,8 +886,8 @@ TEST_F(ProfileSyncServicePreferenceTest, DynamicManagedDefaultPreferences) { EXPECT_TRUE(pref->IsDefaultValue()); EXPECT_TRUE(GetSyncedValue(prefs::kHomePage) == NULL); // Switch kHomePage to managed and set a different value. - scoped_ptr<Value> managed_value( - Value::CreateStringValue("http://example.com/managed")); + scoped_ptr<base::Value> managed_value( + base::Value::CreateStringValue("http://example.com/managed")); profile_->GetTestingPrefService()->SetManagedPref( prefs::kHomePage, managed_value->DeepCopy()); // The pref value should be the one dictated by policy. diff --git a/chrome/browser/sync/profile_sync_service_unittest.cc b/chrome/browser/sync/profile_sync_service_unittest.cc index 2d37a16..e055ca8 100644 --- a/chrome/browser/sync/profile_sync_service_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_unittest.cc @@ -189,7 +189,7 @@ TEST_F(ProfileSyncServiceTest, InitialState) { TEST_F(ProfileSyncServiceTest, SuccessfulInitialization) { profile()->GetTestingPrefService()->SetManagedPref( prefs::kSyncManaged, - Value::CreateBooleanValue(false)); + base::Value::CreateBooleanValue(false)); IssueTestTokens(); CreateService(ProfileSyncService::AUTO_START); ExpectDataTypeManagerCreation(); @@ -221,7 +221,7 @@ TEST_F(ProfileSyncServiceTest, SetupInProgress) { TEST_F(ProfileSyncServiceTest, DisabledByPolicyBeforeInit) { profile()->GetTestingPrefService()->SetManagedPref( prefs::kSyncManaged, - Value::CreateBooleanValue(true)); + base::Value::CreateBooleanValue(true)); IssueTestTokens(); CreateService(ProfileSyncService::AUTO_START); Initialize(); @@ -243,7 +243,7 @@ TEST_F(ProfileSyncServiceTest, DisabledByPolicyAfterInit) { profile()->GetTestingPrefService()->SetManagedPref( prefs::kSyncManaged, - Value::CreateBooleanValue(true)); + base::Value::CreateBooleanValue(true)); EXPECT_TRUE(service()->IsManaged()); EXPECT_FALSE(service()->sync_initialized()); diff --git a/chrome/browser/sync/sync_prefs.cc b/chrome/browser/sync/sync_prefs.cc index 794ee47..ac166ac 100644 --- a/chrome/browser/sync/sync_prefs.cc +++ b/chrome/browser/sync/sync_prefs.cc @@ -371,7 +371,7 @@ void SyncPrefs::AcknowledgeSyncedTypes(syncer::ModelTypeSet types) { syncer::ModelTypeSetFromValue( *pref_service_->GetList(prefs::kSyncAcknowledgedSyncTypes))); - scoped_ptr<ListValue> value( + scoped_ptr<base::ListValue> value( syncer::ModelTypeSetToValue(acknowledged_types)); pref_service_->Set(prefs::kSyncAcknowledgedSyncTypes, *value); } diff --git a/chrome/browser/sync/test/integration/extension_settings_helper.cc b/chrome/browser/sync/test/integration/extension_settings_helper.cc index b51d590..f576aba 100644 --- a/chrome/browser/sync/test/integration/extension_settings_helper.cc +++ b/chrome/browser/sync/test/integration/extension_settings_helper.cc @@ -28,7 +28,7 @@ namespace extension_settings_helper { namespace { -std::string ToJson(const Value& value) { +std::string ToJson(const base::Value& value) { std::string json; base::JSONWriter::WriteWithOptions(&value, base::JSONWriter::OPTIONS_PRETTY_PRINT, @@ -36,7 +36,7 @@ std::string ToJson(const Value& value) { return json; } -void GetAllSettingsOnFileThread(DictionaryValue* out, +void GetAllSettingsOnFileThread(base::DictionaryValue* out, base::WaitableEvent* signal, ValueStore* storage) { CHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); @@ -44,10 +44,10 @@ void GetAllSettingsOnFileThread(DictionaryValue* out, signal->Signal(); } -scoped_ptr<DictionaryValue> GetAllSettings( +scoped_ptr<base::DictionaryValue> GetAllSettings( Profile* profile, const std::string& id) { base::WaitableEvent signal(false, false); - scoped_ptr<DictionaryValue> settings(new DictionaryValue()); + scoped_ptr<base::DictionaryValue> settings(new base::DictionaryValue()); profile->GetExtensionService()->settings_frontend()->RunWithStorage( id, extensions::settings_namespace::SYNC, @@ -69,8 +69,10 @@ bool AreSettingsSame(Profile* expected_profile, Profile* actual_profile) { for (extensions::ExtensionSet::const_iterator it = extensions->begin(); it != extensions->end(); ++it) { const std::string& id = (*it)->id(); - scoped_ptr<DictionaryValue> expected(GetAllSettings(expected_profile, id)); - scoped_ptr<DictionaryValue> actual(GetAllSettings(actual_profile, id)); + scoped_ptr<base::DictionaryValue> expected( + GetAllSettings(expected_profile, id)); + scoped_ptr<base::DictionaryValue> actual( + GetAllSettings(actual_profile, id)); if (!expected->Equals(actual.get())) { ADD_FAILURE() << "Expected " << ToJson(*expected) << " got " << ToJson(*actual); @@ -81,7 +83,7 @@ bool AreSettingsSame(Profile* expected_profile, Profile* actual_profile) { } void SetSettingsOnFileThread( - const DictionaryValue* settings, + const base::DictionaryValue* settings, base::WaitableEvent* signal, ValueStore* storage) { CHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); @@ -92,7 +94,9 @@ void SetSettingsOnFileThread( } // namespace void SetExtensionSettings( - Profile* profile, const std::string& id, const DictionaryValue& settings) { + Profile* profile, + const std::string& id, + const base::DictionaryValue& settings) { base::WaitableEvent signal(false, false); profile->GetExtensionService()->settings_frontend()->RunWithStorage( id, @@ -102,7 +106,7 @@ void SetExtensionSettings( } void SetExtensionSettingsForAllProfiles( - const std::string& id, const DictionaryValue& settings) { + const std::string& id, const base::DictionaryValue& settings) { for (int i = 0; i < test()->num_clients(); ++i) SetExtensionSettings(test()->GetProfile(i), id, settings); SetExtensionSettings(test()->verifier(), id, settings); diff --git a/chrome/browser/sync/test/integration/multiple_client_preferences_sync_test.cc b/chrome/browser/sync/test/integration/multiple_client_preferences_sync_test.cc index 601a514..735f65d 100644 --- a/chrome/browser/sync/test/integration/multiple_client_preferences_sync_test.cc +++ b/chrome/browser/sync/test/integration/multiple_client_preferences_sync_test.cc @@ -25,8 +25,8 @@ IN_PROC_BROWSER_TEST_F(MultipleClientPreferencesSyncTest, Sanity) { DisableVerifier(); for (int i = 0; i < num_clients(); ++i) { - ListValue urls; - urls.Append(Value::CreateStringValue( + base::ListValue urls; + urls.Append(base::Value::CreateStringValue( base::StringPrintf("http://www.google.com/%d", i))); ChangeListPref(i, prefs::kURLsToRestoreOnStartup, urls); } diff --git a/chrome/browser/sync/test/integration/preferences_helper.cc b/chrome/browser/sync/test/integration/preferences_helper.cc index b456eab..283a733 100644 --- a/chrome/browser/sync/test/integration/preferences_helper.cc +++ b/chrome/browser/sync/test/integration/preferences_helper.cc @@ -75,11 +75,11 @@ void ChangeFilePathPref(int index, void ChangeListPref(int index, const char* pref_name, - const ListValue& new_value) { + const base::ListValue& new_value) { { ListPrefUpdate update(GetPrefs(index), pref_name); - ListValue* list = update.Get(); - for (ListValue::const_iterator it = new_value.begin(); + base::ListValue* list = update.Get(); + for (base::ListValue::const_iterator it = new_value.begin(); it != new_value.end(); ++it) { list->Append((*it)->DeepCopy()); @@ -88,8 +88,8 @@ void ChangeListPref(int index, if (test()->use_verifier()) { ListPrefUpdate update_verifier(GetVerifierPrefs(), pref_name); - ListValue* list_verifier = update_verifier.Get(); - for (ListValue::const_iterator it = new_value.begin(); + base::ListValue* list_verifier = update_verifier.Get(); + for (base::ListValue::const_iterator it = new_value.begin(); it != new_value.end(); ++it) { list_verifier->Append((*it)->DeepCopy()); @@ -200,7 +200,7 @@ bool FilePathPrefMatches(const char* pref_name) { } bool ListPrefMatches(const char* pref_name) { - const ListValue* reference_value; + const base::ListValue* reference_value; if (test()->use_verifier()) { reference_value = GetVerifierPrefs()->GetList(pref_name); } else { diff --git a/chrome/browser/sync/test/integration/preferences_helper.h b/chrome/browser/sync/test/integration/preferences_helper.h index ac122e6..da3689e7 100644 --- a/chrome/browser/sync/test/integration/preferences_helper.h +++ b/chrome/browser/sync/test/integration/preferences_helper.h @@ -67,7 +67,7 @@ void ChangeFilePathPref(int index, // |verifier| if DisableVerifier() hasn't been called. void ChangeListPref(int index, const char* pref_name, - const ListValue& new_value); + const base::ListValue& new_value); // Used to verify that the boolean preference with name |pref_name| has the // same value across all profiles. Also checks |verifier| if DisableVerifier() diff --git a/chrome/browser/sync/test/integration/profile_sync_service_harness.cc b/chrome/browser/sync/test/integration/profile_sync_service_harness.cc index b779956..80478db 100644 --- a/chrome/browser/sync/test/integration/profile_sync_service_harness.cc +++ b/chrome/browser/sync/test/integration/profile_sync_service_harness.cc @@ -905,7 +905,7 @@ size_t ProfileSyncServiceHarness::GetNumDatatypes() const { } std::string ProfileSyncServiceHarness::GetServiceStatus() { - scoped_ptr<DictionaryValue> value( + scoped_ptr<base::DictionaryValue> value( sync_ui_util::ConstructAboutInformation(service())); std::string service_status; base::JSONWriter::WriteWithOptions(value.get(), diff --git a/chrome/browser/sync/test/integration/sync_extension_helper.cc b/chrome/browser/sync/test/integration/sync_extension_helper.cc index e9c187c..ec9efb8 100644 --- a/chrome/browser/sync/test/integration/sync_extension_helper.cc +++ b/chrome/browser/sync/test/integration/sync_extension_helper.cc @@ -274,7 +274,7 @@ std::string NameToPublicKey(const std::string& name) { scoped_refptr<Extension> CreateExtension(const base::FilePath& base_dir, const std::string& name, Manifest::Type type) { - DictionaryValue source; + base::DictionaryValue source; source.SetString(extensions::manifest_keys::kName, name); const std::string& public_key = NameToPublicKey(name); source.SetString(extensions::manifest_keys::kPublicKey, public_key); @@ -284,19 +284,20 @@ scoped_refptr<Extension> CreateExtension(const base::FilePath& base_dir, // Do nothing. break; case Manifest::TYPE_THEME: - source.Set(extensions::manifest_keys::kTheme, new DictionaryValue()); + source.Set(extensions::manifest_keys::kTheme, + new base::DictionaryValue()); break; case Manifest::TYPE_HOSTED_APP: case Manifest::TYPE_LEGACY_PACKAGED_APP: - source.Set(extensions::manifest_keys::kApp, new DictionaryValue()); + source.Set(extensions::manifest_keys::kApp, new base::DictionaryValue()); source.SetString(extensions::manifest_keys::kLaunchWebURL, "http://www.example.com"); break; case Manifest::TYPE_PLATFORM_APP: { - source.Set(extensions::manifest_keys::kApp, new DictionaryValue()); + source.Set(extensions::manifest_keys::kApp, new base::DictionaryValue()); source.Set(extensions::manifest_keys::kPlatformAppBackground, - new DictionaryValue()); - ListValue* scripts = new ListValue(); + new base::DictionaryValue()); + base::ListValue* scripts = new base::ListValue(); scripts->AppendString("main.js"); source.Set(extensions::manifest_keys::kPlatformAppBackgroundScripts, scripts); diff --git a/chrome/browser/sync/test/integration/two_client_extension_settings_and_app_settings_sync_test.cc b/chrome/browser/sync/test/integration/two_client_extension_settings_and_app_settings_sync_test.cc index daf4bf7..8de4565 100644 --- a/chrome/browser/sync/test/integration/two_client_extension_settings_and_app_settings_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_extension_settings_and_app_settings_sync_test.cc @@ -30,26 +30,26 @@ void MutateSomeSettings( const std::string& extension2) { { // Write to extension0 from profile 0 but not profile 1. - DictionaryValue settings; + base::DictionaryValue settings; settings.SetString("asdf", base::StringPrintf("asdfasdf-%d", seed)); SetExtensionSettings(test()->verifier(), extension0, settings); SetExtensionSettings(test()->GetProfile(0), extension0, settings); } { // Write the same data to extension1 from both profiles. - DictionaryValue settings; + base::DictionaryValue settings; settings.SetString("asdf", base::StringPrintf("asdfasdf-%d", seed)); settings.SetString("qwer", base::StringPrintf("qwerqwer-%d", seed)); SetExtensionSettingsForAllProfiles(extension1, settings); } { // Write different data to extension2 from each profile. - DictionaryValue settings0; + base::DictionaryValue settings0; settings0.SetString("zxcv", base::StringPrintf("zxcvzxcv-%d", seed)); SetExtensionSettings(test()->verifier(), extension2, settings0); SetExtensionSettings(test()->GetProfile(0), extension2, settings0); - DictionaryValue settings1; + base::DictionaryValue settings1; settings1.SetString("1324", base::StringPrintf("12341234-%d", seed)); settings1.SetString("5687", base::StringPrintf("56785678-%d", seed)); SetExtensionSettings(test()->verifier(), extension2, settings1); @@ -79,12 +79,12 @@ testing::AssertionResult StartWithSameSettingsTest( // Leave extension0 empty. } { - DictionaryValue settings; + base::DictionaryValue settings; settings.SetString("foo", "bar"); SetExtensionSettingsForAllProfiles(extension1, settings); } { - DictionaryValue settings; + base::DictionaryValue settings; settings.SetString("foo", "bar"); settings.SetString("baz", "qux"); SetExtensionSettingsForAllProfiles(extension2, settings); @@ -129,13 +129,13 @@ testing::AssertionResult StartWithDifferentSettingsTest( // results, so test (empty, empty). } { - DictionaryValue settings; + base::DictionaryValue settings; settings.SetString("foo", "bar"); SetExtensionSettings(test()->verifier(), extension1, settings); SetExtensionSettings(test()->GetProfile(0), extension1, settings); } { - DictionaryValue settings; + base::DictionaryValue settings; settings.SetString("foo", "bar"); settings.SetString("baz", "qux"); SetExtensionSettings(test()->verifier(), extension2, settings); diff --git a/chrome/browser/sync/test/integration/two_client_preferences_sync_test.cc b/chrome/browser/sync/test/integration/two_client_preferences_sync_test.cc index 85ade0b..1533b8c1 100644 --- a/chrome/browser/sync/test/integration/two_client_preferences_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_preferences_sync_test.cc @@ -226,9 +226,9 @@ IN_PROC_BROWSER_TEST_F(TwoClientPreferencesSyncTest, ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); ASSERT_TRUE(IntegerPrefMatches(prefs::kRestoreOnStartup)); - ListValue urls; - urls.Append(Value::CreateStringValue("http://www.google.com/")); - urls.Append(Value::CreateStringValue("http://www.flickr.com/")); + base::ListValue urls; + urls.Append(base::Value::CreateStringValue("http://www.google.com/")); + urls.Append(base::Value::CreateStringValue("http://www.flickr.com/")); ChangeIntegerPref(0, prefs::kRestoreOnStartup, 4); ChangeListPref(0, prefs::kURLsToRestoreOnStartup, urls); ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |