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 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #endif // defined(OS_WIN) | 10 #endif // defined(OS_WIN) |
(...skipping 1330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1341 // GetDownloadShelf creates the download shelf if it was not yet created. | 1341 // GetDownloadShelf creates the download shelf if it was not yet created. |
1342 DownloadShelf* shelf = window()->GetDownloadShelf(); | 1342 DownloadShelf* shelf = window()->GetDownloadShelf(); |
1343 shelf->AddDownload(download); | 1343 shelf->AddDownload(download); |
1344 } | 1344 } |
1345 | 1345 |
1346 /////////////////////////////////////////////////////////////////////////////// | 1346 /////////////////////////////////////////////////////////////////////////////// |
1347 // Browser, content::WebContentsDelegate implementation: | 1347 // Browser, content::WebContentsDelegate implementation: |
1348 | 1348 |
1349 WebContents* Browser::OpenURLFromTab(WebContents* source, | 1349 WebContents* Browser::OpenURLFromTab(WebContents* source, |
1350 const OpenURLParams& params) { | 1350 const OpenURLParams& params) { |
| 1351 if (is_devtools()) { |
| 1352 DevToolsWindow* window = DevToolsWindow::AsDevToolsWindow(source); |
| 1353 DCHECK(window); |
| 1354 return window->OpenURLFromTab(source, params); |
| 1355 } |
| 1356 |
1351 chrome::NavigateParams nav_params(this, params.url, params.transition); | 1357 chrome::NavigateParams nav_params(this, params.url, params.transition); |
1352 FillNavigateParamsFromOpenURLParams(&nav_params, params); | 1358 FillNavigateParamsFromOpenURLParams(&nav_params, params); |
1353 nav_params.source_contents = source; | 1359 nav_params.source_contents = source; |
1354 nav_params.tabstrip_add_types = TabStripModel::ADD_NONE; | 1360 nav_params.tabstrip_add_types = TabStripModel::ADD_NONE; |
1355 if (params.user_gesture) | 1361 if (params.user_gesture) |
1356 nav_params.window_action = chrome::NavigateParams::SHOW_WINDOW; | 1362 nav_params.window_action = chrome::NavigateParams::SHOW_WINDOW; |
1357 nav_params.user_gesture = params.user_gesture; | 1363 nav_params.user_gesture = params.user_gesture; |
1358 | 1364 |
1359 PopupBlockerTabHelper* popup_blocker_helper = NULL; | 1365 PopupBlockerTabHelper* popup_blocker_helper = NULL; |
1360 if (source) | 1366 if (source) |
(...skipping 1177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2538 if (contents && !allow_js_access) { | 2544 if (contents && !allow_js_access) { |
2539 contents->web_contents()->GetController().LoadURL( | 2545 contents->web_contents()->GetController().LoadURL( |
2540 target_url, | 2546 target_url, |
2541 content::Referrer(), | 2547 content::Referrer(), |
2542 ui::PAGE_TRANSITION_LINK, | 2548 ui::PAGE_TRANSITION_LINK, |
2543 std::string()); // No extra headers. | 2549 std::string()); // No extra headers. |
2544 } | 2550 } |
2545 | 2551 |
2546 return contents != NULL; | 2552 return contents != NULL; |
2547 } | 2553 } |
OLD | NEW |