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 1869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1880 double zoom_level; | 1880 double zoom_level; |
1881 if (temporary_zoom_settings_) { | 1881 if (temporary_zoom_settings_) { |
1882 zoom_level = zoom_map->GetTemporaryZoomLevel( | 1882 zoom_level = zoom_map->GetTemporaryZoomLevel( |
1883 GetRenderProcessHost()->GetID(), GetRenderViewHost()->GetRoutingID()); | 1883 GetRenderProcessHost()->GetID(), GetRenderViewHost()->GetRoutingID()); |
1884 } else { | 1884 } else { |
1885 GURL url; | 1885 GURL url; |
1886 NavigationEntry* active_entry = GetController().GetActiveEntry(); | 1886 NavigationEntry* active_entry = GetController().GetActiveEntry(); |
1887 // Since zoom map is updated using rewritten URL, use rewritten URL | 1887 // Since zoom map is updated using rewritten URL, use rewritten URL |
1888 // to get the zoom level. | 1888 // to get the zoom level. |
1889 url = active_entry ? active_entry->GetURL() : GURL::EmptyGURL(); | 1889 url = active_entry ? active_entry->GetURL() : GURL::EmptyGURL(); |
1890 zoom_level = zoom_map->GetZoomLevel(net::GetHostOrSpecFromURL(url)); | 1890 zoom_level = zoom_map->GetZoomLevelForHostAndScheme(url.scheme(), |
| 1891 net::GetHostOrSpecFromURL(url)); |
1891 } | 1892 } |
1892 return zoom_level; | 1893 return zoom_level; |
1893 } | 1894 } |
1894 | 1895 |
1895 int WebContentsImpl::GetZoomPercent(bool* enable_increment, | 1896 int WebContentsImpl::GetZoomPercent(bool* enable_increment, |
1896 bool* enable_decrement) const { | 1897 bool* enable_decrement) const { |
1897 *enable_decrement = *enable_increment = false; | 1898 *enable_decrement = *enable_increment = false; |
1898 // Calculate the zoom percent from the factor. Round up to the nearest whole | 1899 // Calculate the zoom percent from the factor. Round up to the nearest whole |
1899 // number. | 1900 // number. |
1900 int percent = static_cast<int>( | 1901 int percent = static_cast<int>( |
(...skipping 1600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3501 } | 3502 } |
3502 | 3503 |
3503 BrowserPluginGuestManager* | 3504 BrowserPluginGuestManager* |
3504 WebContentsImpl::GetBrowserPluginGuestManager() const { | 3505 WebContentsImpl::GetBrowserPluginGuestManager() const { |
3505 return static_cast<BrowserPluginGuestManager*>( | 3506 return static_cast<BrowserPluginGuestManager*>( |
3506 GetBrowserContext()->GetUserData( | 3507 GetBrowserContext()->GetUserData( |
3507 browser_plugin::kBrowserPluginGuestManagerKeyName)); | 3508 browser_plugin::kBrowserPluginGuestManagerKeyName)); |
3508 } | 3509 } |
3509 | 3510 |
3510 } // namespace content | 3511 } // namespace content |
OLD | NEW |