| 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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 | 274 |
| 275 PopupBlockerTabHelper* popup_blocker_helper = | 275 PopupBlockerTabHelper* popup_blocker_helper = |
| 276 PopupBlockerTabHelper::FromWebContents(source); | 276 PopupBlockerTabHelper::FromWebContents(source); |
| 277 DCHECK(popup_blocker_helper); | 277 DCHECK(popup_blocker_helper); |
| 278 | 278 |
| 279 if ((params.disposition == NEW_POPUP || | 279 if ((params.disposition == NEW_POPUP || |
| 280 params.disposition == NEW_FOREGROUND_TAB || | 280 params.disposition == NEW_FOREGROUND_TAB || |
| 281 params.disposition == NEW_BACKGROUND_TAB || | 281 params.disposition == NEW_BACKGROUND_TAB || |
| 282 params.disposition == NEW_WINDOW) && | 282 params.disposition == NEW_WINDOW) && |
| 283 !params.user_gesture && | 283 !params.user_gesture && |
| 284 !CommandLine::ForCurrentProcess()->HasSwitch( | 284 !base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 285 switches::kDisablePopupBlocking)) { | 285 switches::kDisablePopupBlocking)) { |
| 286 if (popup_blocker_helper->MaybeBlockPopup(nav_params, | 286 if (popup_blocker_helper->MaybeBlockPopup(nav_params, |
| 287 blink::WebWindowFeatures())) { | 287 blink::WebWindowFeatures())) { |
| 288 return NULL; | 288 return NULL; |
| 289 } | 289 } |
| 290 } | 290 } |
| 291 | 291 |
| 292 if (disposition == CURRENT_TAB) { | 292 if (disposition == CURRENT_TAB) { |
| 293 // Only prerender for a current-tab navigation to avoid session storage | 293 // Only prerender for a current-tab navigation to avoid session storage |
| 294 // namespace issues. | 294 // namespace issues. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 } | 333 } |
| 334 | 334 |
| 335 if (was_blocked) | 335 if (was_blocked) |
| 336 *was_blocked = !handled; | 336 *was_blocked = !handled; |
| 337 if (!handled) | 337 if (!handled) |
| 338 delete new_contents; | 338 delete new_contents; |
| 339 } | 339 } |
| 340 | 340 |
| 341 } // namespace android | 341 } // namespace android |
| 342 } // namespace chrome | 342 } // namespace chrome |
| OLD | NEW |