blob: 96cd32575209ba8748a761de3e27817616dfcd59 [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);
dcheng9b4dd1aa2015-02-04 02:56:5421 ~AwWebContentsDelegate() override;
22 content::JavaScriptDialogManager* GetJavaScriptDialogManager(
mathiash72a5e462014-11-19 08:18:5023 content::WebContents* source) override;
dcheng9b4dd1aa2015-02-04 02:56:5424 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;
30 void CanDownload(content::RenderViewHost* source,
31 const GURL& url,
32 const std::string& request_method,
33 const base::Callback<void(bool)>& callback) override;
34 void RunFileChooser(content::WebContents* web_contents,
35 const content::FileChooserParams& params) override;
36 void AddNewContents(content::WebContents* source,
37 content::WebContents* new_contents,
38 WindowOpenDisposition disposition,
39 const gfx::Rect& initial_rect,
40 bool user_gesture,
41 bool* was_blocked) override;
[email protected]0b85508d2013-12-10 04:33:5342
dcheng9b4dd1aa2015-02-04 02:56:5443 void WebContentsCreated(content::WebContents* source_contents,
44 int opener_render_frame_id,
45 const base::string16& frame_name,
46 const GURL& target_url,
47 content::WebContents* new_contents) override;
[email protected]0b85508d2013-12-10 04:33:5348
dcheng9b4dd1aa2015-02-04 02:56:5449 void CloseContents(content::WebContents* source) override;
50 void ActivateContents(content::WebContents* contents) override;
51 void RequestMediaAccessPermission(
[email protected]32e2d4aac2014-05-01 17:54:1352 content::WebContents* web_contents,
53 const content::MediaStreamRequest& request,
mostynbd731a4912014-10-07 13:36:1154 const content::MediaResponseCallback& callback) override;
dcheng9b4dd1aa2015-02-04 02:56:5455 void EnterFullscreenModeForTab(content::WebContents* web_contents,
56 const GURL& origin) override;
57 void ExitFullscreenModeForTab(content::WebContents* web_contents) override;
58 bool IsFullscreenForTabOrPending(
mostynbd731a4912014-10-07 13:36:1159 const content::WebContents* web_contents) const override;
[email protected]1996a0b12014-07-08 19:01:1560
61 private:
62 bool is_fullscreen_;
[email protected]f1c3c7972012-08-21 18:28:3063};
64
[email protected]5daf9a9c2012-11-15 16:39:4465bool RegisterAwWebContentsDelegate(JNIEnv* env);
66
[email protected]f1c3c7972012-08-21 18:28:3067} // namespace android_webview
68
69#endif // ANDROID_WEBVIEW_NATIVE_AW_WEB_CONTENTS_DELEGATE_H_