| 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_weak_ref.h" | 8 #include "base/android/jni_weak_ref.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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 const base::string16& source_id) override; | 81 const base::string16& source_id) override; |
| 82 virtual void UpdateTargetURL(content::WebContents* source, | 82 virtual void UpdateTargetURL(content::WebContents* source, |
| 83 const GURL& url) override; | 83 const GURL& url) override; |
| 84 virtual void HandleKeyboardEvent( | 84 virtual void HandleKeyboardEvent( |
| 85 content::WebContents* source, | 85 content::WebContents* source, |
| 86 const content::NativeWebKeyboardEvent& event) override; | 86 const content::NativeWebKeyboardEvent& event) override; |
| 87 virtual bool TakeFocus(content::WebContents* source, bool reverse) override; | 87 virtual bool TakeFocus(content::WebContents* source, bool reverse) override; |
| 88 virtual void ShowRepostFormWarningDialog( | 88 virtual void ShowRepostFormWarningDialog( |
| 89 content::WebContents* source) override; | 89 content::WebContents* source) override; |
| 90 virtual void ToggleFullscreenModeForTab(content::WebContents* web_contents, | 90 virtual void ToggleFullscreenModeForTab(content::WebContents* web_contents, |
| 91 bool enter_fullscreen) override; | 91 bool enter_fullscreen, |
| 92 bool is_video) override; |
| 92 virtual bool IsFullscreenForTabOrPending( | 93 virtual bool IsFullscreenForTabOrPending( |
| 93 const content::WebContents* web_contents) const override; | 94 const content::WebContents* web_contents) const override; |
| 94 virtual void ShowValidationMessage(content::WebContents* web_contents, | 95 virtual void ShowValidationMessage(content::WebContents* web_contents, |
| 95 const gfx::Rect& anchor_in_root_view, | 96 const gfx::Rect& anchor_in_root_view, |
| 96 const base::string16& main_text, | 97 const base::string16& main_text, |
| 97 const base::string16& sub_text) override; | 98 const base::string16& sub_text) override; |
| 98 virtual void HideValidationMessage( | 99 virtual void HideValidationMessage( |
| 99 content::WebContents* web_contents) override; | 100 content::WebContents* web_contents) override; |
| 100 virtual void MoveValidationMessage( | 101 virtual void MoveValidationMessage( |
| 101 content::WebContents* web_contents, | 102 content::WebContents* web_contents, |
| 102 const gfx::Rect& anchor_in_root_view) override; | 103 const gfx::Rect& anchor_in_root_view) override; |
| 103 | 104 |
| 104 protected: | 105 protected: |
| 105 base::android::ScopedJavaLocalRef<jobject> GetJavaDelegate(JNIEnv* env) const; | 106 base::android::ScopedJavaLocalRef<jobject> GetJavaDelegate(JNIEnv* env) const; |
| 106 | 107 |
| 107 private: | 108 private: |
| 108 // 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 |
| 109 // 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 |
| 110 // 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. |
| 111 JavaObjectWeakGlobalRef weak_java_delegate_; | 112 JavaObjectWeakGlobalRef weak_java_delegate_; |
| 112 | 113 |
| 113 scoped_ptr<ValidationMessageBubbleAndroid> validation_message_bubble_; | 114 scoped_ptr<ValidationMessageBubbleAndroid> validation_message_bubble_; |
| 114 }; | 115 }; |
| 115 | 116 |
| 116 bool RegisterWebContentsDelegateAndroid(JNIEnv* env); | 117 bool RegisterWebContentsDelegateAndroid(JNIEnv* env); |
| 117 | 118 |
| 118 } // namespace web_contents_delegate_android | 119 } // namespace web_contents_delegate_android |
| 119 | 120 |
| 120 #endif // COMPONENTS_WEB_CONTENTS_DELEGATE_ANDROID_WEB_CONTENTS_DELEGATE_ANDROI
D_H_ | 121 #endif // COMPONENTS_WEB_CONTENTS_DELEGATE_ANDROID_WEB_CONTENTS_DELEGATE_ANDROI
D_H_ |
| OLD | NEW |