Chromium Code Reviews| Index: content/browser/host_zoom_map.cc |
| diff --git a/content/browser/host_zoom_map.cc b/content/browser/host_zoom_map.cc |
| index 3d504034e3f9c513740bd8890e251e7a769164f0..0fedfb34e5f6951630d12a9aa884f4be3e464e73 100644 |
| --- a/content/browser/host_zoom_map.cc |
| +++ b/content/browser/host_zoom_map.cc |
| @@ -62,25 +62,25 @@ void HostZoomMap::Load() { |
| const std::string& host(*i); |
| double zoom_level = 0; |
| - bool success = host_zoom_dictionary->GetDoubleWithoutPathExpansion( |
| - host, &zoom_level); |
| - if (!success) { |
| - // The data used to be stored as ints, so try that. |
| - int int_zoom_level; |
| - success = host_zoom_dictionary->GetIntegerWithoutPathExpansion( |
| - host, &int_zoom_level); |
| - if (success) { |
| - zoom_level = static_cast<double>(int_zoom_level); |
| - // Since the values were once stored as non-clamped, clamp now. |
| - double zoom_factor = WebView::zoomLevelToZoomFactor(zoom_level); |
| - if (zoom_factor < WebView::minTextSizeMultiplier) { |
| - zoom_level = |
| - WebView::zoomFactorToZoomLevel(WebView::minTextSizeMultiplier); |
| - } else if (zoom_factor > WebView::maxTextSizeMultiplier) { |
| - zoom_level = |
| - WebView::zoomFactorToZoomLevel(WebView::maxTextSizeMultiplier); |
| - } |
| + // The data used to be stored as ints, so try that first. Note that |
| + // GetDoubleWithoutPathExpansion supports both Integer and Double values. |
| + int int_zoom_level; |
| + bool success = host_zoom_dictionary->GetIntegerWithoutPathExpansion( |
| + host, &int_zoom_level); |
| + if (success) { |
| + zoom_level = static_cast<double>(int_zoom_level); |
| + // Since the values were once stored as non-clamped, clamp now. |
| + double zoom_factor = WebView::zoomLevelToZoomFactor(zoom_level); |
| + if (zoom_factor < WebView::minTextSizeMultiplier) { |
| + zoom_level = |
| + WebView::zoomFactorToZoomLevel(WebView::minTextSizeMultiplier); |
| + } else if (zoom_factor > WebView::maxTextSizeMultiplier) { |
| + zoom_level = |
| + WebView::zoomFactorToZoomLevel(WebView::maxTextSizeMultiplier); |
| } |
| + } else { |
| + success = host_zoom_dictionary->GetDoubleWithoutPathExpansion( |
|
jam
2011/05/02 16:17:04
why not only call GetDoubleWithoutPathExpansion?
Yusuke Sato
2011/05/04 14:10:10
Done. Removed the old code.
|
| + host, &zoom_level); |
| } |
| DCHECK(success); |
| host_zoom_levels_[host] = zoom_level; |