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 1917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1928 double zoom_level; | 1928 double zoom_level; |
1929 if (temporary_zoom_settings_) { | 1929 if (temporary_zoom_settings_) { |
1930 zoom_level = zoom_map->GetTemporaryZoomLevel( | 1930 zoom_level = zoom_map->GetTemporaryZoomLevel( |
1931 GetRenderProcessHost()->GetID(), GetRenderViewHost()->GetRoutingID()); | 1931 GetRenderProcessHost()->GetID(), GetRenderViewHost()->GetRoutingID()); |
1932 } else { | 1932 } else { |
1933 GURL url; | 1933 GURL url; |
1934 NavigationEntry* active_entry = GetController().GetActiveEntry(); | 1934 NavigationEntry* active_entry = GetController().GetActiveEntry(); |
1935 // Since zoom map is updated using rewritten URL, use rewritten URL | 1935 // Since zoom map is updated using rewritten URL, use rewritten URL |
1936 // to get the zoom level. | 1936 // to get the zoom level. |
1937 url = active_entry ? active_entry->GetURL() : GURL::EmptyGURL(); | 1937 url = active_entry ? active_entry->GetURL() : GURL::EmptyGURL(); |
1938 zoom_level = zoom_map->GetZoomLevel(net::GetHostOrSpecFromURL(url)); | 1938 zoom_level = zoom_map->GetZoomLevelForHostAndScheme(url.scheme(), |
| 1939 net::GetHostOrSpecFromURL(url)); |
1939 } | 1940 } |
1940 return zoom_level; | 1941 return zoom_level; |
1941 } | 1942 } |
1942 | 1943 |
1943 int WebContentsImpl::GetZoomPercent(bool* enable_increment, | 1944 int WebContentsImpl::GetZoomPercent(bool* enable_increment, |
1944 bool* enable_decrement) const { | 1945 bool* enable_decrement) const { |
1945 *enable_decrement = *enable_increment = false; | 1946 *enable_decrement = *enable_increment = false; |
1946 // Calculate the zoom percent from the factor. Round up to the nearest whole | 1947 // Calculate the zoom percent from the factor. Round up to the nearest whole |
1947 // number. | 1948 // number. |
1948 int percent = static_cast<int>( | 1949 int percent = static_cast<int>( |
(...skipping 1580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3529 | 3530 |
3530 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() const { | 3531 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() const { |
3531 return browser_plugin_guest_.get(); | 3532 return browser_plugin_guest_.get(); |
3532 } | 3533 } |
3533 | 3534 |
3534 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() const { | 3535 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() const { |
3535 return browser_plugin_embedder_.get(); | 3536 return browser_plugin_embedder_.get(); |
3536 } | 3537 } |
3537 | 3538 |
3538 } // namespace content | 3539 } // namespace content |
OLD | NEW |