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

Unified Diff: chrome/browser/ui/webui/options/browser_options_handler.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: Created 6 years, 3 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
Index: chrome/browser/ui/webui/options/browser_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/browser_options_handler.cc b/chrome/browser/ui/webui/options/browser_options_handler.cc
index d3b772e0fcfeaee3a936c0ea55239921568252af..b4a222042826ee9e4d9f9e76f30c0933c6697290 100644
--- a/chrome/browser/ui/webui/options/browser_options_handler.cc
+++ b/chrome/browser/ui/webui/options/browser_options_handler.cc
@@ -790,6 +790,8 @@ void BrowserOptionsHandler::PageLoadStarted() {
void BrowserOptionsHandler::InitializeHandler() {
Profile* profile = Profile::FromWebUI(web_ui());
PrefService* prefs = profile->GetPrefs();
+ PrefService* zoom_level_prefs = profile->GetZoomLevelPrefs();
+ DCHECK(zoom_level_prefs);
ProfileSyncService* sync_service(
ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile));
@@ -847,7 +849,8 @@ void BrowserOptionsHandler::InitializeHandler() {
base::Bind(&BrowserOptionsHandler::SetupAutoOpenFileTypes,
base::Unretained(this)));
default_zoom_level_.Init(
- prefs::kDefaultZoomLevel, prefs,
+ prefs::kDefaultZoomLevel,
+ zoom_level_prefs,
base::Bind(&BrowserOptionsHandler::SetupPageZoomSelector,
base::Unretained(this)));
profile_pref_registrar_.Init(prefs);
@@ -1711,8 +1714,9 @@ void BrowserOptionsHandler::SetupFontSizeSelector() {
}
void BrowserOptionsHandler::SetupPageZoomSelector() {
- PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs();
- double default_zoom_level = pref_service->GetDouble(prefs::kDefaultZoomLevel);
+ double default_zoom_level =
+ content::HostZoomMap::GetDefaultForBrowserContext(
+ Profile::FromWebUI(web_ui()))->GetDefaultZoomLevel();
double default_zoom_factor =
content::ZoomLevelToZoomFactor(default_zoom_level);

Powered by Google App Engine
This is Rietveld 408576698