[email protected] | f1c3c797 | 2012-08-21 18:28:30 | [diff] [blame] | 1 | // 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 | |
ctzsm | 0baa01d | 2017-05-09 04:27:37 | [diff] [blame] | 5 | #ifndef ANDROID_WEBVIEW_BROWSER_AW_WEB_CONTENTS_DELEGATE_H_ |
| 6 | #define ANDROID_WEBVIEW_BROWSER_AW_WEB_CONTENTS_DELEGATE_H_ |
[email protected] | f1c3c797 | 2012-08-21 18:28:30 | [diff] [blame] | 7 | |
[email protected] | 434a132 | 2013-01-12 23:04:31 | [diff] [blame] | 8 | #include "components/web_contents_delegate_android/web_contents_delegate_android.h" |
[email protected] | f1c3c797 | 2012-08-21 18:28:30 | [diff] [blame] | 9 | |
| 10 | namespace 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. |
| 15 | class AwWebContentsDelegate |
[email protected] | da30444 | 2013-05-29 21:38:53 | [diff] [blame] | 16 | : public web_contents_delegate_android::WebContentsDelegateAndroid { |
[email protected] | f1c3c797 | 2012-08-21 18:28:30 | [diff] [blame] | 17 | public: |
| 18 | AwWebContentsDelegate(JNIEnv* env, jobject obj); |
dcheng | 9b4dd1aa | 2015-02-04 02:56:54 | [diff] [blame] | 19 | ~AwWebContentsDelegate() override; |
| 20 | content::JavaScriptDialogManager* GetJavaScriptDialogManager( |
mathiash | 72a5e46 | 2014-11-19 08:18:50 | [diff] [blame] | 21 | content::WebContents* source) override; |
dcheng | 9b4dd1aa | 2015-02-04 02:56:54 | [diff] [blame] | 22 | 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; |
rdsmith | daa9227 | 2015-05-21 20:33:41 | [diff] [blame] | 28 | void CanDownload(const GURL& url, |
dcheng | 9b4dd1aa | 2015-02-04 02:56:54 | [diff] [blame] | 29 | const std::string& request_method, |
| 30 | const base::Callback<void(bool)>& callback) override; |
nasko | 35169af | 2016-06-10 18:47:13 | [diff] [blame] | 31 | void RunFileChooser(content::RenderFrameHost* render_frame_host, |
dcheng | 9b4dd1aa | 2015-02-04 02:56:54 | [diff] [blame] | 32 | const content::FileChooserParams& params) override; |
| 33 | void AddNewContents(content::WebContents* source, |
erikchen | bee5c962 | 2018-04-27 19:30:25 | [diff] [blame] | 34 | std::unique_ptr<content::WebContents> new_contents, |
dcheng | 9b4dd1aa | 2015-02-04 02:56:54 | [diff] [blame] | 35 | WindowOpenDisposition disposition, |
| 36 | const gfx::Rect& initial_rect, |
| 37 | bool user_gesture, |
| 38 | bool* was_blocked) override; |
[email protected] | 0b85508d | 2013-12-10 04:33:53 | [diff] [blame] | 39 | |
mnaganov | b2803fd | 2015-03-04 13:42:03 | [diff] [blame] | 40 | void NavigationStateChanged(content::WebContents* source, |
| 41 | content::InvalidateTypes changed_flags) override; |
Bryan McQuade | d2b93c0 | 2017-07-14 22:26:31 | [diff] [blame] | 42 | 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] | 0b85508d | 2013-12-10 04:33:53 | [diff] [blame] | 48 | |
dcheng | 9b4dd1aa | 2015-02-04 02:56:54 | [diff] [blame] | 49 | void CloseContents(content::WebContents* source) override; |
| 50 | void ActivateContents(content::WebContents* contents) override; |
mnaganov | 27cdc32 | 2015-06-05 15:40:20 | [diff] [blame] | 51 | void LoadingStateChanged(content::WebContents* source, |
| 52 | bool to_different_document) override; |
gsennton | f9205b6f | 2015-10-30 16:57:03 | [diff] [blame] | 53 | bool ShouldResumeRequestsForCreatedWindow() override; |
dcheng | 9b4dd1aa | 2015-02-04 02:56:54 | [diff] [blame] | 54 | void RequestMediaAccessPermission( |
[email protected] | 32e2d4aac | 2014-05-01 17:54:13 | [diff] [blame] | 55 | content::WebContents* web_contents, |
| 56 | const content::MediaStreamRequest& request, |
mostynb | d731a491 | 2014-10-07 13:36:11 | [diff] [blame] | 57 | const content::MediaResponseCallback& callback) override; |
Dave Tapuska | 3ed4419 | 2018-05-01 18:53:30 | [diff] [blame^] | 58 | void EnterFullscreenModeForTab( |
| 59 | content::WebContents* web_contents, |
| 60 | const GURL& origin, |
| 61 | const blink::WebFullscreenOptions& options) override; |
dcheng | 9b4dd1aa | 2015-02-04 02:56:54 | [diff] [blame] | 62 | void ExitFullscreenModeForTab(content::WebContents* web_contents) override; |
| 63 | bool IsFullscreenForTabOrPending( |
mostynb | d731a491 | 2014-10-07 13:36:11 | [diff] [blame] | 64 | const content::WebContents* web_contents) const override; |
[email protected] | 1996a0b1 | 2014-07-08 19:01:15 | [diff] [blame] | 65 | |
| 66 | private: |
| 67 | bool is_fullscreen_; |
[email protected] | f1c3c797 | 2012-08-21 18:28:30 | [diff] [blame] | 68 | }; |
| 69 | |
[email protected] | f1c3c797 | 2012-08-21 18:28:30 | [diff] [blame] | 70 | } // namespace android_webview |
| 71 | |
ctzsm | 0baa01d | 2017-05-09 04:27:37 | [diff] [blame] | 72 | #endif // ANDROID_WEBVIEW_BROWSER_AW_WEB_CONTENTS_DELEGATE_H_ |