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

Unified Diff: android_webview/browser/renderer_host/view_renderer_host.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
Index: android_webview/browser/renderer_host/view_renderer_host.cc
diff --git a/android_webview/browser/renderer_host/view_renderer_host.cc b/android_webview/browser/renderer_host/view_renderer_host.cc
index e6a354c31ef6106ae1daa1274d475d8465cf78b9..1a21b04fd97d2ac3f9d2bf37b635999fa518e9f6 100644
--- a/android_webview/browser/renderer_host/view_renderer_host.cc
+++ b/android_webview/browser/renderer_host/view_renderer_host.cc
@@ -21,6 +21,7 @@ ViewRendererHost::ViewRendererHost(content::WebContents* contents,
Client* client)
: content::WebContentsObserver(contents),
client_(client) {
+ DCHECK(client);
}
ViewRendererHost::~ViewRendererHost() {
@@ -40,10 +41,8 @@ void ViewRendererHost::EnableCapturePictureCallback(bool enabled) {
}
void ViewRendererHost::OnPictureUpdated() {
- if (client_) {
- client_->OnPictureUpdated(web_contents()->GetRenderProcessHost()->GetID(),
- routing_id());
- }
+ client_->OnPictureUpdated(web_contents()->GetRenderProcessHost()->GetID(),
+ routing_id());
}
void ViewRendererHost::OnDidActivateAcceleratedCompositing(
@@ -68,6 +67,13 @@ void ViewRendererHost::OnDidActivateAcceleratedCompositing(
content_view_core->SetInputHandler(input_handler);
}
+void ViewRendererHost::OnPageScaleFactorChanged(float page_scale_factor) {
+ client_->OnPageScaleFactorChanged(
+ web_contents()->GetRenderProcessHost()->GetID(),
+ routing_id(),
+ page_scale_factor);
+}
+
void ViewRendererHost::RenderViewGone(base::TerminationStatus status) {
DCHECK(CalledOnValidThread());
RendererPictureMap::GetInstance()->ClearRendererPicture(
@@ -81,6 +87,8 @@ bool ViewRendererHost::OnMessageReceived(const IPC::Message& message) {
OnPictureUpdated)
IPC_MESSAGE_HANDLER(AwViewHostMsg_DidActivateAcceleratedCompositing,
OnDidActivateAcceleratedCompositing)
+ IPC_MESSAGE_HANDLER(AwViewHostMsg_PageScaleFactorChanged,
+ OnPageScaleFactorChanged)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
« no previous file with comments | « android_webview/browser/renderer_host/view_renderer_host.h ('k') | android_webview/common/render_view_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698