diff options
Diffstat (limited to 'chromium/ui/base/webui/web_ui_util.cc')
-rw-r--r-- | chromium/ui/base/webui/web_ui_util.cc | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/chromium/ui/base/webui/web_ui_util.cc b/chromium/ui/base/webui/web_ui_util.cc index d901491300b..e2f1786069f 100644 --- a/chromium/ui/base/webui/web_ui_util.cc +++ b/chromium/ui/base/webui/web_ui_util.cc @@ -76,8 +76,8 @@ WindowOpenDisposition GetDispositionFromClick(const base::ListValue* args, } bool ParseScaleFactor(const base::StringPiece& identifier, - ui::ScaleFactor* scale_factor) { - *scale_factor = ui::SCALE_FACTOR_100P; + float* scale_factor) { + *scale_factor = 1.0f; if (identifier.empty()) { LOG(WARNING) << "Invalid scale factor format: " << identifier; return false; @@ -95,25 +95,24 @@ bool ParseScaleFactor(const base::StringPiece& identifier, LOG(WARNING) << "Invalid scale factor format: " << identifier; return false; } - - *scale_factor = ui::GetSupportedScaleFactor(static_cast<float>(scale)); + *scale_factor = scale; return true; } void ParsePathAndScale(const GURL& url, std::string* path, - ui::ScaleFactor* scale_factor) { + float* scale_factor) { *path = net::UnescapeURLComponent(url.path().substr(1), (net::UnescapeRule::URL_SPECIAL_CHARS | net::UnescapeRule::SPACES)); if (scale_factor) - *scale_factor = ui::SCALE_FACTOR_100P; + *scale_factor = 1.0f; // Detect and parse resource string ending in @<scale>x. std::size_t pos = path->rfind('@'); if (pos != std::string::npos) { base::StringPiece stripped_path(*path); - ui::ScaleFactor factor; + float factor; if (ParseScaleFactor(stripped_path.substr( pos + 1, stripped_path.length() - pos - 1), &factor)) { @@ -140,9 +139,9 @@ void SetFontAndTextDirection(base::DictionaryValue* localized_strings) { std::string font_family = l10n_util::GetStringUTF8(web_font_family_id); -#if defined(TOOLKIT_GTK) - // Use the system font on Linux/GTK. Keep the hard-coded font families as - // backup in case for some crazy reason this one isn't available. +// TODO(dnicoara) Remove Ozone check when PlatformFont support is introduced +// into Ozone: crbug.com/320050 +#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(USE_OZONE) font_family = ui::ResourceBundle::GetSharedInstance().GetFont( ui::ResourceBundle::BaseFont).GetFontName() + ", " + font_family; #endif |