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

Unified Diff: chrome/browser/intents/register_intent_handler_helper.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/intents/register_intent_handler_helper.cc
diff --git a/chrome/browser/intents/register_intent_handler_helper.cc b/chrome/browser/intents/register_intent_handler_helper.cc
index 01c1e2cc94caeaebaf6ea6c8ae6d0fb4e0f26009..12e6acbd7634870abde89444b1f7f24eb547b64e 100644
--- a/chrome/browser/intents/register_intent_handler_helper.cc
+++ b/chrome/browser/intents/register_intent_handler_helper.cc
@@ -12,7 +12,6 @@
#include "chrome/browser/intents/web_intents_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/tab_contents/tab_contents.h"
#include "content/public/browser/web_contents.h"
#include "webkit/glue/web_intent_service_data.h"
@@ -23,19 +22,20 @@ void Browser::RegisterIntentHandlerHelper(
WebContents* web_contents,
const webkit_glue::WebIntentServiceData& data,
bool user_gesture) {
- 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;
- if (!web_intents::IsWebIntentsEnabledForProfile(tab_contents->profile()))
+ if (!web_intents::IsWebIntentsEnabledForProfile(profile))
return;
FaviconService* favicon_service = FaviconServiceFactory::GetForProfile(
- tab_contents->profile(), Profile::EXPLICIT_ACCESS);
+ profile, Profile::EXPLICIT_ACCESS);
RegisterIntentHandlerInfoBarDelegate::MaybeShowIntentInfoBar(
InfoBarTabHelper::FromWebContents(web_contents),
- WebIntentsRegistryFactory::GetForProfile(tab_contents->profile()),
+ WebIntentsRegistryFactory::GetForProfile(profile),
data,
favicon_service,
web_contents->GetURL());
« no previous file with comments | « chrome/browser/automation/testing_automation_provider.cc ('k') | chrome/browser/sessions/tab_restore_service_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698