| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_WEB_CONTENTS_DELEGATE_ANDROID_WEB_CONTENTS_DELEGATE_ANDROID_H
_ | 5 #ifndef COMPONENTS_WEB_CONTENTS_DELEGATE_ANDROID_WEB_CONTENTS_DELEGATE_ANDROID_H
_ |
| 6 #define COMPONENTS_WEB_CONTENTS_DELEGATE_ANDROID_WEB_CONTENTS_DELEGATE_ANDROID_H
_ | 6 #define COMPONENTS_WEB_CONTENTS_DELEGATE_ANDROID_WEB_CONTENTS_DELEGATE_ANDROID_H
_ |
| 7 | 7 |
| 8 #include "base/android/jni_helper.h" | 8 #include "base/android/jni_helper.h" |
| 9 #include "base/android/scoped_java_ref.h" | 9 #include "base/android/scoped_java_ref.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "content/public/browser/web_contents_delegate.h" | 12 #include "content/public/browser/web_contents_delegate.h" |
| 13 #include "ui/gfx/vector2d.h" |
| 13 | 14 |
| 14 class GURL; | 15 class GURL; |
| 15 | 16 |
| 16 namespace content { | 17 namespace content { |
| 17 class WebContents; | 18 class WebContents; |
| 18 class WebContentsDelegate; | 19 class WebContentsDelegate; |
| 19 struct NativeWebKeyboardEvent; | 20 struct NativeWebKeyboardEvent; |
| 20 struct OpenURLParams; | 21 struct OpenURLParams; |
| 21 } // namespace content | 22 } // namespace content |
| 22 | 23 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 const base::string16& message, | 80 const base::string16& message, |
| 80 int32 line_no, | 81 int32 line_no, |
| 81 const base::string16& source_id) OVERRIDE; | 82 const base::string16& source_id) OVERRIDE; |
| 82 virtual void UpdateTargetURL(content::WebContents* source, | 83 virtual void UpdateTargetURL(content::WebContents* source, |
| 83 int32 page_id, | 84 int32 page_id, |
| 84 const GURL& url) OVERRIDE; | 85 const GURL& url) OVERRIDE; |
| 85 virtual void HandleKeyboardEvent( | 86 virtual void HandleKeyboardEvent( |
| 86 content::WebContents* source, | 87 content::WebContents* source, |
| 87 const content::NativeWebKeyboardEvent& event) OVERRIDE; | 88 const content::NativeWebKeyboardEvent& event) OVERRIDE; |
| 88 virtual bool TakeFocus(content::WebContents* source, bool reverse) OVERRIDE; | 89 virtual bool TakeFocus(content::WebContents* source, bool reverse) OVERRIDE; |
| 89 | |
| 90 virtual void ShowRepostFormWarningDialog( | 90 virtual void ShowRepostFormWarningDialog( |
| 91 content::WebContents* source) OVERRIDE; | 91 content::WebContents* source) OVERRIDE; |
| 92 | |
| 93 virtual void ToggleFullscreenModeForTab(content::WebContents* web_contents, | 92 virtual void ToggleFullscreenModeForTab(content::WebContents* web_contents, |
| 94 bool enter_fullscreen) OVERRIDE; | 93 bool enter_fullscreen) OVERRIDE; |
| 95 virtual bool IsFullscreenForTabOrPending( | 94 virtual bool IsFullscreenForTabOrPending( |
| 96 const content::WebContents* web_contents) const OVERRIDE; | 95 const content::WebContents* web_contents) const OVERRIDE; |
| 96 virtual void DidProgrammaticallyScroll( |
| 97 content::WebContents* web_contents, |
| 98 const gfx::Vector2d& scroll_point) OVERRIDE; |
| 97 | 99 |
| 98 protected: | 100 protected: |
| 99 base::android::ScopedJavaLocalRef<jobject> GetJavaDelegate(JNIEnv* env) const; | 101 base::android::ScopedJavaLocalRef<jobject> GetJavaDelegate(JNIEnv* env) const; |
| 100 | 102 |
| 101 private: | 103 private: |
| 102 // We depend on the java side user of WebContentDelegateAndroid to hold a | 104 // We depend on the java side user of WebContentDelegateAndroid to hold a |
| 103 // strong reference to that object as long as they want to receive callbacks | 105 // strong reference to that object as long as they want to receive callbacks |
| 104 // on it. Using a weak ref here allows it to be correctly GCed. | 106 // on it. Using a weak ref here allows it to be correctly GCed. |
| 105 JavaObjectWeakGlobalRef weak_java_delegate_; | 107 JavaObjectWeakGlobalRef weak_java_delegate_; |
| 106 }; | 108 }; |
| 107 | 109 |
| 108 bool RegisterWebContentsDelegateAndroid(JNIEnv* env); | 110 bool RegisterWebContentsDelegateAndroid(JNIEnv* env); |
| 109 | 111 |
| 110 } // namespace components | 112 } // namespace components |
| 111 | 113 |
| 112 #endif // COMPONENTS_WEB_CONTENTS_DELEGATE_ANDROID_WEB_CONTENTS_DELEGATE_ANDROI
D_H_ | 114 #endif // COMPONENTS_WEB_CONTENTS_DELEGATE_ANDROID_WEB_CONTENTS_DELEGATE_ANDROI
D_H_ |
| OLD | NEW |