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 1646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1657 if (PermissionBubbleManager::Enabled() && bubble_manager) { | 1657 if (PermissionBubbleManager::Enabled() && bubble_manager) { |
1658 bubble_manager->AddRequest( | 1658 bubble_manager->AddRequest( |
1659 new RegisterProtocolHandlerPermissionRequest(registry, handler, | 1659 new RegisterProtocolHandlerPermissionRequest(registry, handler, |
1660 url, user_gesture)); | 1660 url, user_gesture)); |
1661 } else { | 1661 } else { |
1662 RegisterProtocolHandlerInfoBarDelegate::Create( | 1662 RegisterProtocolHandlerInfoBarDelegate::Create( |
1663 InfoBarService::FromWebContents(web_contents), registry, handler); | 1663 InfoBarService::FromWebContents(web_contents), registry, handler); |
1664 } | 1664 } |
1665 } | 1665 } |
1666 | 1666 |
1667 void Browser::UnregisterProtocolHandler(WebContents* web_contents, | |
1668 const std::string& protocol, | |
1669 const GURL& url, | |
1670 bool user_gesture) { | |
kenrb
2014/07/11 14:38:37
This appears to be an unused argument passed from
| |
1671 Profile* profile = | |
1672 Profile::FromBrowserContext(web_contents->GetBrowserContext()); | |
1673 if (profile->IsOffTheRecord()) | |
1674 return; | |
1675 | |
1676 ProtocolHandler handler = | |
1677 ProtocolHandler::CreateProtocolHandler(protocol, url); | |
1678 | |
1679 ProtocolHandlerRegistry* registry = | |
1680 ProtocolHandlerRegistryFactory::GetForProfile(profile); | |
1681 registry->RemoveHandler(handler); | |
1682 } | |
1683 | |
1667 void Browser::UpdatePreferredSize(WebContents* source, | 1684 void Browser::UpdatePreferredSize(WebContents* source, |
1668 const gfx::Size& pref_size) { | 1685 const gfx::Size& pref_size) { |
1669 window_->UpdatePreferredSize(source, pref_size); | 1686 window_->UpdatePreferredSize(source, pref_size); |
1670 } | 1687 } |
1671 | 1688 |
1672 void Browser::ResizeDueToAutoResize(WebContents* source, | 1689 void Browser::ResizeDueToAutoResize(WebContents* source, |
1673 const gfx::Size& new_size) { | 1690 const gfx::Size& new_size) { |
1674 window_->ResizeDueToAutoResize(source, new_size); | 1691 window_->ResizeDueToAutoResize(source, new_size); |
1675 } | 1692 } |
1676 | 1693 |
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2420 if (contents && !allow_js_access) { | 2437 if (contents && !allow_js_access) { |
2421 contents->web_contents()->GetController().LoadURL( | 2438 contents->web_contents()->GetController().LoadURL( |
2422 target_url, | 2439 target_url, |
2423 content::Referrer(), | 2440 content::Referrer(), |
2424 content::PAGE_TRANSITION_LINK, | 2441 content::PAGE_TRANSITION_LINK, |
2425 std::string()); // No extra headers. | 2442 std::string()); // No extra headers. |
2426 } | 2443 } |
2427 | 2444 |
2428 return contents != NULL; | 2445 return contents != NULL; |
2429 } | 2446 } |
OLD | NEW |