diff options
author | battre@chromium.org <battre@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-07 11:32:17 +0000 |
---|---|---|
committer | battre@chromium.org <battre@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-07 11:32:17 +0000 |
commit | db7e6d20d9d8b770a031e7e39fc5d37d982cda17 (patch) | |
tree | 6bb4fa3d835e619f82eff3413e266a639c76e6f0 | |
parent | 8e1349ae97b4a13cc1babe85944ae42907a456ed (diff) | |
download | chromium_src-db7e6d20d9d8b770a031e7e39fc5d37d982cda17.zip chromium_src-db7e6d20d9d8b770a031e7e39fc5d37d982cda17.tar.gz chromium_src-db7e6d20d9d8b770a031e7e39fc5d37d982cda17.tar.bz2 |
Get rid of PrefService::GetMutableDictionary/GetMutableList
BUG=77914
TEST=none, trybots remain green
Review URL: http://codereview.chromium.org/6720013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80762 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | content/browser/host_zoom_map.cc | 5 | ||||
-rw-r--r-- | content/browser/host_zoom_map_unittest.cc | 9 |
2 files changed, 8 insertions, 6 deletions
diff --git a/content/browser/host_zoom_map.cc b/content/browser/host_zoom_map.cc index 2e5d82e..523d6d7 100644 --- a/content/browser/host_zoom_map.cc +++ b/content/browser/host_zoom_map.cc @@ -127,10 +127,9 @@ void HostZoomMap::SetZoomLevel(const GURL& url, double level) { updating_preferences_ = true; { - ScopedUserPrefUpdate update(profile_->GetPrefs(), + DictionaryPrefUpdate update(profile_->GetPrefs(), prefs::kPerHostZoomLevels); - DictionaryValue* host_zoom_dictionary = - profile_->GetPrefs()->GetMutableDictionary(prefs::kPerHostZoomLevels); + DictionaryValue* host_zoom_dictionary = update.Get(); if (level == default_zoom_level_) { host_zoom_dictionary->RemoveWithoutPathExpansion(host, NULL); } else { diff --git a/content/browser/host_zoom_map_unittest.cc b/content/browser/host_zoom_map_unittest.cc index b6bc4a4..30f092d 100644 --- a/content/browser/host_zoom_map_unittest.cc +++ b/content/browser/host_zoom_map_unittest.cc @@ -7,6 +7,7 @@ #include "base/utf_string_conversions.h" #include "base/values.h" #include "chrome/browser/prefs/pref_service.h" +#include "chrome/browser/prefs/scoped_user_pref_update.h" #include "chrome/common/pref_names.h" #include "chrome/test/testing_profile.h" #include "content/browser/browser_thread.h" @@ -62,9 +63,11 @@ TEST_F(HostZoomMapTest, LoadNoPrefs) { } TEST_F(HostZoomMapTest, Load) { - DictionaryValue* dict = - prefs_->GetMutableDictionary(prefs::kPerHostZoomLevels); - dict->SetWithoutPathExpansion(host_, Value::CreateDoubleValue(kZoomLevel)); + { + DictionaryPrefUpdate update(prefs_, prefs::kPerHostZoomLevels); + DictionaryValue* dict = update.Get(); + dict->SetWithoutPathExpansion(host_, Value::CreateDoubleValue(kZoomLevel)); + } scoped_refptr<HostZoomMap> map(new HostZoomMap(&profile_)); EXPECT_EQ(kZoomLevel, map->GetZoomLevel(url_)); } |