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

Unified Diff: chrome/browser/extensions/api/settings_private/settings_private_delegate.cc

Issue 2422603003: MD Settings: handle zoom as floats to fix ghost zoom level issue (Closed)
Patch Set: todo Created 4 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
Index: chrome/browser/extensions/api/settings_private/settings_private_delegate.cc
diff --git a/chrome/browser/extensions/api/settings_private/settings_private_delegate.cc b/chrome/browser/extensions/api/settings_private/settings_private_delegate.cc
index 4e8b6f5a5db5123407afa31e03bd1f7c47015d09..299ce59dfac8ee659865b3f8613a13b4e2a4fe30 100644
--- a/chrome/browser/extensions/api/settings_private/settings_private_delegate.cc
+++ b/chrome/browser/extensions/api/settings_private/settings_private_delegate.cc
@@ -60,15 +60,14 @@ PrefsUtil::SetPrefResult SettingsPrivateDelegate::SetPref(
std::unique_ptr<base::Value> SettingsPrivateDelegate::GetDefaultZoomPercent() {
double zoom = content::ZoomLevelToZoomFactor(
- profile_->GetZoomLevelPrefs()->GetDefaultZoomLevelPref()) * 100;
- std::unique_ptr<base::Value> value(
- new base::FundamentalValue(std::round(zoom)));
+ profile_->GetZoomLevelPrefs()->GetDefaultZoomLevelPref());
+ std::unique_ptr<base::Value> value(new base::FundamentalValue(zoom));
return value;
}
PrefsUtil::SetPrefResult SettingsPrivateDelegate::SetDefaultZoomPercent(
- int percent) {
- double zoom_factor = content::ZoomFactorToZoomLevel(percent * 0.01);
+ double percent) {
+ double zoom_factor = content::ZoomFactorToZoomLevel(percent);
profile_->GetZoomLevelPrefs()->SetDefaultZoomLevelPref(zoom_factor);
return PrefsUtil::SetPrefResult::SUCCESS;
}

Powered by Google App Engine
This is Rietveld 408576698