| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/base/webui/web_ui_util.h" | 5 #include "ui/base/webui/web_ui_util.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 return false; | 85 return false; |
| 86 } | 86 } |
| 87 *scale_factor = static_cast<float>(scale); | 87 *scale_factor = static_cast<float>(scale); |
| 88 return true; | 88 return true; |
| 89 } | 89 } |
| 90 | 90 |
| 91 void ParsePathAndScale(const GURL& url, | 91 void ParsePathAndScale(const GURL& url, |
| 92 std::string* path, | 92 std::string* path, |
| 93 float* scale_factor) { | 93 float* scale_factor) { |
| 94 *path = net::UnescapeURLComponent( | 94 *path = net::UnescapeURLComponent( |
| 95 url.path().substr(1), | 95 url.path().substr(1).as_string(), |
| 96 net::UnescapeRule::URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS | | 96 net::UnescapeRule::URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS | |
| 97 net::UnescapeRule::SPACES); | 97 net::UnescapeRule::SPACES); |
| 98 if (scale_factor) | 98 if (scale_factor) |
| 99 *scale_factor = 1.0f; | 99 *scale_factor = 1.0f; |
| 100 | 100 |
| 101 // Detect and parse resource string ending in @<scale>x. | 101 // Detect and parse resource string ending in @<scale>x. |
| 102 std::size_t pos = path->rfind('@'); | 102 std::size_t pos = path->rfind('@'); |
| 103 if (pos != std::string::npos) { | 103 if (pos != std::string::npos) { |
| 104 base::StringPiece stripped_path(*path); | 104 base::StringPiece stripped_path(*path); |
| 105 float factor; | 105 float factor; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 IDS_WEB_FONT_SIZE_XP : | 176 IDS_WEB_FONT_SIZE_XP : |
| 177 #endif | 177 #endif |
| 178 IDS_WEB_FONT_SIZE); | 178 IDS_WEB_FONT_SIZE); |
| 179 } | 179 } |
| 180 | 180 |
| 181 std::string GetTextDirection() { | 181 std::string GetTextDirection() { |
| 182 return base::i18n::IsRTL() ? "rtl" : "ltr"; | 182 return base::i18n::IsRTL() ? "rtl" : "ltr"; |
| 183 } | 183 } |
| 184 | 184 |
| 185 } // namespace webui | 185 } // namespace webui |
| OLD | NEW |