blob: 4a5447f9f4f9b056a83a05c79d297bbf919bb9b8 [file] [log] [blame]
[email protected]f1c3c7972012-08-21 18:28:301// 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 ANDROID_WEBVIEW_NATIVE_AW_WEB_CONTENTS_DELEGATE_H_
6#define ANDROID_WEBVIEW_NATIVE_AW_WEB_CONTENTS_DELEGATE_H_
7
8#include <jni.h>
9
[email protected]9a3449062012-11-14 14:05:1410#include "content/components/web_contents_delegate_android/web_contents_delegate_android.h"
[email protected]f1c3c7972012-08-21 18:28:3011
12namespace android_webview {
13
14// WebView specific WebContentsDelegate.
15// Should contain WebContentsDelegate code required by WebView that should not
16// be part of the Chromium Android port.
17class AwWebContentsDelegate
[email protected]9a3449062012-11-14 14:05:1418 : public content::WebContentsDelegateAndroid {
[email protected]f1c3c7972012-08-21 18:28:3019 public:
20 AwWebContentsDelegate(JNIEnv* env, jobject obj);
21 virtual ~AwWebContentsDelegate();
[email protected]19fd5fa2012-09-20 19:28:3922 virtual content::JavaScriptDialogCreator* GetJavaScriptDialogCreator()
23 OVERRIDE;
[email protected]55750b32012-09-21 14:05:0324 virtual void FindReply(content::WebContents* web_contents,
25 int request_id,
26 int number_of_matches,
27 const gfx::Rect& selection_rect,
28 int active_match_ordinal,
29 bool final_update) OVERRIDE;
[email protected]7f8619f2012-10-15 21:22:5730 virtual bool CanDownload(content::RenderViewHost* source,
31 int request_id,
32 const std::string& request_method) OVERRIDE;
33 virtual void OnStartDownload(content::WebContents* source,
34 content::DownloadItem* download) OVERRIDE;
[email protected]5daf9a9c2012-11-15 16:39:4435 virtual void AddNewContents(content::WebContents* source,
36 content::WebContents* new_contents,
37 WindowOpenDisposition disposition,
38 const gfx::Rect& initial_pos,
39 bool user_gesture,
40 bool* was_blocked) OVERRIDE;
[email protected]9168c162012-12-04 11:58:0041 virtual void CloseContents(content::WebContents* source) OVERRIDE;
[email protected]f1c3c7972012-08-21 18:28:3042};
43
[email protected]5daf9a9c2012-11-15 16:39:4444bool RegisterAwWebContentsDelegate(JNIEnv* env);
45
[email protected]f1c3c7972012-08-21 18:28:3046} // namespace android_webview
47
48#endif // ANDROID_WEBVIEW_NATIVE_AW_WEB_CONTENTS_DELEGATE_H_