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 1412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1423 return false; | 1423 return false; |
1424 } | 1424 } |
1425 | 1425 |
1426 gfx::Rect Browser::GetRootWindowResizerRect() const { | 1426 gfx::Rect Browser::GetRootWindowResizerRect() const { |
1427 return window_->GetRootWindowResizerRect(); | 1427 return window_->GetRootWindowResizerRect(); |
1428 } | 1428 } |
1429 | 1429 |
1430 void Browser::BeforeUnloadFired(WebContents* web_contents, | 1430 void Browser::BeforeUnloadFired(WebContents* web_contents, |
1431 bool proceed, | 1431 bool proceed, |
1432 bool* proceed_to_fire_unload) { | 1432 bool* proceed_to_fire_unload) { |
| 1433 if (is_devtools() && DevToolsWindow::HandleBeforeUnload(web_contents, |
| 1434 proceed, proceed_to_fire_unload)) |
| 1435 return; |
| 1436 |
1433 if (IsFastTabUnloadEnabled()) { | 1437 if (IsFastTabUnloadEnabled()) { |
1434 *proceed_to_fire_unload = | 1438 *proceed_to_fire_unload = |
1435 fast_unload_controller_->BeforeUnloadFired(web_contents, proceed); | 1439 fast_unload_controller_->BeforeUnloadFired(web_contents, proceed); |
1436 } else { | 1440 } else { |
1437 *proceed_to_fire_unload = | 1441 *proceed_to_fire_unload = |
1438 unload_controller_->BeforeUnloadFired(web_contents, proceed); | 1442 unload_controller_->BeforeUnloadFired(web_contents, proceed); |
1439 } | 1443 } |
1440 } | 1444 } |
1441 | 1445 |
1442 bool Browser::ShouldFocusLocationBarByDefault(WebContents* source) { | 1446 bool Browser::ShouldFocusLocationBarByDefault(WebContents* source) { |
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2271 if (contents && !allow_js_access) { | 2275 if (contents && !allow_js_access) { |
2272 contents->web_contents()->GetController().LoadURL( | 2276 contents->web_contents()->GetController().LoadURL( |
2273 target_url, | 2277 target_url, |
2274 content::Referrer(), | 2278 content::Referrer(), |
2275 content::PAGE_TRANSITION_LINK, | 2279 content::PAGE_TRANSITION_LINK, |
2276 std::string()); // No extra headers. | 2280 std::string()); // No extra headers. |
2277 } | 2281 } |
2278 | 2282 |
2279 return contents != NULL; | 2283 return contents != NULL; |
2280 } | 2284 } |
OLD | NEW |