Add zoom support (issue #514).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@695 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2012-06-12 19:50:24 +00:00
parent 85bf734046
commit fd5c3c0d75
12 changed files with 208 additions and 1 deletions

View File

@@ -335,6 +335,29 @@ CefString CefBrowserHostImpl::GetDevToolsURL(bool http_scheme) {
return (http_scheme ? devtools_url_http_ : devtools_url_chrome_);
}
double CefBrowserHostImpl::GetZoomLevel() {
// Verify that this method is being called on the UI thread.
if (!CEF_CURRENTLY_ON_UIT()) {
NOTREACHED() << "called on invalid thread";
return 0;
}
if (web_contents_.get())
return web_contents_->GetZoomLevel();
return 0;
}
void CefBrowserHostImpl::SetZoomLevel(double zoomLevel) {
if (CEF_CURRENTLY_ON_UIT()) {
if (web_contents_.get() && web_contents_->GetRenderViewHost())
web_contents_->GetRenderViewHost()->SetZoomLevel(zoomLevel);
} else {
CEF_POST_TASK(CEF_UIT,
base::Bind(&CefBrowserHostImpl::SetZoomLevel, this, zoomLevel));
}
}
// CefBrowser methods.
// -----------------------------------------------------------------------------