Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 // OS_WIN | 10 #endif // OS_WIN |
| (...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 948 | 948 |
| 949 InfoBarDelegate* infobar = | 949 InfoBarDelegate* infobar = |
| 950 new MediaStreamInfoBarDelegate(infobar_helper, controller.release()); | 950 new MediaStreamInfoBarDelegate(infobar_helper, controller.release()); |
| 951 if (old_infobar) | 951 if (old_infobar) |
| 952 infobar_helper->ReplaceInfoBar(old_infobar, infobar); | 952 infobar_helper->ReplaceInfoBar(old_infobar, infobar); |
| 953 else | 953 else |
| 954 infobar_helper->AddInfoBar(infobar); | 954 infobar_helper->AddInfoBar(infobar); |
| 955 } | 955 } |
| 956 } | 956 } |
| 957 | 957 |
| 958 // static | |
| 959 void Browser::RequestPpapiBrokerPermissionHelper( | |
| 960 WebContents* web_contents, | |
| 961 const GURL& url, | |
| 962 const FilePath& plugin_path, | |
| 963 const base::Callback<void(bool)>& callback) { | |
| 964 // TODO(bauerb): Request permission. | |
|
ddorwin
2012/08/12 22:51:16
FYI, should automatically return false in certain
Bernhard Bauer
2012/08/13 09:02:11
Do you know what these cases are? FYI, the actual
ddorwin
2012/08/13 22:27:04
As discussed offline.
| |
| 965 callback.Run(true); | |
| 966 } | |
| 967 | |
| 958 void Browser::UpdateUIForNavigationInTab(TabContents* contents, | 968 void Browser::UpdateUIForNavigationInTab(TabContents* contents, |
| 959 content::PageTransition transition, | 969 content::PageTransition transition, |
| 960 bool user_initiated) { | 970 bool user_initiated) { |
| 961 tab_strip_model_->TabNavigating(contents, transition); | 971 tab_strip_model_->TabNavigating(contents, transition); |
| 962 | 972 |
| 963 bool contents_is_selected = contents == chrome::GetActiveTabContents(this); | 973 bool contents_is_selected = contents == chrome::GetActiveTabContents(this); |
| 964 if (user_initiated && contents_is_selected && window()->GetLocationBar()) { | 974 if (user_initiated && contents_is_selected && window()->GetLocationBar()) { |
| 965 // Forcibly reset the location bar if the url is going to change in the | 975 // Forcibly reset the location bar if the url is going to change in the |
| 966 // current tab, since otherwise it won't discard any ongoing user edits, | 976 // current tab, since otherwise it won't discard any ongoing user edits, |
| 967 // since it doesn't realize this is a user-initiated action. | 977 // since it doesn't realize this is a user-initiated action. |
| (...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1676 fullscreen_controller_->LostMouseLock(); | 1686 fullscreen_controller_->LostMouseLock(); |
| 1677 } | 1687 } |
| 1678 | 1688 |
| 1679 void Browser::RequestMediaAccessPermission( | 1689 void Browser::RequestMediaAccessPermission( |
| 1680 content::WebContents* web_contents, | 1690 content::WebContents* web_contents, |
| 1681 const content::MediaStreamRequest* request, | 1691 const content::MediaStreamRequest* request, |
| 1682 const content::MediaResponseCallback& callback) { | 1692 const content::MediaResponseCallback& callback) { |
| 1683 RequestMediaAccessPermissionHelper(web_contents, request, callback); | 1693 RequestMediaAccessPermissionHelper(web_contents, request, callback); |
| 1684 } | 1694 } |
| 1685 | 1695 |
| 1696 void Browser::RequestPpapiBrokerPermission( | |
| 1697 WebContents* web_contents, | |
| 1698 const GURL& url, | |
| 1699 const FilePath& plugin_path, | |
| 1700 const base::Callback<void(bool)>& callback) { | |
| 1701 RequestPpapiBrokerPermissionHelper(web_contents, url, plugin_path, | |
| 1702 callback); | |
| 1703 } | |
| 1704 | |
| 1686 /////////////////////////////////////////////////////////////////////////////// | 1705 /////////////////////////////////////////////////////////////////////////////// |
| 1687 // Browser, CoreTabHelperDelegate implementation: | 1706 // Browser, CoreTabHelperDelegate implementation: |
| 1688 | 1707 |
| 1689 void Browser::SwapTabContents(TabContents* old_tab_contents, | 1708 void Browser::SwapTabContents(TabContents* old_tab_contents, |
| 1690 TabContents* new_tab_contents) { | 1709 TabContents* new_tab_contents) { |
| 1691 int index = tab_strip_model_->GetIndexOfTabContents(old_tab_contents); | 1710 int index = tab_strip_model_->GetIndexOfTabContents(old_tab_contents); |
| 1692 DCHECK_NE(TabStripModel::kNoTab, index); | 1711 DCHECK_NE(TabStripModel::kNoTab, index); |
| 1693 tab_strip_model_->ReplaceTabContentsAt(index, new_tab_contents); | 1712 tab_strip_model_->ReplaceTabContentsAt(index, new_tab_contents); |
| 1694 } | 1713 } |
| 1695 | 1714 |
| (...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2295 if (contents && !allow_js_access) { | 2314 if (contents && !allow_js_access) { |
| 2296 contents->web_contents()->GetController().LoadURL( | 2315 contents->web_contents()->GetController().LoadURL( |
| 2297 target_url, | 2316 target_url, |
| 2298 content::Referrer(), | 2317 content::Referrer(), |
| 2299 content::PAGE_TRANSITION_LINK, | 2318 content::PAGE_TRANSITION_LINK, |
| 2300 std::string()); // No extra headers. | 2319 std::string()); // No extra headers. |
| 2301 } | 2320 } |
| 2302 | 2321 |
| 2303 return contents != NULL; | 2322 return contents != NULL; |
| 2304 } | 2323 } |
| OLD | NEW |