OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "android_webview/native/aw_web_contents_delegate.h" | 5 #include "android_webview/native/aw_web_contents_delegate.h" |
6 | 6 |
7 #include "android_webview/browser/aw_javascript_dialog_manager.h" | 7 #include "android_webview/browser/aw_javascript_dialog_manager.h" |
8 #include "android_webview/browser/find_helper.h" | 8 #include "android_webview/browser/find_helper.h" |
9 #include "android_webview/native/aw_contents.h" | 9 #include "android_webview/native/aw_contents.h" |
10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 115 |
116 void AwWebContentsDelegate::ActivateContents(content::WebContents* contents) { | 116 void AwWebContentsDelegate::ActivateContents(content::WebContents* contents) { |
117 JNIEnv* env = AttachCurrentThread(); | 117 JNIEnv* env = AttachCurrentThread(); |
118 | 118 |
119 ScopedJavaLocalRef<jobject> java_delegate = GetJavaDelegate(env); | 119 ScopedJavaLocalRef<jobject> java_delegate = GetJavaDelegate(env); |
120 if (java_delegate.obj()) { | 120 if (java_delegate.obj()) { |
121 Java_AwWebContentsDelegate_activateContents(env, java_delegate.obj()); | 121 Java_AwWebContentsDelegate_activateContents(env, java_delegate.obj()); |
122 } | 122 } |
123 } | 123 } |
124 | 124 |
| 125 void AwWebContentsDelegate::UpdatePreferredSize( |
| 126 WebContents* web_contents, |
| 127 const gfx::Size& pref_size) { |
| 128 JNIEnv* env = AttachCurrentThread(); |
| 129 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); |
| 130 if (obj.is_null()) |
| 131 return; |
| 132 return Java_AwWebContentsDelegate_updatePreferredSize( |
| 133 env, obj.obj(), pref_size.width(), pref_size.height()); |
| 134 } |
| 135 |
125 bool RegisterAwWebContentsDelegate(JNIEnv* env) { | 136 bool RegisterAwWebContentsDelegate(JNIEnv* env) { |
126 return RegisterNativesImpl(env); | 137 return RegisterNativesImpl(env); |
127 } | 138 } |
128 | 139 |
129 } // namespace android_webview | 140 } // namespace android_webview |
OLD | NEW |