| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "chrome/browser/favicon/favicon_service.h" | 7 #include "chrome/browser/favicon/favicon_service.h" |
| 8 #include "chrome/browser/favicon/favicon_service_factory.h" |
| 8 #include "chrome/browser/intents/register_intent_handler_infobar_delegate.h" | 9 #include "chrome/browser/intents/register_intent_handler_infobar_delegate.h" |
| 9 #include "chrome/browser/intents/web_intents_registry_factory.h" | 10 #include "chrome/browser/intents/web_intents_registry_factory.h" |
| 10 #include "chrome/browser/intents/web_intents_util.h" | 11 #include "chrome/browser/intents/web_intents_util.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/browser/ui/browser.h" | 13 #include "chrome/browser/ui/browser.h" |
| 13 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 14 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 14 #include "content/public/browser/web_contents.h" | 15 #include "content/public/browser/web_contents.h" |
| 15 #include "webkit/glue/web_intent_service_data.h" | 16 #include "webkit/glue/web_intent_service_data.h" |
| 16 | 17 |
| 17 using content::WebContents; | 18 using content::WebContents; |
| 18 | 19 |
| 19 // static | 20 // static |
| 20 void Browser::RegisterIntentHandlerHelper( | 21 void Browser::RegisterIntentHandlerHelper( |
| 21 WebContents* tab, | 22 WebContents* tab, |
| 22 const webkit_glue::WebIntentServiceData& data, | 23 const webkit_glue::WebIntentServiceData& data, |
| 23 bool user_gesture) { | 24 bool user_gesture) { |
| 24 TabContents* tab_contents = TabContents::FromWebContents(tab); | 25 TabContents* tab_contents = TabContents::FromWebContents(tab); |
| 25 if (!tab_contents || tab_contents->profile()->IsOffTheRecord()) | 26 if (!tab_contents || tab_contents->profile()->IsOffTheRecord()) |
| 26 return; | 27 return; |
| 27 | 28 |
| 28 if (!web_intents::IsWebIntentsEnabledForProfile(tab_contents->profile())) | 29 if (!web_intents::IsWebIntentsEnabledForProfile(tab_contents->profile())) |
| 29 return; | 30 return; |
| 30 | 31 |
| 31 FaviconService* favicon_service = | 32 FaviconService* favicon_service = FaviconServiceFactory::GetForProfile( |
| 32 tab_contents->profile()->GetFaviconService(Profile::EXPLICIT_ACCESS); | 33 tab_contents->profile(), Profile::EXPLICIT_ACCESS); |
| 33 | 34 |
| 34 RegisterIntentHandlerInfoBarDelegate::MaybeShowIntentInfoBar( | 35 RegisterIntentHandlerInfoBarDelegate::MaybeShowIntentInfoBar( |
| 35 tab_contents->infobar_tab_helper(), | 36 tab_contents->infobar_tab_helper(), |
| 36 WebIntentsRegistryFactory::GetForProfile(tab_contents->profile()), | 37 WebIntentsRegistryFactory::GetForProfile(tab_contents->profile()), |
| 37 data, | 38 data, |
| 38 favicon_service, | 39 favicon_service, |
| 39 tab->GetURL()); | 40 tab->GetURL()); |
| 40 } | 41 } |
| OLD | NEW |