1 // Copyright 2013 The Chromium Authors. 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. 4 5 #ifndef COMPONENTS_WEB_CONTENTS_DELEGATE_ANDROID_VALIDATION_MESSAGE_BUBBLE_ANDROID_H_ 6 #define COMPONENTS_WEB_CONTENTS_DELEGATE_ANDROID_VALIDATION_MESSAGE_BUBBLE_ANDROID_H_ 7 8 #include <jni.h> 9 10 #include "base/android/scoped_java_ref.h" 11 #include "base/strings/string16.h" 12 13 namespace gfx { 14 class Rect; 15 } 16 17 namespace content { 18 class RenderWidgetHost; 19 } 20 21 namespace web_contents_delegate_android { 22 23 // An implementation of ValidationMessageBubble for Android. This class is a 24 // bridge to a Java implementation. 25 class ValidationMessageBubbleAndroid { 26 public: 27 ValidationMessageBubbleAndroid(content::RenderWidgetHost* widget_host, 28 const gfx::Rect& anchor_in_screen, 29 const base::string16& main_text, 30 const base::string16& sub_text); 31 virtual ~ValidationMessageBubbleAndroid(); 32 virtual void SetPositionRelativeToAnchor( 33 content::RenderWidgetHost* widget_host, 34 const gfx::Rect& anchor_in_screen); 35 36 static bool Register(JNIEnv* env); 37 38 private: 39 base::android::ScopedJavaGlobalRef<jobject> java_validation_message_bubble_; 40 }; 41 42 } // namespace web_contents_delegate_android 43 44 #endif // COMPONENTS_WEB_CONTENTS_DELEGATE_ANDROID_VALIDATION_MESSAGE_BUBBLE_ANDROID_H_ 45