OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/ui/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <string> | 10 #include <string> |
(...skipping 1387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1398 popup_blocker_helper = PopupBlockerTabHelper::FromWebContents(source); | 1398 popup_blocker_helper = PopupBlockerTabHelper::FromWebContents(source); |
1399 | 1399 |
1400 if (popup_blocker_helper) { | 1400 if (popup_blocker_helper) { |
1401 if ((params.disposition == WindowOpenDisposition::NEW_POPUP || | 1401 if ((params.disposition == WindowOpenDisposition::NEW_POPUP || |
1402 params.disposition == WindowOpenDisposition::NEW_FOREGROUND_TAB || | 1402 params.disposition == WindowOpenDisposition::NEW_FOREGROUND_TAB || |
1403 params.disposition == WindowOpenDisposition::NEW_BACKGROUND_TAB || | 1403 params.disposition == WindowOpenDisposition::NEW_BACKGROUND_TAB || |
1404 params.disposition == WindowOpenDisposition::NEW_WINDOW) && | 1404 params.disposition == WindowOpenDisposition::NEW_WINDOW) && |
1405 !params.user_gesture && | 1405 !params.user_gesture && |
1406 !base::CommandLine::ForCurrentProcess()->HasSwitch( | 1406 !base::CommandLine::ForCurrentProcess()->HasSwitch( |
1407 switches::kDisablePopupBlocking)) { | 1407 switches::kDisablePopupBlocking)) { |
1408 if (popup_blocker_helper->MaybeBlockPopup(nav_params, | 1408 if (popup_blocker_helper->MaybeBlockPopup(nav_params)) { |
1409 WebWindowFeatures())) { | |
1410 return NULL; | 1409 return NULL; |
1411 } | 1410 } |
1412 } | 1411 } |
1413 } | 1412 } |
1414 | 1413 |
1415 chrome::Navigate(&nav_params); | 1414 chrome::Navigate(&nav_params); |
1416 | 1415 |
1417 return nav_params.target_contents; | 1416 return nav_params.target_contents; |
1418 } | 1417 } |
1419 | 1418 |
(...skipping 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2620 // new window later, thus we need to navigate the window now. | 2619 // new window later, thus we need to navigate the window now. |
2621 if (contents) { | 2620 if (contents) { |
2622 contents->web_contents()->GetController().LoadURL( | 2621 contents->web_contents()->GetController().LoadURL( |
2623 target_url, content::Referrer(), ui::PAGE_TRANSITION_LINK, | 2622 target_url, content::Referrer(), ui::PAGE_TRANSITION_LINK, |
2624 std::string()); // No extra headers. | 2623 std::string()); // No extra headers. |
2625 } | 2624 } |
2626 } | 2625 } |
2627 | 2626 |
2628 return contents != NULL; | 2627 return contents != NULL; |
2629 } | 2628 } |
OLD | NEW |