blob: 39fea2c8f052a57c30837ef472a667c503b78304 [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]434a1322013-01-12 23:04:3110#include "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]da304442013-05-29 21:38:5318 : public web_contents_delegate_android::WebContentsDelegateAndroid {
[email protected]f1c3c7972012-08-21 18:28:3019 public:
20 AwWebContentsDelegate(JNIEnv* env, jobject obj);
21 virtual ~AwWebContentsDelegate();
[email protected]71a88bb2013-02-01 22:05:1522 virtual content::JavaScriptDialogManager* GetJavaScriptDialogManager()
[email protected]19fd5fa2012-09-20 19:28:3923 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]f85f5032013-04-03 09:01:5430 virtual void CanDownload(content::RenderViewHost* source,
[email protected]7f8619f2012-10-15 21:22:5731 int request_id,
[email protected]f85f5032013-04-03 09:01:5432 const std::string& request_method,
33 const base::Callback<void(bool)>& callback) OVERRIDE;
[email protected]98e01872013-08-10 07:05:4734 virtual void RunFileChooser(
35 content::WebContents* web_contents,
36 const content::FileChooserParams& params) OVERRIDE;
[email protected]5daf9a9c2012-11-15 16:39:4437 virtual void AddNewContents(content::WebContents* source,
38 content::WebContents* new_contents,
39 WindowOpenDisposition disposition,
40 const gfx::Rect& initial_pos,
41 bool user_gesture,
42 bool* was_blocked) OVERRIDE;
[email protected]0b85508d2013-12-10 04:33:5343
44 virtual void WebContentsCreated(content::WebContents* source_contents,
45 int64 source_frame_id,
46 const string16& frame_name,
47 const GURL& target_url,
48 content::WebContents* new_contents) OVERRIDE;
49
[email protected]9168c162012-12-04 11:58:0050 virtual void CloseContents(content::WebContents* source) OVERRIDE;
[email protected]5d483502012-12-13 11:50:1351 virtual void ActivateContents(content::WebContents* contents) OVERRIDE;
[email protected]f961a0f2013-09-23 04:15:4552 virtual void RequestProtectedMediaIdentifierPermission(
53 const content::WebContents* web_contents,
54 const GURL& frame_url,
55 const base::Callback<void(bool)>& callback) OVERRIDE;
[email protected]f1c3c7972012-08-21 18:28:3056};
57
[email protected]5daf9a9c2012-11-15 16:39:4458bool RegisterAwWebContentsDelegate(JNIEnv* env);
59
[email protected]f1c3c7972012-08-21 18:28:3060} // namespace android_webview
61
62#endif // ANDROID_WEBVIEW_NATIVE_AW_WEB_CONTENTS_DELEGATE_H_