blob: 760720fca5d927ff707cbb51af88cc5b98631b83 [file] [log] [blame]
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/android/document/document_web_contents_delegate.h"
#include "components/web_contents_delegate_android/web_contents_delegate_android.h"
#include "content/public/browser/web_contents.h"
#include "jni/DocumentWebContentsDelegate_jni.h"
DocumentWebContentsDelegate::DocumentWebContentsDelegate(JNIEnv* env,
jobject obj)
: WebContentsDelegateAndroid(env, obj) {
}
DocumentWebContentsDelegate::~DocumentWebContentsDelegate() {
}
void DocumentWebContentsDelegate::AttachContents(JNIEnv* env,
jobject jcaller,
jobject jweb_contents) {
content::WebContents* web_contents =
content::WebContents::FromJavaWebContents(jweb_contents);
web_contents->SetDelegate(this);
}
bool DocumentWebContentsDelegate::Register(JNIEnv* env) {
return RegisterNativesImpl(env);
}
void DocumentWebContentsDelegate::AddNewContents(
content::WebContents* source,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
bool user_gesture,
bool* was_blocked) {
NOTREACHED();
}
void DocumentWebContentsDelegate::CloseContents(content::WebContents* source) {
NOTREACHED();
}
bool DocumentWebContentsDelegate::ShouldCreateWebContents(
content::WebContents* web_contents,
int route_id,
int main_frame_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) {
NOTREACHED();
return false;
}
static jlong Initialize(JNIEnv* env, jobject obj) {
return reinterpret_cast<intptr_t>(new DocumentWebContentsDelegate(env, obj));
}