| 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 CHROME_BROWSER_COMPONENT_WEB_CONTENTS_DELEGATE_ANDROID_WEB_CONTENTS_DELE
GATE_ANDROID_H_ | 5 #ifndef CHROME_BROWSER_COMPONENT_WEB_CONTENTS_DELEGATE_ANDROID_WEB_CONTENTS_DELE
GATE_ANDROID_H_ |
| 6 #define CHROME_BROWSER_COMPONENT_WEB_CONTENTS_DELEGATE_ANDROID_WEB_CONTENTS_DELE
GATE_ANDROID_H_ | 6 #define CHROME_BROWSER_COMPONENT_WEB_CONTENTS_DELEGATE_ANDROID_WEB_CONTENTS_DELE
GATE_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" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 virtual void URLStarredChanged(content::WebContents* source, bool starred); | 92 virtual void URLStarredChanged(content::WebContents* source, bool starred); |
| 93 virtual void UpdateTargetURL(content::WebContents* source, | 93 virtual void UpdateTargetURL(content::WebContents* source, |
| 94 int32 page_id, | 94 int32 page_id, |
| 95 const GURL& url) OVERRIDE; | 95 const GURL& url) OVERRIDE; |
| 96 virtual bool ShouldOverrideLoading(const GURL& url) OVERRIDE; | 96 virtual bool ShouldOverrideLoading(const GURL& url) OVERRIDE; |
| 97 virtual void HandleKeyboardEvent( | 97 virtual void HandleKeyboardEvent( |
| 98 content::WebContents* source, | 98 content::WebContents* source, |
| 99 const content::NativeWebKeyboardEvent& event) OVERRIDE; | 99 const content::NativeWebKeyboardEvent& event) OVERRIDE; |
| 100 virtual bool TakeFocus(content::WebContents* source, bool reverse) OVERRIDE; | 100 virtual bool TakeFocus(content::WebContents* source, bool reverse) OVERRIDE; |
| 101 | 101 |
| 102 virtual void ShowRepostFormWarningDialog( |
| 103 content::WebContents* source) OVERRIDE; |
| 104 |
| 102 protected: | 105 protected: |
| 103 base::android::ScopedJavaLocalRef<jobject> GetJavaDelegate(JNIEnv* env) const; | 106 base::android::ScopedJavaLocalRef<jobject> GetJavaDelegate(JNIEnv* env) const; |
| 104 | 107 |
| 105 private: | 108 private: |
| 106 // We depend on the java side user of WebContentDelegateAndroid to hold a | 109 // We depend on the java side user of WebContentDelegateAndroid to hold a |
| 107 // strong reference to that object as long as they want to receive callbacks | 110 // strong reference to that object as long as they want to receive callbacks |
| 108 // on it. Using a weak ref here allows it to be correctly GCed. | 111 // on it. Using a weak ref here allows it to be correctly GCed. |
| 109 JavaObjectWeakGlobalRef weak_java_delegate_; | 112 JavaObjectWeakGlobalRef weak_java_delegate_; |
| 110 }; | 113 }; |
| 111 | 114 |
| 112 bool RegisterWebContentsDelegateAndroid(JNIEnv* env); | 115 bool RegisterWebContentsDelegateAndroid(JNIEnv* env); |
| 113 | 116 |
| 114 } // namespace web_contents_delegate_android | 117 } // namespace web_contents_delegate_android |
| 115 | 118 |
| 116 #endif // CHROME_BROWSER_COMPONENT_WEB_CONTENTS_DELEGATE_ANDROID_WEB_CONTENTS_D
ELEGATE_ANDROID_H_ | 119 #endif // CHROME_BROWSER_COMPONENT_WEB_CONTENTS_DELEGATE_ANDROID_WEB_CONTENTS_D
ELEGATE_ANDROID_H_ |
| OLD | NEW |