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
3 // found in the LICENSE file.
5 #ifndef XWALK_RUNTIME_RENDERER_ANDROID_XWALK_RENDER_VIEW_EXT_H_
6 #define XWALK_RUNTIME_RENDERER_ANDROID_XWALK_RENDER_VIEW_EXT_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "content/public/renderer/render_view_observer.h"
11 #include "third_party/WebKit/public/web/WebPermissionClient.h"
22 // Render process side of XWalkRenderViewHostExt, this provides cross-process
23 // implementation of miscellaneous WebView functions that we need to poke
24 // WebKit directly to implement (and that aren't needed in the chrome app).
25 class XWalkRenderViewExt : public content::RenderViewObserver {
27 static void RenderViewCreated(content::RenderView* render_view);
30 explicit XWalkRenderViewExt(content::RenderView* render_view);
31 virtual ~XWalkRenderViewExt();
33 // RenderView::Observer:
34 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
35 virtual void DidCommitProvisionalLoad(blink::WebLocalFrame* frame,
36 bool is_new_navigation) OVERRIDE;
37 virtual void FocusedNodeChanged(const blink::WebNode& node) OVERRIDE;
38 virtual void DidCommitCompositorFrame() OVERRIDE;
40 void OnDocumentHasImagesRequest(int id);
42 void OnDoHitTest(int view_x, int view_y);
44 void OnSetTextZoomLevel(double zoom_level);
46 void OnResetScrollAndScaleState();
48 void OnSetInitialPageScale(double page_scale_factor);
50 void UpdatePageScaleFactor();
52 bool capture_picture_enabled_;
54 float page_scale_factor_;
56 DISALLOW_COPY_AND_ASSIGN(XWalkRenderViewExt);
61 #endif // XWALK_RUNTIME_RENDERER_ANDROID_XWALK_RENDER_VIEW_EXT_H_