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

Unified Diff: chrome/browser/ui/browser.cc

Issue 11414286: Remove unneeded TabContents::FromWebContents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 8 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 2555e198b8c2b905c51d7041602af71a634997be..e13461f0c7263820bf74ea327de590f05907181c 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -885,15 +885,15 @@ void Browser::RegisterProtocolHandlerHelper(WebContents* web_contents,
const string16& title,
bool user_gesture,
BrowserWindow* window) {
- TabContents* tab_contents = TabContents::FromWebContents(web_contents);
- if (!tab_contents || tab_contents->profile()->IsOffTheRecord())
+ Profile* profile =
+ Profile::FromBrowserContext(web_contents->GetBrowserContext());
+ if (profile->IsOffTheRecord())
return;
ProtocolHandler handler =
ProtocolHandler::CreateProtocolHandler(protocol, url, title);
- ProtocolHandlerRegistry* registry =
- tab_contents->profile()->GetProtocolHandlerRegistry();
+ ProtocolHandlerRegistry* registry = profile->GetProtocolHandlerRegistry();
TabSpecificContentSettings* tab_content_settings =
TabSpecificContentSettings::FromWebContents(web_contents);
@@ -963,10 +963,11 @@ void Browser::RequestMediaAccessPermissionHelper(
content::WebContents* web_contents,
const content::MediaStreamRequest* request,
const content::MediaResponseCallback& callback) {
- TabContents* tab = TabContents::FromWebContents(web_contents);
+ Profile* profile =
+ Profile::FromBrowserContext(web_contents->GetBrowserContext());
scoped_ptr<MediaStreamDevicesController>
- controller(new MediaStreamDevicesController(tab->profile(),
+ controller(new MediaStreamDevicesController(profile,
request,
callback));
if (!controller->DismissInfoBarAndTakeActionOnSettings()) {
« no previous file with comments | « chrome/browser/ui/auto_login_info_bar_delegate.cc ('k') | chrome/browser/ui/fullscreen/fullscreen_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698