[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 | |
| 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] | 434a132 | 2013-01-12 23:04:31 | [diff] [blame] | 10 | #include "components/web_contents_delegate_android/web_contents_delegate_android.h" |
[email protected] | f1c3c797 | 2012-08-21 18:28:30 | [diff] [blame] | 11 | |
| 12 | namespace 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. |
| 17 | class AwWebContentsDelegate |
[email protected] | da30444 | 2013-05-29 21:38:53 | [diff] [blame] | 18 | : public web_contents_delegate_android::WebContentsDelegateAndroid { |
[email protected] | f1c3c797 | 2012-08-21 18:28:30 | [diff] [blame] | 19 | public: |
| 20 | AwWebContentsDelegate(JNIEnv* env, jobject obj); |
| 21 | virtual ~AwWebContentsDelegate(); |
[email protected] | 71a88bb | 2013-02-01 22:05:15 | [diff] [blame] | 22 | virtual content::JavaScriptDialogManager* GetJavaScriptDialogManager() |
[email protected] | 19fd5fa | 2012-09-20 19:28:39 | [diff] [blame] | 23 | OVERRIDE; |
[email protected] | 55750b3 | 2012-09-21 14:05:03 | [diff] [blame] | 24 | 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] | f85f503 | 2013-04-03 09:01:54 | [diff] [blame] | 30 | virtual void CanDownload(content::RenderViewHost* source, |
[email protected] | 7f8619f | 2012-10-15 21:22:57 | [diff] [blame] | 31 | int request_id, |
[email protected] | f85f503 | 2013-04-03 09:01:54 | [diff] [blame] | 32 | const std::string& request_method, |
| 33 | const base::Callback<void(bool)>& callback) OVERRIDE; |
[email protected] | 98e0187 | 2013-08-10 07:05:47 | [diff] [blame] | 34 | virtual void RunFileChooser( |
| 35 | content::WebContents* web_contents, |
| 36 | const content::FileChooserParams& params) OVERRIDE; |
[email protected] | 5daf9a9c | 2012-11-15 16:39:44 | [diff] [blame] | 37 | 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] | 0b85508d | 2013-12-10 04:33:53 | [diff] [blame^] | 43 | |
| 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] | 9168c16 | 2012-12-04 11:58:00 | [diff] [blame] | 50 | virtual void CloseContents(content::WebContents* source) OVERRIDE; |
[email protected] | 5d48350 | 2012-12-13 11:50:13 | [diff] [blame] | 51 | virtual void ActivateContents(content::WebContents* contents) OVERRIDE; |
[email protected] | f961a0f | 2013-09-23 04:15:45 | [diff] [blame] | 52 | virtual void RequestProtectedMediaIdentifierPermission( |
| 53 | const content::WebContents* web_contents, |
| 54 | const GURL& frame_url, |
| 55 | const base::Callback<void(bool)>& callback) OVERRIDE; |
[email protected] | f1c3c797 | 2012-08-21 18:28:30 | [diff] [blame] | 56 | }; |
| 57 | |
[email protected] | 5daf9a9c | 2012-11-15 16:39:44 | [diff] [blame] | 58 | bool RegisterAwWebContentsDelegate(JNIEnv* env); |
| 59 | |
[email protected] | f1c3c797 | 2012-08-21 18:28:30 | [diff] [blame] | 60 | } // namespace android_webview |
| 61 | |
| 62 | #endif // ANDROID_WEBVIEW_NATIVE_AW_WEB_CONTENTS_DELEGATE_H_ |