44ae82d4bac0810df37b8b70a1d374b17fa8772a
[platform/framework/web/crosswalk.git] / src / xwalk / runtime / renderer / android / xwalk_render_view_ext.h
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.
4
5 #ifndef XWALK_RUNTIME_RENDERER_ANDROID_XWALK_RENDER_VIEW_EXT_H_
6 #define XWALK_RUNTIME_RENDERER_ANDROID_XWALK_RENDER_VIEW_EXT_H_
7
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"
12
13 namespace blink {
14
15 class WebNode;
16 class WebURL;
17
18 }  // namespace WebKit
19
20 namespace xwalk {
21
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 {
26  public:
27   static void RenderViewCreated(content::RenderView* render_view);
28
29  private:
30   explicit XWalkRenderViewExt(content::RenderView* render_view);
31   virtual ~XWalkRenderViewExt();
32
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;
39
40   void OnDocumentHasImagesRequest(int id);
41
42   void OnDoHitTest(int view_x, int view_y);
43
44   void OnSetTextZoomLevel(double zoom_level);
45
46   void OnResetScrollAndScaleState();
47
48   void OnSetInitialPageScale(double page_scale_factor);
49
50   void UpdatePageScaleFactor();
51
52   bool capture_picture_enabled_;
53
54   float page_scale_factor_;
55
56   DISALLOW_COPY_AND_ASSIGN(XWalkRenderViewExt);
57 };
58
59 }  // namespace xwalk
60
61 #endif  // XWALK_RUNTIME_RENDERER_ANDROID_XWALK_RENDER_VIEW_EXT_H_