blob: 3d84fbe2b5dc3e9682b2f7e174c97a262604fad8 [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
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]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);
21 virtual ~AwWebContentsDelegate();
[email protected]71a88bb2013-02-01 22:05:1522 virtual content::JavaScriptDialogManager* GetJavaScriptDialogManager()
[email protected]19fd5fa2012-09-20 19:28:3923 OVERRIDE;
[email protected]55750b32012-09-21 14:05:0324 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]f85f5032013-04-03 09:01:5430 virtual void CanDownload(content::RenderViewHost* source,
[email protected]7f8619f2012-10-15 21:22:5731 int request_id,
[email protected]f85f5032013-04-03 09:01:5432 const std::string& request_method,
33 const base::Callback<void(bool)>& callback) OVERRIDE;
34
[email protected]5daf9a9c2012-11-15 16:39:4435 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]9168c162012-12-04 11:58:0041 virtual void CloseContents(content::WebContents* source) OVERRIDE;
[email protected]5d483502012-12-13 11:50:1342 virtual void ActivateContents(content::WebContents* contents) OVERRIDE;
[email protected]5614eae2013-04-19 12:46:3843 virtual void UpdatePreferredSize(content::WebContents* web_contents,
44 const gfx::Size& pref_size) OVERRIDE;
[email protected]f1c3c7972012-08-21 18:28:3045};
46
[email protected]5daf9a9c2012-11-15 16:39:4447bool RegisterAwWebContentsDelegate(JNIEnv* env);
48
[email protected]f1c3c7972012-08-21 18:28:3049} // namespace android_webview
50
51#endif // ANDROID_WEBVIEW_NATIVE_AW_WEB_CONTENTS_DELEGATE_H_