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 1645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1656 if (PermissionBubbleManager::Enabled() && bubble_manager) { | 1656 if (PermissionBubbleManager::Enabled() && bubble_manager) { |
1657 bubble_manager->AddRequest( | 1657 bubble_manager->AddRequest( |
1658 new RegisterProtocolHandlerPermissionRequest(registry, handler, | 1658 new RegisterProtocolHandlerPermissionRequest(registry, handler, |
1659 url, user_gesture)); | 1659 url, user_gesture)); |
1660 } else { | 1660 } else { |
1661 RegisterProtocolHandlerInfoBarDelegate::Create( | 1661 RegisterProtocolHandlerInfoBarDelegate::Create( |
1662 InfoBarService::FromWebContents(web_contents), registry, handler); | 1662 InfoBarService::FromWebContents(web_contents), registry, handler); |
1663 } | 1663 } |
1664 } | 1664 } |
1665 | 1665 |
| 1666 void Browser::UnregisterProtocolHandler(WebContents* web_contents, |
| 1667 const std::string& protocol, |
| 1668 const GURL& url, |
| 1669 bool user_gesture) { |
| 1670 // user_gesture will be used in case we decide to have confirmation bubble |
| 1671 // for user while un-registering the handler. |
| 1672 Profile* profile = |
| 1673 Profile::FromBrowserContext(web_contents->GetBrowserContext()); |
| 1674 if (profile->IsOffTheRecord()) |
| 1675 return; |
| 1676 |
| 1677 ProtocolHandler handler = |
| 1678 ProtocolHandler::CreateProtocolHandler(protocol, url); |
| 1679 |
| 1680 ProtocolHandlerRegistry* registry = |
| 1681 ProtocolHandlerRegistryFactory::GetForProfile(profile); |
| 1682 registry->RemoveHandler(handler); |
| 1683 } |
| 1684 |
1666 void Browser::UpdatePreferredSize(WebContents* source, | 1685 void Browser::UpdatePreferredSize(WebContents* source, |
1667 const gfx::Size& pref_size) { | 1686 const gfx::Size& pref_size) { |
1668 window_->UpdatePreferredSize(source, pref_size); | 1687 window_->UpdatePreferredSize(source, pref_size); |
1669 } | 1688 } |
1670 | 1689 |
1671 void Browser::ResizeDueToAutoResize(WebContents* source, | 1690 void Browser::ResizeDueToAutoResize(WebContents* source, |
1672 const gfx::Size& new_size) { | 1691 const gfx::Size& new_size) { |
1673 window_->ResizeDueToAutoResize(source, new_size); | 1692 window_->ResizeDueToAutoResize(source, new_size); |
1674 } | 1693 } |
1675 | 1694 |
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2422 if (contents && !allow_js_access) { | 2441 if (contents && !allow_js_access) { |
2423 contents->web_contents()->GetController().LoadURL( | 2442 contents->web_contents()->GetController().LoadURL( |
2424 target_url, | 2443 target_url, |
2425 content::Referrer(), | 2444 content::Referrer(), |
2426 content::PAGE_TRANSITION_LINK, | 2445 content::PAGE_TRANSITION_LINK, |
2427 std::string()); // No extra headers. | 2446 std::string()); // No extra headers. |
2428 } | 2447 } |
2429 | 2448 |
2430 return contents != NULL; | 2449 return contents != NULL; |
2431 } | 2450 } |
OLD | NEW |