Add new certificateProvider extension API.
[chromium-blink-merge.git] / chrome / browser / android / document / document_web_contents_delegate.cc
blob25b8067b4bd54c8c6cee8e943c6680fa11b1caec
1 // Copyright 2015 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.
5 #include "chrome/browser/android/document/document_web_contents_delegate.h"
7 #include "components/web_contents_delegate_android/web_contents_delegate_android.h"
8 #include "content/public/browser/web_contents.h"
9 #include "jni/DocumentWebContentsDelegate_jni.h"
11 DocumentWebContentsDelegate::DocumentWebContentsDelegate(JNIEnv* env,
12 jobject obj)
13 : WebContentsDelegateAndroid(env, obj) {
16 DocumentWebContentsDelegate::~DocumentWebContentsDelegate() {
19 void DocumentWebContentsDelegate::AttachContents(JNIEnv* env,
20 jobject jcaller,
21 jobject jweb_contents) {
22 content::WebContents* web_contents =
23 content::WebContents::FromJavaWebContents(jweb_contents);
24 web_contents->SetDelegate(this);
27 bool DocumentWebContentsDelegate::Register(JNIEnv* env) {
28 return RegisterNativesImpl(env);
31 void DocumentWebContentsDelegate::AddNewContents(
32 content::WebContents* source,
33 content::WebContents* new_contents,
34 WindowOpenDisposition disposition,
35 const gfx::Rect& initial_pos,
36 bool user_gesture,
37 bool* was_blocked) {
38 NOTREACHED();
41 void DocumentWebContentsDelegate::CloseContents(content::WebContents* source) {
42 NOTREACHED();
45 bool DocumentWebContentsDelegate::ShouldCreateWebContents(
46 content::WebContents* web_contents,
47 int route_id,
48 int main_frame_route_id,
49 WindowContainerType window_container_type,
50 const std::string& frame_name,
51 const GURL& target_url,
52 const std::string& partition_id,
53 content::SessionStorageNamespace* session_storage_namespace) {
54 NOTREACHED();
55 return false;
58 static jlong Initialize(JNIEnv* env, const JavaParamRef<jobject>& obj) {
59 return reinterpret_cast<intptr_t>(new DocumentWebContentsDelegate(env, obj));