blob: 4ff911da7b0fc8c6017cec5e530957cbeea370c8 [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
[email protected]434a1322013-01-12 23:04:318#include "components/web_contents_delegate_android/web_contents_delegate_android.h"
[email protected]f1c3c7972012-08-21 18:28:309
10namespace android_webview {
11
12// WebView specific WebContentsDelegate.
13// Should contain WebContentsDelegate code required by WebView that should not
14// be part of the Chromium Android port.
15class AwWebContentsDelegate
[email protected]da304442013-05-29 21:38:5316 : public web_contents_delegate_android::WebContentsDelegateAndroid {
[email protected]f1c3c7972012-08-21 18:28:3017 public:
18 AwWebContentsDelegate(JNIEnv* env, jobject obj);
dcheng9b4dd1aa2015-02-04 02:56:5419 ~AwWebContentsDelegate() override;
20 content::JavaScriptDialogManager* GetJavaScriptDialogManager(
mathiash72a5e462014-11-19 08:18:5021 content::WebContents* source) override;
dcheng9b4dd1aa2015-02-04 02:56:5422 void FindReply(content::WebContents* web_contents,
23 int request_id,
24 int number_of_matches,
25 const gfx::Rect& selection_rect,
26 int active_match_ordinal,
27 bool final_update) override;
rdsmithdaa92272015-05-21 20:33:4128 void CanDownload(const GURL& url,
dcheng9b4dd1aa2015-02-04 02:56:5429 const std::string& request_method,
30 const base::Callback<void(bool)>& callback) override;
nasko35169af2016-06-10 18:47:1331 void RunFileChooser(content::RenderFrameHost* render_frame_host,
dcheng9b4dd1aa2015-02-04 02:56:5432 const content::FileChooserParams& params) override;
33 void AddNewContents(content::WebContents* source,
erikchenbee5c9622018-04-27 19:30:2534 std::unique_ptr<content::WebContents> new_contents,
dcheng9b4dd1aa2015-02-04 02:56:5435 WindowOpenDisposition disposition,
36 const gfx::Rect& initial_rect,
37 bool user_gesture,
38 bool* was_blocked) override;
[email protected]0b85508d2013-12-10 04:33:5339
mnaganovb2803fd2015-03-04 13:42:0340 void NavigationStateChanged(content::WebContents* source,
41 content::InvalidateTypes changed_flags) override;
Bryan McQuaded2b93c02017-07-14 22:26:3142 void WebContentsCreated(content::WebContents* source_contents,
43 int opener_render_process_id,
44 int opener_render_frame_id,
45 const std::string& 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;
mnaganov27cdc322015-06-05 15:40:2051 void LoadingStateChanged(content::WebContents* source,
52 bool to_different_document) override;
gsenntonf9205b6f2015-10-30 16:57:0353 bool ShouldResumeRequestsForCreatedWindow() override;
dcheng9b4dd1aa2015-02-04 02:56:5454 void RequestMediaAccessPermission(
[email protected]32e2d4aac2014-05-01 17:54:1355 content::WebContents* web_contents,
56 const content::MediaStreamRequest& request,
mostynbd731a4912014-10-07 13:36:1157 const content::MediaResponseCallback& callback) override;
Dave Tapuska3ed44192018-05-01 18:53:3058 void EnterFullscreenModeForTab(
59 content::WebContents* web_contents,
60 const GURL& origin,
61 const blink::WebFullscreenOptions& options) override;
dcheng9b4dd1aa2015-02-04 02:56:5462 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]f1c3c7972012-08-21 18:28:3070} // namespace android_webview
71
ctzsm0baa01d2017-05-09 04:27:3772#endif // ANDROID_WEBVIEW_BROWSER_AW_WEB_CONTENTS_DELEGATE_H_