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 1837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1848 double zoom_level; | 1848 double zoom_level; |
1849 if (temporary_zoom_settings_) { | 1849 if (temporary_zoom_settings_) { |
1850 zoom_level = zoom_map->GetTemporaryZoomLevel( | 1850 zoom_level = zoom_map->GetTemporaryZoomLevel( |
1851 GetRenderProcessHost()->GetID(), GetRenderViewHost()->GetRoutingID()); | 1851 GetRenderProcessHost()->GetID(), GetRenderViewHost()->GetRoutingID()); |
1852 } else { | 1852 } else { |
1853 GURL url; | 1853 GURL url; |
1854 NavigationEntry* active_entry = GetController().GetActiveEntry(); | 1854 NavigationEntry* active_entry = GetController().GetActiveEntry(); |
1855 // Since zoom map is updated using rewritten URL, use rewritten URL | 1855 // Since zoom map is updated using rewritten URL, use rewritten URL |
1856 // to get the zoom level. | 1856 // to get the zoom level. |
1857 url = active_entry ? active_entry->GetURL() : GURL::EmptyGURL(); | 1857 url = active_entry ? active_entry->GetURL() : GURL::EmptyGURL(); |
1858 zoom_level = zoom_map->GetZoomLevel(net::GetHostOrSpecFromURL(url)); | 1858 zoom_level = zoom_map->GetZoomLevel(url.scheme(), |
| 1859 net::GetHostOrSpecFromURL(url)); |
1859 } | 1860 } |
1860 return zoom_level; | 1861 return zoom_level; |
1861 } | 1862 } |
1862 | 1863 |
1863 int WebContentsImpl::GetZoomPercent(bool* enable_increment, | 1864 int WebContentsImpl::GetZoomPercent(bool* enable_increment, |
1864 bool* enable_decrement) const { | 1865 bool* enable_decrement) const { |
1865 *enable_decrement = *enable_increment = false; | 1866 *enable_decrement = *enable_increment = false; |
1866 // Calculate the zoom percent from the factor. Round up to the nearest whole | 1867 // Calculate the zoom percent from the factor. Round up to the nearest whole |
1867 // number. | 1868 // number. |
1868 int percent = static_cast<int>( | 1869 int percent = static_cast<int>( |
(...skipping 1583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3452 | 3453 |
3453 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() { | 3454 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() { |
3454 return browser_plugin_guest_.get(); | 3455 return browser_plugin_guest_.get(); |
3455 } | 3456 } |
3456 | 3457 |
3457 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() { | 3458 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() { |
3458 return browser_plugin_embedder_.get(); | 3459 return browser_plugin_embedder_.get(); |
3459 } | 3460 } |
3460 | 3461 |
3461 } // namespace content | 3462 } // namespace content |
OLD | NEW |