1 // Copyright (c) 2013 Intel Corporation. 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.
5 #ifndef XWALK_RUNTIME_BROWSER_ANDROID_XWALK_WEB_CONTENTS_DELEGATE_H_
6 #define XWALK_RUNTIME_BROWSER_ANDROID_XWALK_WEB_CONTENTS_DELEGATE_H_
10 #include "components/web_contents_delegate_android/web_contents_delegate_android.h"
14 class XWalkWebContentsDelegate
15 : public web_contents_delegate_android::WebContentsDelegateAndroid {
17 XWalkWebContentsDelegate(JNIEnv* env, jobject obj);
18 virtual ~XWalkWebContentsDelegate();
20 virtual void AddNewContents(content::WebContents* source,
21 content::WebContents* new_contents,
22 WindowOpenDisposition disposition,
23 const gfx::Rect& initial_pos,
25 bool* was_blocked) OVERRIDE;
26 virtual void CloseContents(content::WebContents* source) OVERRIDE;
27 virtual void ActivateContents(content::WebContents* contents) OVERRIDE;
28 virtual void UpdatePreferredSize(content::WebContents* web_contents,
29 const gfx::Size& pref_size) OVERRIDE;
30 virtual void RunFileChooser(
31 content::WebContents* web_contents,
32 const content::FileChooserParams& params) OVERRIDE;
33 virtual content::JavaScriptDialogManager*
34 GetJavaScriptDialogManager() OVERRIDE;
36 virtual void RequestMediaAccessPermission(
37 content::WebContents* web_contents,
38 const content::MediaStreamRequest& request,
39 const content::MediaResponseCallback& callback) OVERRIDE;
41 virtual void RendererUnresponsive(content::WebContents* source) OVERRIDE;
42 virtual void RendererResponsive(content::WebContents* source) OVERRIDE;
44 virtual void HandleKeyboardEvent(
45 content::WebContents* source,
46 const content::NativeWebKeyboardEvent& event) OVERRIDE;
48 virtual void ToggleFullscreenModeForTab(content::WebContents* web_contents,
49 bool enter_fullscreen) OVERRIDE;
50 virtual bool IsFullscreenForTabOrPending(
51 const content::WebContents* web_contents) const OVERRIDE;
54 scoped_ptr<content::JavaScriptDialogManager> javascript_dialog_manager_;
55 DISALLOW_COPY_AND_ASSIGN(XWalkWebContentsDelegate);
58 bool RegisterXWalkWebContentsDelegate(JNIEnv* env);
62 #endif // XWALK_RUNTIME_BROWSER_ANDROID_XWALK_WEB_CONTENTS_DELEGATE_H_