#ifndef COMPONENTS_WEB_CONTENTS_DELEGATE_ANDROID_WEB_CONTENTS_DELEGATE_ANDROID_H_
#define COMPONENTS_WEB_CONTENTS_DELEGATE_ANDROID_WEB_CONTENTS_DELEGATE_ANDROID_H_
-#include "base/android/jni_helper.h"
+#include "base/android/jni_weak_ref.h"
#include "base/android/scoped_java_ref.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
namespace web_contents_delegate_android {
+class ValidationMessageBubbleAndroid;
+
enum WebContentsDelegateLogLevel {
// Equivalent of WebCore::WebConsoleMessage::LevelDebug.
WEB_CONTENTS_DELEGATE_LOG_LEVEL_DEBUG = 0,
// Overridden from WebContentsDelegate:
virtual content::WebContents* OpenURLFromTab(
content::WebContents* source,
- const content::OpenURLParams& params) OVERRIDE;
- virtual content::ColorChooser* OpenColorChooser(content::WebContents* source,
- SkColor color) OVERRIDE;
- virtual void NavigationStateChanged(const content::WebContents* source,
- unsigned changed_flags) OVERRIDE;
- virtual void ActivateContents(content::WebContents* contents) OVERRIDE;
- virtual void DeactivateContents(content::WebContents* contents) OVERRIDE;
- virtual void LoadingStateChanged(content::WebContents* source) OVERRIDE;
+ const content::OpenURLParams& params) override;
+ virtual content::ColorChooser* OpenColorChooser(
+ content::WebContents* source,
+ SkColor color,
+ const std::vector<content::ColorSuggestion>& suggestions) override;
+ virtual void NavigationStateChanged(
+ const content::WebContents* source,
+ content::InvalidateTypes changed_flags) override;
+ virtual void VisibleSSLStateChanged(
+ const content::WebContents* source) override;
+ virtual void ActivateContents(content::WebContents* contents) override;
+ virtual void DeactivateContents(content::WebContents* contents) override;
+ virtual void LoadingStateChanged(content::WebContents* source,
+ bool to_different_document) override;
virtual void LoadProgressChanged(content::WebContents* source,
- double load_progress) OVERRIDE;
- virtual void RendererUnresponsive(content::WebContents* source) OVERRIDE;
- virtual void RendererResponsive(content::WebContents* source) OVERRIDE;
- virtual void CloseContents(content::WebContents* source) OVERRIDE;
+ double load_progress) override;
+ virtual void RendererUnresponsive(content::WebContents* source) override;
+ virtual void RendererResponsive(content::WebContents* source) override;
+ virtual void DidNavigateToPendingEntry(content::WebContents* source) override;
+ virtual void WebContentsCreated(content::WebContents* source_contents,
+ int opener_render_frame_id,
+ const base::string16& frame_name,
+ const GURL& target_url,
+ content::WebContents* new_contents) override;
+ virtual bool ShouldCreateWebContents(
+ content::WebContents* web_contents,
+ int route_id,
+ WindowContainerType window_container_type,
+ const base::string16& frame_name,
+ const GURL& target_url,
+ const std::string& partition_id,
+ content::SessionStorageNamespace* session_storage_namespace) override;
+ virtual bool OnGoToEntryOffset(int offset) override;
+ virtual void CloseContents(content::WebContents* source) override;
virtual void MoveContents(content::WebContents* source,
- const gfx::Rect& pos) OVERRIDE;
+ const gfx::Rect& pos) override;
virtual bool AddMessageToConsole(content::WebContents* source,
int32 level,
const base::string16& message,
int32 line_no,
- const base::string16& source_id) OVERRIDE;
+ const base::string16& source_id) override;
virtual void UpdateTargetURL(content::WebContents* source,
- int32 page_id,
- const GURL& url) OVERRIDE;
+ const GURL& url) override;
virtual void HandleKeyboardEvent(
content::WebContents* source,
- const content::NativeWebKeyboardEvent& event) OVERRIDE;
- virtual bool TakeFocus(content::WebContents* source, bool reverse) OVERRIDE;
+ const content::NativeWebKeyboardEvent& event) override;
+ virtual bool TakeFocus(content::WebContents* source, bool reverse) override;
virtual void ShowRepostFormWarningDialog(
- content::WebContents* source) OVERRIDE;
+ content::WebContents* source) override;
virtual void ToggleFullscreenModeForTab(content::WebContents* web_contents,
- bool enter_fullscreen) OVERRIDE;
+ bool enter_fullscreen) override;
virtual bool IsFullscreenForTabOrPending(
- const content::WebContents* web_contents) const OVERRIDE;
+ const content::WebContents* web_contents) const override;
+ virtual void ShowValidationMessage(content::WebContents* web_contents,
+ const gfx::Rect& anchor_in_root_view,
+ const base::string16& main_text,
+ const base::string16& sub_text) override;
+ virtual void HideValidationMessage(
+ content::WebContents* web_contents) override;
+ virtual void MoveValidationMessage(
+ content::WebContents* web_contents,
+ const gfx::Rect& anchor_in_root_view) override;
protected:
base::android::ScopedJavaLocalRef<jobject> GetJavaDelegate(JNIEnv* env) const;
// strong reference to that object as long as they want to receive callbacks
// on it. Using a weak ref here allows it to be correctly GCed.
JavaObjectWeakGlobalRef weak_java_delegate_;
+
+ scoped_ptr<ValidationMessageBubbleAndroid> validation_message_bubble_;
};
bool RegisterWebContentsDelegateAndroid(JNIEnv* env);