blob: f816ddca828dcde1eddc50addad15b98ce949c9c [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
ctzsm0baa01d2017-05-09 04:27:375#ifndef ANDROID_WEBVIEW_BROWSER_AW_WEB_CONTENTS_DELEGATE_H_
6#define ANDROID_WEBVIEW_BROWSER_AW_WEB_CONTENTS_DELEGATE_H_
[email protected]f1c3c7972012-08-21 18:28:307
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;
rdsmithdaa92272015-05-21 20:33:4130 void CanDownload(const GURL& url,
dcheng9b4dd1aa2015-02-04 02:56:5431 const std::string& request_method,
32 const base::Callback<void(bool)>& callback) override;
nasko35169af2016-06-10 18:47:1333 void RunFileChooser(content::RenderFrameHost* render_frame_host,
dcheng9b4dd1aa2015-02-04 02:56:5434 const content::FileChooserParams& params) override;
35 void AddNewContents(content::WebContents* source,
36 content::WebContents* new_contents,
37 WindowOpenDisposition disposition,
38 const gfx::Rect& initial_rect,
39 bool user_gesture,
40 bool* was_blocked) override;
[email protected]0b85508d2013-12-10 04:33:5341
mnaganovb2803fd2015-03-04 13:42:0342 void NavigationStateChanged(content::WebContents* source,
43 content::InvalidateTypes changed_flags) override;
dcheng9b4dd1aa2015-02-04 02:56:5444 void WebContentsCreated(content::WebContents* source_contents,
naskoe2df1d72016-10-04 00:20:1745 int opener_render_process_id,
dcheng9b4dd1aa2015-02-04 02:56:5446 int opener_render_frame_id,
nasko48321ca32015-07-02 20:44:1247 const std::string& frame_name,
dcheng9b4dd1aa2015-02-04 02:56:5448 const GURL& target_url,
49 content::WebContents* new_contents) override;
[email protected]0b85508d2013-12-10 04:33:5350
dcheng9b4dd1aa2015-02-04 02:56:5451 void CloseContents(content::WebContents* source) override;
52 void ActivateContents(content::WebContents* contents) override;
mnaganov27cdc322015-06-05 15:40:2053 void LoadingStateChanged(content::WebContents* source,
54 bool to_different_document) override;
gsenntonf9205b6f2015-10-30 16:57:0355 bool ShouldResumeRequestsForCreatedWindow() override;
dcheng9b4dd1aa2015-02-04 02:56:5456 void RequestMediaAccessPermission(
[email protected]32e2d4aac2014-05-01 17:54:1357 content::WebContents* web_contents,
58 const content::MediaStreamRequest& request,
mostynbd731a4912014-10-07 13:36:1159 const content::MediaResponseCallback& callback) override;
dcheng9b4dd1aa2015-02-04 02:56:5460 void EnterFullscreenModeForTab(content::WebContents* web_contents,
61 const GURL& origin) override;
62 void ExitFullscreenModeForTab(content::WebContents* web_contents) override;
63 bool IsFullscreenForTabOrPending(
mostynbd731a4912014-10-07 13:36:1164 const content::WebContents* web_contents) const override;
[email protected]1996a0b12014-07-08 19:01:1565
66 private:
67 bool is_fullscreen_;
[email protected]f1c3c7972012-08-21 18:28:3068};
69
[email protected]5daf9a9c2012-11-15 16:39:4470bool RegisterAwWebContentsDelegate(JNIEnv* env);
71
[email protected]f1c3c7972012-08-21 18:28:3072} // namespace android_webview
73
ctzsm0baa01d2017-05-09 04:27:3774#endif // ANDROID_WEBVIEW_BROWSER_AW_WEB_CONTENTS_DELEGATE_H_