| Index: ui/display/display.cc
|
| diff --git a/ui/display/display.cc b/ui/display/display.cc
|
| index 25573f8f9b90e3408ab9234162a0a9b0c92aae70..4903a223a2e83504178e42aec18e4d985796ae16 100644
|
| --- a/ui/display/display.cc
|
| +++ b/ui/display/display.cc
|
| @@ -90,6 +90,22 @@ void Display::ResetForceDeviceScaleFactorForTesting() {
|
| g_forced_device_scale_factor = -1.0;
|
| }
|
|
|
| +// static
|
| +void Display::SetForceDeviceScaleFactor(double dsf) {
|
| + std::string str_value = base::DoubleToString(dsf);
|
| +
|
| + // We need a precision of upto 2 decimal point.
|
| + if (str_value.length() > 4)
|
| + str_value.erase(str_value.begin() + 4, str_value.end());
|
| +
|
| + // Reset any previously set values and unset the flag.
|
| + g_has_forced_device_scale_factor = -1;
|
| + g_forced_device_scale_factor = -1.0;
|
| +
|
| + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
|
| + switches::kForceDeviceScaleFactor, str_value);
|
| +}
|
| +
|
| Display::Display() : Display(kInvalidDisplayId) {}
|
|
|
| Display::Display(int64_t id) : Display(id, gfx::Rect()) {}
|
|
|