Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(658)

Side by Side Diff: chrome/browser/ui/browser.cc

Issue 10854040: Add hooks to content to request permission to connect to the PPAPI broker. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 961 matching lines...) Expand 10 before | Expand all | Expand 10 after
972 972
973 InfoBarDelegate* infobar = 973 InfoBarDelegate* infobar =
974 new MediaStreamInfoBarDelegate(infobar_helper, controller.release()); 974 new MediaStreamInfoBarDelegate(infobar_helper, controller.release());
975 if (old_infobar) 975 if (old_infobar)
976 infobar_helper->ReplaceInfoBar(old_infobar, infobar); 976 infobar_helper->ReplaceInfoBar(old_infobar, infobar);
977 else 977 else
978 infobar_helper->AddInfoBar(infobar); 978 infobar_helper->AddInfoBar(infobar);
979 } 979 }
980 } 980 }
981 981
982 // static
983 void Browser::RequestPpapiBrokerPermissionHelper(
984 WebContents* web_contents,
985 const GURL& url,
986 const FilePath& plugin_path,
987 const base::Callback<void(bool)>& callback) {
988 // TODO(bauerb): Request permission.
989 callback.Run(true);
990 }
991
982 void Browser::UpdateUIForNavigationInTab(TabContents* contents, 992 void Browser::UpdateUIForNavigationInTab(TabContents* contents,
983 content::PageTransition transition, 993 content::PageTransition transition,
984 bool user_initiated) { 994 bool user_initiated) {
985 tab_strip_model_->TabNavigating(contents, transition); 995 tab_strip_model_->TabNavigating(contents, transition);
986 996
987 bool contents_is_selected = contents == chrome::GetActiveTabContents(this); 997 bool contents_is_selected = contents == chrome::GetActiveTabContents(this);
988 if (user_initiated && contents_is_selected && window()->GetLocationBar()) { 998 if (user_initiated && contents_is_selected && window()->GetLocationBar()) {
989 // Forcibly reset the location bar if the url is going to change in the 999 // Forcibly reset the location bar if the url is going to change in the
990 // current tab, since otherwise it won't discard any ongoing user edits, 1000 // current tab, since otherwise it won't discard any ongoing user edits,
991 // since it doesn't realize this is a user-initiated action. 1001 // since it doesn't realize this is a user-initiated action.
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after
1700 fullscreen_controller_->LostMouseLock(); 1710 fullscreen_controller_->LostMouseLock();
1701 } 1711 }
1702 1712
1703 void Browser::RequestMediaAccessPermission( 1713 void Browser::RequestMediaAccessPermission(
1704 content::WebContents* web_contents, 1714 content::WebContents* web_contents,
1705 const content::MediaStreamRequest* request, 1715 const content::MediaStreamRequest* request,
1706 const content::MediaResponseCallback& callback) { 1716 const content::MediaResponseCallback& callback) {
1707 RequestMediaAccessPermissionHelper(web_contents, request, callback); 1717 RequestMediaAccessPermissionHelper(web_contents, request, callback);
1708 } 1718 }
1709 1719
1720 void Browser::RequestPpapiBrokerPermission(
1721 WebContents* web_contents,
1722 const GURL& url,
1723 const FilePath& plugin_path,
1724 const base::Callback<void(bool)>& callback) {
1725 RequestPpapiBrokerPermissionHelper(web_contents, url, plugin_path,
1726 callback);
1727 }
1728
1710 /////////////////////////////////////////////////////////////////////////////// 1729 ///////////////////////////////////////////////////////////////////////////////
1711 // Browser, CoreTabHelperDelegate implementation: 1730 // Browser, CoreTabHelperDelegate implementation:
1712 1731
1713 void Browser::SwapTabContents(TabContents* old_tab_contents, 1732 void Browser::SwapTabContents(TabContents* old_tab_contents,
1714 TabContents* new_tab_contents) { 1733 TabContents* new_tab_contents) {
1715 int index = tab_strip_model_->GetIndexOfTabContents(old_tab_contents); 1734 int index = tab_strip_model_->GetIndexOfTabContents(old_tab_contents);
1716 DCHECK_NE(TabStripModel::kNoTab, index); 1735 DCHECK_NE(TabStripModel::kNoTab, index);
1717 tab_strip_model_->ReplaceTabContentsAt(index, new_tab_contents); 1736 tab_strip_model_->ReplaceTabContentsAt(index, new_tab_contents);
1718 } 1737 }
1719 1738
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
2319 if (contents && !allow_js_access) { 2338 if (contents && !allow_js_access) {
2320 contents->web_contents()->GetController().LoadURL( 2339 contents->web_contents()->GetController().LoadURL(
2321 target_url, 2340 target_url,
2322 content::Referrer(), 2341 content::Referrer(),
2323 content::PAGE_TRANSITION_LINK, 2342 content::PAGE_TRANSITION_LINK,
2324 std::string()); // No extra headers. 2343 std::string()); // No extra headers.
2325 } 2344 }
2326 2345
2327 return contents != NULL; 2346 return contents != NULL;
2328 } 2347 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698