Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1695)

Unified Diff: chrome/browser/profiles/off_the_record_profile_impl_unittest.cc

Issue 541103002: Introduce ChromeZoomLevelPref, make zoom level prefs independent of profile prefs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove obsolete access of ZoomController from WebUILoginView. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/profiles/host_zoom_map_browsertest.cc ('k') | chrome/browser/profiles/profile.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/off_the_record_profile_impl_unittest.cc
diff --git a/chrome/browser/profiles/off_the_record_profile_impl_unittest.cc b/chrome/browser/profiles/off_the_record_profile_impl_unittest.cc
index 521bc75b3e15ff80c1b6944cdf7210f5e00b0a88..9bb689a66256b75941e1a20199f899d62e2e1072 100644
--- a/chrome/browser/profiles/off_the_record_profile_impl_unittest.cc
+++ b/chrome/browser/profiles/off_the_record_profile_impl_unittest.cc
@@ -9,6 +9,7 @@
#include "base/prefs/scoped_user_pref_update.h"
#include "base/run_loop.h"
#include "chrome/browser/prefs/browser_prefs.h"
+#include "chrome/browser/ui/zoom/chrome_zoom_level_prefs.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/browser_with_test_window_test.h"
#include "chrome/test/base/testing_browser_process.h"
@@ -27,11 +28,13 @@ namespace {
class TestingProfileWithHostZoomMap : public TestingProfile {
public:
TestingProfileWithHostZoomMap() {
- zoom_subscription_ =
- HostZoomMap::GetDefaultForBrowserContext(this)
- ->AddZoomLevelChangedCallback(
- base::Bind(&TestingProfileWithHostZoomMap::OnZoomLevelChanged,
- base::Unretained(this)));
+ HostZoomMap* host_zoom_map = HostZoomMap::GetDefaultForBrowserContext(this);
+ zoom_subscription_ = host_zoom_map->AddZoomLevelChangedCallback(
+ base::Bind(&TestingProfileWithHostZoomMap::OnZoomLevelChanged,
+ base::Unretained(this)));
+ zoom_level_prefs_.reset(
+ new chrome::ChromeZoomLevelPrefs(GetPrefs(), GetPath()));
+ zoom_level_prefs_->InitPrefsAndCopyToHostZoomMap(GetPath(), host_zoom_map);
}
virtual ~TestingProfileWithHostZoomMap() {}
@@ -50,7 +53,10 @@ class TestingProfileWithHostZoomMap : public TestingProfile {
HostZoomMap* host_zoom_map = HostZoomMap::GetDefaultForBrowserContext(this);
double level = change.zoom_level;
- DictionaryPrefUpdate update(prefs_.get(), prefs::kPerHostZoomLevels);
+ std::string per_host_zoom_levels(prefs::kPartitionPerHostZoomLevels);
+ per_host_zoom_levels.append(".0");
+ DictionaryPrefUpdate update(GetPrefs(),
+ prefs::kPartitionPerHostZoomLevels);
base::DictionaryValue* host_zoom_dictionary = update.Get();
if (content::ZoomValuesEqual(level, host_zoom_map->GetDefaultZoomLevel())) {
host_zoom_dictionary->RemoveWithoutPathExpansion(change.host, NULL);
@@ -61,6 +67,7 @@ class TestingProfileWithHostZoomMap : public TestingProfile {
}
scoped_ptr<HostZoomMap::Subscription> zoom_subscription_;
+ scoped_ptr<chrome::ChromeZoomLevelPrefs> zoom_level_prefs_;
DISALLOW_COPY_AND_ASSIGN(TestingProfileWithHostZoomMap);
};
« no previous file with comments | « chrome/browser/profiles/host_zoom_map_browsertest.cc ('k') | chrome/browser/profiles/profile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698