[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] | 9a344906 | 2012-11-14 14:05:14 | [diff] [blame] | 10 | #include "content/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] | 9a344906 | 2012-11-14 14:05:14 | [diff] [blame] | 18 | : public content::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] | 19fd5fa | 2012-09-20 19:28:39 | [diff] [blame] | 22 | virtual content::JavaScriptDialogCreator* GetJavaScriptDialogCreator() |
| 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] | 7f8619f | 2012-10-15 21:22:57 | [diff] [blame] | 30 | virtual bool CanDownload(content::RenderViewHost* source, |
| 31 | int request_id, |
| 32 | const std::string& request_method) OVERRIDE; |
| 33 | virtual void OnStartDownload(content::WebContents* source, |
| 34 | content::DownloadItem* download) OVERRIDE; |
[email protected] | 5daf9a9c | 2012-11-15 16:39:44 | [diff] [blame] | 35 | virtual void AddNewContents(content::WebContents* source, |
| 36 | content::WebContents* new_contents, |
| 37 | WindowOpenDisposition disposition, |
| 38 | const gfx::Rect& initial_pos, |
| 39 | bool user_gesture, |
| 40 | bool* was_blocked) OVERRIDE; |
[email protected] | 9168c16 | 2012-12-04 11:58:00 | [diff] [blame^] | 41 | virtual void CloseContents(content::WebContents* source) OVERRIDE; |
[email protected] | f1c3c797 | 2012-08-21 18:28:30 | [diff] [blame] | 42 | }; |
| 43 | |
[email protected] | 5daf9a9c | 2012-11-15 16:39:44 | [diff] [blame] | 44 | bool RegisterAwWebContentsDelegate(JNIEnv* env); |
| 45 | |
[email protected] | f1c3c797 | 2012-08-21 18:28:30 | [diff] [blame] | 46 | } // namespace android_webview |
| 47 | |
| 48 | #endif // ANDROID_WEBVIEW_NATIVE_AW_WEB_CONTENTS_DELEGATE_H_ |