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

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: Created 7 years, 11 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 1792 matching lines...) Expand 10 before | Expand all | Expand 10 after
1803 double zoom_level; 1803 double zoom_level;
1804 if (temporary_zoom_settings_) { 1804 if (temporary_zoom_settings_) {
1805 zoom_level = zoom_map->GetTemporaryZoomLevel( 1805 zoom_level = zoom_map->GetTemporaryZoomLevel(
1806 GetRenderProcessHost()->GetID(), GetRenderViewHost()->GetRoutingID()); 1806 GetRenderProcessHost()->GetID(), GetRenderViewHost()->GetRoutingID());
1807 } else { 1807 } else {
1808 GURL url; 1808 GURL url;
1809 NavigationEntry* active_entry = GetController().GetActiveEntry(); 1809 NavigationEntry* active_entry = GetController().GetActiveEntry();
1810 // Since zoom map is updated using rewritten URL, use rewritten URL 1810 // Since zoom map is updated using rewritten URL, use rewritten URL
1811 // to get the zoom level. 1811 // to get the zoom level.
1812 url = active_entry ? active_entry->GetURL() : GURL::EmptyGURL(); 1812 url = active_entry ? active_entry->GetURL() : GURL::EmptyGURL();
1813 zoom_level = zoom_map->GetZoomLevel(net::GetHostOrSpecFromURL(url)); 1813 zoom_level = zoom_map->GetZoomLevel(url.scheme(),
1814 net::GetHostOrSpecFromURL(url));
1814 } 1815 }
1815 return zoom_level; 1816 return zoom_level;
1816 } 1817 }
1817 1818
1818 int WebContentsImpl::GetZoomPercent(bool* enable_increment, 1819 int WebContentsImpl::GetZoomPercent(bool* enable_increment,
1819 bool* enable_decrement) const { 1820 bool* enable_decrement) const {
1820 *enable_decrement = *enable_increment = false; 1821 *enable_decrement = *enable_increment = false;
1821 // Calculate the zoom percent from the factor. Round up to the nearest whole 1822 // Calculate the zoom percent from the factor. Round up to the nearest whole
1822 // number. 1823 // number.
1823 int percent = static_cast<int>( 1824 int percent = static_cast<int>(
(...skipping 1577 matching lines...) Expand 10 before | Expand all | Expand 10 after
3401 3402
3402 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() { 3403 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() {
3403 return browser_plugin_guest_.get(); 3404 return browser_plugin_guest_.get();
3404 } 3405 }
3405 3406
3406 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() { 3407 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() {
3407 return browser_plugin_embedder_.get(); 3408 return browser_plugin_embedder_.get();
3408 } 3409 }
3409 3410
3410 } // namespace content 3411 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698