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

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: Few more fixes 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 1798 matching lines...) Expand 10 before | Expand all | Expand 10 after
1809 double zoom_level; 1809 double zoom_level;
1810 if (temporary_zoom_settings_) { 1810 if (temporary_zoom_settings_) {
1811 zoom_level = zoom_map->GetTemporaryZoomLevel( 1811 zoom_level = zoom_map->GetTemporaryZoomLevel(
1812 GetRenderProcessHost()->GetID(), GetRenderViewHost()->GetRoutingID()); 1812 GetRenderProcessHost()->GetID(), GetRenderViewHost()->GetRoutingID());
1813 } else { 1813 } else {
1814 GURL url; 1814 GURL url;
1815 NavigationEntry* active_entry = GetController().GetActiveEntry(); 1815 NavigationEntry* active_entry = GetController().GetActiveEntry();
1816 // Since zoom map is updated using rewritten URL, use rewritten URL 1816 // Since zoom map is updated using rewritten URL, use rewritten URL
1817 // to get the zoom level. 1817 // to get the zoom level.
1818 url = active_entry ? active_entry->GetURL() : GURL::EmptyGURL(); 1818 url = active_entry ? active_entry->GetURL() : GURL::EmptyGURL();
1819 zoom_level = zoom_map->GetZoomLevel(net::GetHostOrSpecFromURL(url)); 1819 zoom_level = zoom_map->GetZoomLevel(url.scheme(),
1820 net::GetHostOrSpecFromURL(url));
1820 } 1821 }
1821 return zoom_level; 1822 return zoom_level;
1822 } 1823 }
1823 1824
1824 int WebContentsImpl::GetZoomPercent(bool* enable_increment, 1825 int WebContentsImpl::GetZoomPercent(bool* enable_increment,
1825 bool* enable_decrement) const { 1826 bool* enable_decrement) const {
1826 *enable_decrement = *enable_increment = false; 1827 *enable_decrement = *enable_increment = false;
1827 // Calculate the zoom percent from the factor. Round up to the nearest whole 1828 // Calculate the zoom percent from the factor. Round up to the nearest whole
1828 // number. 1829 // number.
1829 int percent = static_cast<int>( 1830 int percent = static_cast<int>(
(...skipping 1577 matching lines...) Expand 10 before | Expand all | Expand 10 after
3407 3408
3408 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() { 3409 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() {
3409 return browser_plugin_guest_.get(); 3410 return browser_plugin_guest_.get();
3410 } 3411 }
3411 3412
3412 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() { 3413 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() {
3413 return browser_plugin_embedder_.get(); 3414 return browser_plugin_embedder_.get();
3414 } 3415 }
3415 3416
3416 } // namespace content 3417 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698