Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 11866004: Add scheme to HostZoomMap (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix alignment, add comment Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698