blob: c6d3bba9de24da1090a8f7ce2b0dc50abdc9e13c [file] [log] [blame]
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "content/public/renderer/render_view_observer.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebPermissionClient.h"
namespace WebKit {
class WebNode;
class WebURL;
} // namespace WebKit
namespace android_webview {
// Render process side of AwRenderViewHostExt, this provides cross-process
// implementation of miscellaneous WebView functions that we need to poke
// WebKit directly to implement (and that aren't needed in the chrome app).
class AwRenderViewExt : public content::RenderViewObserver,
public WebKit::WebPermissionClient {
static void RenderViewCreated(content::RenderView* render_view);
AwRenderViewExt(content::RenderView* render_view);
virtual ~AwRenderViewExt();
// RenderView::Observer:
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
virtual void DidCommitProvisionalLoad(WebKit::WebFrame* frame,
bool is_new_navigation) OVERRIDE;
virtual void FocusedNodeChanged(const WebKit::WebNode& node) OVERRIDE;
void OnDocumentHasImagesRequest(int id);
void OnDoHitTest(int view_x, int view_y);
// WebKit::WebPermissionClient implementation.
virtual bool allowImage(WebKit::WebFrame* frame,
bool enabledPerSettings,
const WebKit::WebURL& imageURL) OVERRIDE;
} // namespace android_webview