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

Unified Diff: ui/gfx/display.cc

Issue 1278173006: Default to 1 when --force-device-scale-factor has an invalid value. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: with unit test Created 5 years, 4 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 | « base/strings/string_number_conversions.h ('k') | ui/gfx/display_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/display.cc
diff --git a/ui/gfx/display.cc b/ui/gfx/display.cc
index 03949cb315c7f34e38d90e7905c22ad96c58eba8..7b77ae40eac7e72f1a6eb4a16b14bc6ee36cf6e7 100644
--- a/ui/gfx/display.cc
+++ b/ui/gfx/display.cc
@@ -40,8 +40,10 @@ float GetForcedDeviceScaleFactorImpl() {
std::string value =
base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
switches::kForceDeviceScaleFactor);
- if (!base::StringToDouble(value, &scale_in_double))
+ if (!base::StringToDouble(value, &scale_in_double)) {
LOG(ERROR) << "Failed to parse the default device scale factor:" << value;
+ scale_in_double = 1.0;
+ }
}
return static_cast<float>(scale_in_double);
}
« no previous file with comments | « base/strings/string_number_conversions.h ('k') | ui/gfx/display_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698