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 1428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1439 *proceed_to_fire_unload = | 1439 *proceed_to_fire_unload = |
1440 fast_unload_controller_->BeforeUnloadFired(web_contents, proceed); | 1440 fast_unload_controller_->BeforeUnloadFired(web_contents, proceed); |
1441 } else { | 1441 } else { |
1442 *proceed_to_fire_unload = | 1442 *proceed_to_fire_unload = |
1443 unload_controller_->BeforeUnloadFired(web_contents, proceed); | 1443 unload_controller_->BeforeUnloadFired(web_contents, proceed); |
1444 } | 1444 } |
1445 } | 1445 } |
1446 | 1446 |
1447 bool Browser::ShouldFocusLocationBarByDefault(WebContents* source) { | 1447 bool Browser::ShouldFocusLocationBarByDefault(WebContents* source) { |
1448 const content::NavigationEntry* entry = | 1448 const content::NavigationEntry* entry = |
1449 source->GetController().GetActiveEntry(); | 1449 source->GetController().GetVisibleEntry(); |
1450 if (entry) { | 1450 if (entry) { |
1451 GURL url = entry->GetURL(); | 1451 GURL url = entry->GetURL(); |
1452 GURL virtual_url = entry->GetVirtualURL(); | 1452 GURL virtual_url = entry->GetVirtualURL(); |
1453 if ((url.SchemeIs(chrome::kChromeUIScheme) && | 1453 if ((url.SchemeIs(chrome::kChromeUIScheme) && |
1454 url.host() == chrome::kChromeUINewTabHost) || | 1454 url.host() == chrome::kChromeUINewTabHost) || |
1455 (virtual_url.SchemeIs(chrome::kChromeUIScheme) && | 1455 (virtual_url.SchemeIs(chrome::kChromeUIScheme) && |
1456 virtual_url.host() == chrome::kChromeUINewTabHost)) { | 1456 virtual_url.host() == chrome::kChromeUINewTabHost)) { |
1457 return true; | 1457 return true; |
1458 } | 1458 } |
1459 } | 1459 } |
(...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2276 if (contents && !allow_js_access) { | 2276 if (contents && !allow_js_access) { |
2277 contents->web_contents()->GetController().LoadURL( | 2277 contents->web_contents()->GetController().LoadURL( |
2278 target_url, | 2278 target_url, |
2279 content::Referrer(), | 2279 content::Referrer(), |
2280 content::PAGE_TRANSITION_LINK, | 2280 content::PAGE_TRANSITION_LINK, |
2281 std::string()); // No extra headers. | 2281 std::string()); // No extra headers. |
2282 } | 2282 } |
2283 | 2283 |
2284 return contents != NULL; | 2284 return contents != NULL; |
2285 } | 2285 } |
OLD | NEW |