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

Unified Diff: android_webview/renderer/aw_render_view_ext.cc

Issue 12567020: [android] Resize the android_webview if it's 0x0 initially. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « android_webview/renderer/aw_render_view_ext.h ('k') | build/android/adb_run_android_webview_shell » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/renderer/aw_render_view_ext.cc
diff --git a/android_webview/renderer/aw_render_view_ext.cc b/android_webview/renderer/aw_render_view_ext.cc
index 2e253ef7b70c5e2f5109faf4b648588a335fd815..27a72420bdeb845a8f1a961092ea3b9cd233abd5 100644
--- a/android_webview/renderer/aw_render_view_ext.cc
+++ b/android_webview/renderer/aw_render_view_ext.cc
@@ -127,7 +127,7 @@ void PopulateHitTestData(const GURL& absolute_link_url,
} // namespace
AwRenderViewExt::AwRenderViewExt(content::RenderView* render_view)
- : content::RenderViewObserver(render_view) {
+ : content::RenderViewObserver(render_view), page_scale_factor_(0.0f) {
render_view->GetWebView()->setPermissionClient(this);
}
@@ -192,6 +192,18 @@ void AwRenderViewExt::DidCommitProvisionalLoad(WebKit::WebFrame* frame,
}
}
+void AwRenderViewExt::DidCommitCompositorFrame() {
+ UpdatePageScaleFactor();
+}
+
+void AwRenderViewExt::UpdatePageScaleFactor() {
+ if (page_scale_factor_ != render_view()->GetWebView()->pageScaleFactor()) {
+ page_scale_factor_ = render_view()->GetWebView()->pageScaleFactor();
+ Send(new AwViewHostMsg_PageScaleFactorChanged(routing_id(),
+ page_scale_factor_));
+ }
+}
+
void AwRenderViewExt::FocusedNodeChanged(const WebKit::WebNode& node) {
if (node.isNull() || !node.isElementNode() || !render_view())
return;
« no previous file with comments | « android_webview/renderer/aw_render_view_ext.h ('k') | build/android/adb_run_android_webview_shell » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698