| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 // See http://crbug.com/149477 | 83 // See http://crbug.com/149477 |
| 84 virtual void URLStarredChanged(content::WebContents* source, bool starred); | 84 virtual void URLStarredChanged(content::WebContents* source, bool starred); |
| 85 virtual void UpdateTargetURL(content::WebContents* source, | 85 virtual void UpdateTargetURL(content::WebContents* source, |
| 86 int32 page_id, | 86 int32 page_id, |
| 87 const GURL& url) OVERRIDE; | 87 const GURL& url) OVERRIDE; |
| 88 virtual void HandleKeyboardEvent( | 88 virtual void HandleKeyboardEvent( |
| 89 content::WebContents* source, | 89 content::WebContents* source, |
| 90 const content::NativeWebKeyboardEvent& event) OVERRIDE; | 90 const content::NativeWebKeyboardEvent& event) OVERRIDE; |
| 91 virtual bool TakeFocus(content::WebContents* source, bool reverse) OVERRIDE; | 91 virtual bool TakeFocus(content::WebContents* source, bool reverse) OVERRIDE; |
| 92 | 92 |
| 93 virtual void ShowRepostFormWarningDialog( |
| 94 content::WebContents* source) OVERRIDE; |
| 95 |
| 93 protected: | 96 protected: |
| 94 base::android::ScopedJavaLocalRef<jobject> GetJavaDelegate(JNIEnv* env) const; | 97 base::android::ScopedJavaLocalRef<jobject> GetJavaDelegate(JNIEnv* env) const; |
| 95 | 98 |
| 96 private: | 99 private: |
| 97 // We depend on the java side user of WebContentDelegateAndroid to hold a | 100 // We depend on the java side user of WebContentDelegateAndroid to hold a |
| 98 // strong reference to that object as long as they want to receive callbacks | 101 // strong reference to that object as long as they want to receive callbacks |
| 99 // on it. Using a weak ref here allows it to be correctly GCed. | 102 // on it. Using a weak ref here allows it to be correctly GCed. |
| 100 JavaObjectWeakGlobalRef weak_java_delegate_; | 103 JavaObjectWeakGlobalRef weak_java_delegate_; |
| 101 }; | 104 }; |
| 102 | 105 |
| 103 bool RegisterWebContentsDelegateAndroid(JNIEnv* env); | 106 bool RegisterWebContentsDelegateAndroid(JNIEnv* env); |
| 104 | 107 |
| 105 } // namespace web_contents_delegate_android | 108 } // namespace web_contents_delegate_android |
| 106 | 109 |
| 107 #endif // CHROME_BROWSER_COMPONENT_WEB_CONTENTS_DELEGATE_ANDROID_WEB_CONTENTS_D
ELEGATE_ANDROID_H_ | 110 #endif // CHROME_BROWSER_COMPONENT_WEB_CONTENTS_DELEGATE_ANDROID_WEB_CONTENTS_D
ELEGATE_ANDROID_H_ |
| OLD | NEW |