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/skia/include/core/SkColor.h"
12 #include "third_party/WebKit/public/web/WebPermissionClient.h"
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 {
28 static void RenderViewCreated(content::RenderView* render_view);
31 explicit XWalkRenderViewExt(content::RenderView* render_view);
32 virtual ~XWalkRenderViewExt();
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;
41 void OnDocumentHasImagesRequest(int id);
43 void OnDoHitTest(int view_x, int view_y);
45 void OnSetTextZoomLevel(double zoom_level);
47 void OnResetScrollAndScaleState();
49 void OnSetInitialPageScale(double page_scale_factor);
51 void UpdatePageScaleFactor();
53 void OnSetBackgroundColor(SkColor c);
55 float page_scale_factor_;
57 DISALLOW_COPY_AND_ASSIGN(XWalkRenderViewExt);
62 #endif // XWALK_RUNTIME_RENDERER_ANDROID_XWALK_RENDER_VIEW_EXT_H_