| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 1815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1826 NavigationEntry* active_entry = GetController().GetActiveEntry(); | 1826 NavigationEntry* active_entry = GetController().GetActiveEntry(); |
| 1827 // Since zoom map is updated using rewritten URL, use rewritten URL | 1827 // Since zoom map is updated using rewritten URL, use rewritten URL |
| 1828 // to get the zoom level. | 1828 // to get the zoom level. |
| 1829 url = active_entry ? active_entry->GetURL() : GURL::EmptyGURL(); | 1829 url = active_entry ? active_entry->GetURL() : GURL::EmptyGURL(); |
| 1830 zoom_level = zoom_map->GetZoomLevel(net::GetHostOrSpecFromURL(url)); | 1830 zoom_level = zoom_map->GetZoomLevel(net::GetHostOrSpecFromURL(url)); |
| 1831 } | 1831 } |
| 1832 return zoom_level; | 1832 return zoom_level; |
| 1833 } | 1833 } |
| 1834 | 1834 |
| 1835 int WebContentsImpl::GetZoomPercent(bool* enable_increment, | 1835 int WebContentsImpl::GetZoomPercent(bool* enable_increment, |
| 1836 bool* enable_decrement) { | 1836 bool* enable_decrement) const { |
| 1837 *enable_decrement = *enable_increment = false; | 1837 *enable_decrement = *enable_increment = false; |
| 1838 // Calculate the zoom percent from the factor. Round up to the nearest whole | 1838 // Calculate the zoom percent from the factor. Round up to the nearest whole |
| 1839 // number. | 1839 // number. |
| 1840 int percent = static_cast<int>( | 1840 int percent = static_cast<int>( |
| 1841 WebKit::WebView::zoomLevelToZoomFactor(GetZoomLevel()) * 100 + 0.5); | 1841 WebKit::WebView::zoomLevelToZoomFactor(GetZoomLevel()) * 100 + 0.5); |
| 1842 *enable_decrement = percent > minimum_zoom_percent_; | 1842 *enable_decrement = percent > minimum_zoom_percent_; |
| 1843 *enable_increment = percent < maximum_zoom_percent_; | 1843 *enable_increment = percent < maximum_zoom_percent_; |
| 1844 return percent; | 1844 return percent; |
| 1845 } | 1845 } |
| 1846 | 1846 |
| (...skipping 1546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3393 } | 3393 } |
| 3394 } | 3394 } |
| 3395 | 3395 |
| 3396 content::BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() { | 3396 content::BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() { |
| 3397 return browser_plugin_guest_.get(); | 3397 return browser_plugin_guest_.get(); |
| 3398 } | 3398 } |
| 3399 | 3399 |
| 3400 content::BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() { | 3400 content::BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() { |
| 3401 return browser_plugin_embedder_.get(); | 3401 return browser_plugin_embedder_.get(); |
| 3402 } | 3402 } |
| OLD | NEW |