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 CHROME_BROWSER_UI_ANDROID_VALIDATION_MESSAGE_BUBBLE_ANDROID_H_ 6#define CHROME_BROWSER_UI_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#include "chrome/browser/ui/validation_message_bubble.h" 13 14namespace content { 15class RenderWidgetHost; 16} 17 18namespace gfx { 19class Rect; 20} 21 22// An implementation of ValidationMessageBubble for Android. This class is a 23// bridge to a Java implementation. 24class ValidationMessageBubbleAndroid : public chrome::ValidationMessageBubble { 25 public: 26 ValidationMessageBubbleAndroid(content::RenderWidgetHost* widget_host, 27 const gfx::Rect& anchor_in_screen, 28 const string16& main_text, 29 const string16& sub_text); 30 virtual ~ValidationMessageBubbleAndroid(); 31 virtual void SetPositionRelativeToAnchor( 32 content::RenderWidgetHost* widget_host, 33 const gfx::Rect& anchor_in_screen) OVERRIDE; 34 35 static bool Register(JNIEnv* env); 36 37 private: 38 base::android::ScopedJavaGlobalRef<jobject> java_validation_message_bubble_; 39}; 40 41#endif // CHROME_BROWSER_UI_ANDROID_VALIDATION_MESSAGE_BUBBLE_ANDROID_H_ 42