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 "chrome/browser/android/chrome_web_contents_delegate_android.h" | 5 #include "chrome/browser/android/chrome_web_contents_delegate_android.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 NULL, | 330 NULL, |
331 user_gesture); | 331 user_gesture); |
332 } | 332 } |
333 | 333 |
334 if (was_blocked) | 334 if (was_blocked) |
335 *was_blocked = !handled; | 335 *was_blocked = !handled; |
336 if (!handled) | 336 if (!handled) |
337 delete new_contents; | 337 delete new_contents; |
338 } | 338 } |
339 | 339 |
340 void ChromeWebContentsDelegateAndroid::WebContentsCreated( | |
341 content::WebContents* source_contents, int opener_render_frame_id, | |
342 const base::string16& frame_name, const GURL& target_url, | |
343 content::WebContents* new_contents) { | |
344 JNIEnv* env = AttachCurrentThread(); | |
345 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); | |
346 if (obj.is_null()) | |
347 return; | |
348 Java_ChromeWebContentsDelegateAndroid_webContentsCreated(env, obj.obj(), | |
349 reinterpret_cast<intptr_t>(source_contents), opener_render_frame_id, | |
350 base::android::ConvertUTF16ToJavaString(env, frame_name).Release(), | |
351 base::android::ConvertUTF8ToJavaString(env, target_url.spec()).Release(), | |
352 reinterpret_cast<intptr_t>(new_contents)); | |
353 } | |
354 | |
355 } // namespace android | 340 } // namespace android |
356 } // namespace chrome | 341 } // namespace chrome |
OLD | NEW |