0

Use rewritten url of a tab to find the zoom level from zoom map. Zoom map is

maintained using rewritten URLs. Using GetURL() to find the zoom level will
fail in case of rewritten URLs as GetURL() returns virtual_url which will be
different from the rewritten URL.

Contributed by wrm364@motorola.com

BUG=94408

Review URL: http://codereview.chromium.org/8262011

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105474 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
wrm364@motorola.com
2011-10-14 09:11:19 +00:00
parent 4aeb78ca15
commit 2ae88d13a1
2 changed files with 7 additions and 1 deletions
AUTHORS
content/browser/tab_contents

@ -134,3 +134,4 @@ Vamshikrishna Yellenki <vamshi@motorola.com>
Robert Nagy <robert@openbsd.org>
Nayan Kumar K <qtc746@motorola.com>
ShankarGanesh K <blr.bmlab@gmail.com>
Goutham Jagannatha <wrm364@motorola.com>

@ -820,7 +820,12 @@ double TabContents::GetZoomLevel() const {
zoom_level = zoom_map->GetTemporaryZoomLevel(
GetRenderProcessHost()->id(), render_view_host()->routing_id());
} else {
zoom_level = zoom_map->GetZoomLevel(net::GetHostOrSpecFromURL(GetURL()));
GURL url;
NavigationEntry* active_entry = controller().GetActiveEntry();
// Since zoom map is updated using rewritten URL, use rewritten URL
// to get the zoom level.
url = active_entry ? active_entry->url() : GURL::EmptyGURL();
zoom_level = zoom_map->GetZoomLevel(net::GetHostOrSpecFromURL(url));
}
return zoom_level;
}