| 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/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "chrome/browser/android/tab_android.h" |
| 9 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| 10 #include "chrome/browser/file_select_helper.h" | 11 #include "chrome/browser/file_select_helper.h" |
| 11 #include "chrome/browser/media/media_capture_devices_dispatcher.h" | 12 #include "chrome/browser/media/media_capture_devices_dispatcher.h" |
| 12 #include "chrome/browser/media/protected_media_identifier_permission_context.h" | 13 #include "chrome/browser/media/protected_media_identifier_permission_context.h" |
| 13 #include "chrome/browser/media/protected_media_identifier_permission_context_fac
tory.h" | 14 #include "chrome/browser/media/protected_media_identifier_permission_context_fac
tory.h" |
| 14 #include "chrome/browser/prerender/prerender_manager.h" | 15 #include "chrome/browser/prerender/prerender_manager.h" |
| 15 #include "chrome/browser/prerender/prerender_manager_factory.h" | 16 #include "chrome/browser/prerender/prerender_manager_factory.h" |
| 16 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
| 17 #include "chrome/browser/ui/app_modal_dialogs/javascript_dialog_manager.h" | 18 #include "chrome/browser/ui/app_modal_dialogs/javascript_dialog_manager.h" |
| 18 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" | 19 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" |
| 19 #include "chrome/browser/ui/browser_navigator.h" | 20 #include "chrome/browser/ui/browser_navigator.h" |
| 20 #include "chrome/browser/ui/find_bar/find_notification_details.h" | 21 #include "chrome/browser/ui/find_bar/find_notification_details.h" |
| 21 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 22 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
| 22 #include "chrome/browser/ui/tab_helpers.h" | |
| 23 #include "chrome/common/chrome_switches.h" | 23 #include "chrome/common/chrome_switches.h" |
| 24 #include "content/public/browser/notification_details.h" | 24 #include "content/public/browser/notification_details.h" |
| 25 #include "content/public/browser/notification_service.h" | 25 #include "content/public/browser/notification_service.h" |
| 26 #include "content/public/browser/notification_source.h" | 26 #include "content/public/browser/notification_source.h" |
| 27 #include "content/public/browser/render_process_host.h" | 27 #include "content/public/browser/render_process_host.h" |
| 28 #include "content/public/browser/render_view_host.h" | 28 #include "content/public/browser/render_view_host.h" |
| 29 #include "content/public/browser/web_contents.h" | 29 #include "content/public/browser/web_contents.h" |
| 30 #include "content/public/common/file_chooser_params.h" | 30 #include "content/public/common/file_chooser_params.h" |
| 31 #include "jni/ChromeWebContentsDelegateAndroid_jni.h" | 31 #include "jni/ChromeWebContentsDelegateAndroid_jni.h" |
| 32 #include "third_party/WebKit/public/web/WebWindowFeatures.h" | 32 #include "third_party/WebKit/public/web/WebWindowFeatures.h" |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 WebContents* new_contents, | 298 WebContents* new_contents, |
| 299 WindowOpenDisposition disposition, | 299 WindowOpenDisposition disposition, |
| 300 const gfx::Rect& initial_pos, | 300 const gfx::Rect& initial_pos, |
| 301 bool user_gesture, | 301 bool user_gesture, |
| 302 bool* was_blocked) { | 302 bool* was_blocked) { |
| 303 // No code for this yet. | 303 // No code for this yet. |
| 304 DCHECK_NE(disposition, SAVE_TO_DISK); | 304 DCHECK_NE(disposition, SAVE_TO_DISK); |
| 305 // Can't create a new contents for the current tab - invalid case. | 305 // Can't create a new contents for the current tab - invalid case. |
| 306 DCHECK_NE(disposition, CURRENT_TAB); | 306 DCHECK_NE(disposition, CURRENT_TAB); |
| 307 | 307 |
| 308 TabHelpers::AttachTabHelpers(new_contents); | 308 TabAndroid::InitTabHelpers(new_contents); |
| 309 | 309 |
| 310 JNIEnv* env = AttachCurrentThread(); | 310 JNIEnv* env = AttachCurrentThread(); |
| 311 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); | 311 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); |
| 312 bool handled = false; | 312 bool handled = false; |
| 313 if (!obj.is_null()) { | 313 if (!obj.is_null()) { |
| 314 handled = Java_ChromeWebContentsDelegateAndroid_addNewContents( | 314 handled = Java_ChromeWebContentsDelegateAndroid_addNewContents( |
| 315 env, | 315 env, |
| 316 obj.obj(), | 316 obj.obj(), |
| 317 reinterpret_cast<intptr_t>(source), | 317 reinterpret_cast<intptr_t>(source), |
| 318 reinterpret_cast<intptr_t>(new_contents), | 318 reinterpret_cast<intptr_t>(new_contents), |
| 319 static_cast<jint>(disposition), | 319 static_cast<jint>(disposition), |
| 320 NULL, | 320 NULL, |
| 321 user_gesture); | 321 user_gesture); |
| 322 } | 322 } |
| 323 | 323 |
| 324 if (!handled) | 324 if (!handled) |
| 325 delete new_contents; | 325 delete new_contents; |
| 326 } | 326 } |
| 327 | 327 |
| 328 } // namespace android | 328 } // namespace android |
| 329 } // namespace chrome | 329 } // namespace chrome |
| OLD | NEW |