OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/android/document/document_web_contents_delegate.h" | 5 #include "chrome/browser/android/document/document_web_contents_delegate.h" |
6 | 6 |
7 #include "components/web_contents_delegate_android/web_contents_delegate_android
.h" | 7 #include "components/web_contents_delegate_android/web_contents_delegate_android
.h" |
8 #include "content/public/browser/web_contents.h" | 8 #include "content/public/browser/web_contents.h" |
9 #include "jni/DocumentWebContentsDelegate_jni.h" | 9 #include "jni/DocumentWebContentsDelegate_jni.h" |
10 | 10 |
11 DocumentWebContentsDelegate::DocumentWebContentsDelegate(JNIEnv* env, | 11 DocumentWebContentsDelegate::DocumentWebContentsDelegate(JNIEnv* env, |
12 jobject obj) | 12 jobject obj) |
13 : WebContentsDelegateAndroid(env, obj) { | 13 : WebContentsDelegateAndroid(env, obj) { |
14 } | 14 } |
15 | 15 |
16 DocumentWebContentsDelegate::~DocumentWebContentsDelegate() { | 16 DocumentWebContentsDelegate::~DocumentWebContentsDelegate() { |
17 } | 17 } |
18 | 18 |
19 void DocumentWebContentsDelegate::AttachContents(JNIEnv* env, | 19 void DocumentWebContentsDelegate::AttachContents(JNIEnv* env, |
20 jobject jcaller, | 20 jobject jcaller, |
21 jobject jweb_contents) { | 21 jobject jweb_contents) { |
| 22 #if !defined(USE_AURA) |
22 content::WebContents* web_contents = | 23 content::WebContents* web_contents = |
23 content::WebContents::FromJavaWebContents(jweb_contents); | 24 content::WebContents::FromJavaWebContents(jweb_contents); |
24 web_contents->SetDelegate(this); | 25 web_contents->SetDelegate(this); |
| 26 #endif |
25 } | 27 } |
26 | 28 |
27 bool DocumentWebContentsDelegate::Register(JNIEnv* env) { | 29 bool DocumentWebContentsDelegate::Register(JNIEnv* env) { |
28 return RegisterNativesImpl(env); | 30 return RegisterNativesImpl(env); |
29 } | 31 } |
30 | 32 |
31 void DocumentWebContentsDelegate::AddNewContents( | 33 void DocumentWebContentsDelegate::AddNewContents( |
32 content::WebContents* source, | 34 content::WebContents* source, |
33 content::WebContents* new_contents, | 35 content::WebContents* new_contents, |
34 WindowOpenDisposition disposition, | 36 WindowOpenDisposition disposition, |
(...skipping 17 matching lines...) Expand all Loading... |
52 const std::string& partition_id, | 54 const std::string& partition_id, |
53 content::SessionStorageNamespace* session_storage_namespace) { | 55 content::SessionStorageNamespace* session_storage_namespace) { |
54 NOTREACHED(); | 56 NOTREACHED(); |
55 return false; | 57 return false; |
56 } | 58 } |
57 | 59 |
58 | 60 |
59 static jlong Initialize(JNIEnv* env, jobject obj) { | 61 static jlong Initialize(JNIEnv* env, jobject obj) { |
60 return reinterpret_cast<intptr_t>(new DocumentWebContentsDelegate(env, obj)); | 62 return reinterpret_cast<intptr_t>(new DocumentWebContentsDelegate(env, obj)); |
61 } | 63 } |
OLD | NEW |