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