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

Unified Diff: ui/base/webui/web_ui_util.cc

Issue 291733004: Reduce the use of ui::ScaleFactor in webui/favicon (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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: ui/base/webui/web_ui_util.cc
diff --git a/ui/base/webui/web_ui_util.cc b/ui/base/webui/web_ui_util.cc
index 56c84f73457fc2e4e9bf6c5c46c1621ee7138cb4..e2f1786069f0ac13e0e5382f3cda8ceb5aa4ca01 100644
--- a/ui/base/webui/web_ui_util.cc
+++ b/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)) {

Powered by Google App Engine
This is Rietveld 408576698