Update To 11.40.268.0
[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/skia/include/core/SkColor.h"
12 #include "third_party/WebKit/public/web/WebPermissionClient.h"
13
14 namespace blink {
15
16 class WebNode;
17 class WebURL;
18
19 }  // namespace blink
20
21 namespace xwalk {
22
23 // Render process side of XWalkRenderViewHostExt, this provides cross-process
24 // implementation of miscellaneous WebView functions that we need to poke
25 // WebKit directly to implement (and that aren't needed in the chrome app).
26 class XWalkRenderViewExt : public content::RenderViewObserver {
27  public:
28   static void RenderViewCreated(content::RenderView* render_view);
29
30  private:
31   explicit XWalkRenderViewExt(content::RenderView* render_view);
32   virtual ~XWalkRenderViewExt();
33
34   // RenderView::Observer:
35   bool OnMessageReceived(const IPC::Message& message) override;
36   void DidCommitProvisionalLoad(blink::WebLocalFrame* frame,
37                                 bool is_new_navigation) override;
38   void FocusedNodeChanged(const blink::WebNode& node) override;
39   void DidCommitCompositorFrame() override;
40
41   void OnDocumentHasImagesRequest(int id);
42
43   void OnDoHitTest(int view_x, int view_y);
44
45   void OnSetTextZoomLevel(double zoom_level);
46
47   void OnResetScrollAndScaleState();
48
49   void OnSetInitialPageScale(double page_scale_factor);
50
51   void UpdatePageScaleFactor();
52
53   void OnSetBackgroundColor(SkColor c);
54
55   float page_scale_factor_;
56
57   DISALLOW_COPY_AND_ASSIGN(XWalkRenderViewExt);
58 };
59
60 }  // namespace xwalk
61
62 #endif  // XWALK_RUNTIME_RENDERER_ANDROID_XWALK_RENDER_VIEW_EXT_H_